mapbox / mapnik-omnivore

Node module that returns metadata about spatial files.
45 stars 19 forks source link

non WGS84 LL geojson #144

Open andrewharvey opened 8 years ago

andrewharvey commented 8 years ago

GeoJSON files are sometimes created in other coordinate systems apart from WGS84 LL.

Here is one such file created with FME.

{
   "type" : "FeatureCollection",
   "features" : [...],
   "name" : "",
   "crs" : {
      "type" : "name",
      "properties" : {
         "name" : "EPSG:3857"
      }
   }
}

mapnik-omnivore reports this as

  center: [ 14989880.5561838, -3332365.289841385 ],
  extent: 
   [ 12916705.4616073,
     -5263291.3207374,
     17063055.6507603,
     -1401439.25894537 ],
  minzoom: 0,
  maxzoom: 6,
  projection: '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs',

reading the CRS isn't straightforward, either crs.properties.name will be a legacy value like an EPSG code in which case anything except EPSG:4326 could be rejected, or it could be an OGC CRS URNs such as "urn:ogc:def:crs:OGC:1.3:CRS84".