mapbox / mapbox/mapnik-omnivore

Omnivore fails hard on martian coordinate systems

Open
#124 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
44
Forks
17
PR merge metrics
No merged PRs in 30d

Description

![marvin-the-martian](https://cloud.githubusercontent.com/assets/515424/9996682/2424e43a-6056-11e5-902d-c91e1d2846f2.jpg)

```
> digest ~/tmp/mars.tif
ERROR 6: Mercator_1SP with scale != 1.0 and latitude of origin != 0, not supported by PROJ.4.
ERROR 6: Mercator_1SP with scale != 1.0 and latitude of origin != 0, not supported by PROJ.4.

/Users/r/gh/mapbox/mapnik-omnivore/lib/raster.js:89
var current = new mapnik.Projection(this.projection);
^
TypeError: please provide a proj4 intialization string
at Raster.getExtent (/Users/r/gh/mapbox/mapnik-omnivore/lib/raster.js:89:17)
at Raster.getCenter (/Users/r/gh/mapbox/mapnik-omnivore/lib/raster.js:78:8)
at /Users/r/gh/mapbox/mapnik-omnivore/index.js:87:12
at pop (/Users/r/gh/mapbox/mapnik-omnivore/node_modules/queue-async/queue.js:24:14)
at /Users/r/gh/mapbox/mapnik-omnivore/node_modules/queue-async/queue.js:38:39
at /Users/r/gh/mapbox/mapnik-omnivore/index.js:82:7
at Object.oncomplete (fs.js:108:15)
```

There may be a general case here: catch errors related to data in coordinate systems that are not recognized by proj4.

An example file in a martian coordinate system is here s3://mapbox/tmp/rclark/mars.tif.

cc @GretaCB

Contributor guide

Open the contributing guide

Research direction

Start with lib/raster.js around line 89 and reproduce the failure using `digest ~/tmp/mars.tif` or the example at s3://mapbox/tmp/rclark/mars.tif. Trace how the error reaches Raster.getCenter and index.js:87. Done means coordinate-system data that PROJ.4 does not recognize is handled without the shown uncaught TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.