mapbox / mapbox-studio-classic

https://www.mapbox.com/mapbox-studio/
BSD 3-Clause "New" or "Revised" License
1.14k stars 229 forks source link

KML/GPX support broken on Windows #1473

Closed wilhelmberg closed 8 years ago

wilhelmberg commented 9 years ago

Since 0.2.8 it is not possible to open KMLs anymore (verified with 0.2.7 and 0.3.1).

They fail with

Error: OGR source missing extent

I tracked it down to the mapnik-omnivore function getExtent where

  var tranformation = new gdal.CoordinateTransformation(
    this.gdalLayer.srs,
    gdal.SpatialReference.fromEPSG(4326)
  );

fails with Unable to open EPSG support file gcs.csv. Try setting GDAL_DATA.:

image

GDAL_DATA is set correctly and the directory, that GDAL_DATA points to contains gcs.csv.

Using mapnik-omnivore alone (not in the context of Mapbox Studio Classic) digest() works as expected and returns the correct extent.

Maybe postinstall step npm dedupe messes something up.

Investigating ...

/cc @amyleew

snowpong commented 8 years ago

Is there a workaround for existing users of 0.3.3 for Windows? It fails with the same error.

wilhelmberg commented 8 years ago

@snowpong not at the moment, but the underlying issue has been resolved and next Studio Classic version (https://github.com/mapbox/mapbox-studio-classic/issues/1491) should contain the fix.

In the meantime you could use QGIS or ogr2ogr to convert the KML to a shapefile and work with that.

ogr2ogr -f "ESRI Shapefile" out.shp YOUR.kml -t_srs EPSG:3857
mannylopez commented 8 years ago

Also happens on Mac when trying to upload run.gpx. I also get Error: OGR source missing extent.

I was able to upload the same file via the uploads page so the data is good.

springmeyer commented 8 years ago

@mannylopez - yes, this is fixed in mb-pages branch, but needs to get released still for users.

synergywp commented 8 years ago

Anything new with this? Thanks.

springmeyer commented 8 years ago

This should be fixed in v0.3.4 now that we have upgraded to latest node-gdal (v0.8.0) with this fix: https://github.com/naturalatlas/node-gdal/pull/134. Keeping open until either me or @mapsam confirms via manual testing.

springmeyer commented 8 years ago

confirmed via local testing that KML is now working in v0.3.4 and GPX is working except for GPX with <time> element. That fix will need to wait on https://github.com/mapbox/mapbox-studio-classic/issues/1543.