mapbox/millstone — Issue #26: ESRI:: fallback is needed both in millstone and node-srs
Author: springmeyer
Created: 2011-10-27 23:10:06+00:00
State: open

node-srs will fallback to trying to parse the prj as if it is an ESRI variant __if__ there is an exception thrown internally by ogr. But the design of node-srs is that it will return as much about the projection as it can if ogr internally does not throw. The original idea behind this design is that you might want to know various things about the projection even if you can't know all (like proj4 string or epsg #).

What this means for millstone/tilemill is that millstone needs to fallback to parsing files as ESRI variants if no proj4 value is known for a given prj (which is possible to be the case for ESRI variant files even if they never caused an exception in ogr originally).

So, the case where the projection is valid enough to be parsed by ogr but not valid enough to have its proj4 representation detected is the most critical case and will fail for all tilemill users until millstone falls back to trying a parse with ESRI:: pre-prepended. This is the same regression I fixed in tilemill 0.6.x but had regressed in 0.5.x after working in 0.4.x.

Overall I think the design and api of node-srs is terrible. Ideally soon we can properly wrap libgdal so we can do projection detection on all datasource types and ditch node-srs - calling it a temporary shim that got us this far.