Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Crash when uploading custom map data to MapBox Server #1200

Closed
MarkWS opened this issue Feb 19, 2015 · 6 comments
Closed

Crash when uploading custom map data to MapBox Server #1200

MarkWS opened this issue Feb 19, 2015 · 6 comments

Comments

@MarkWS
Copy link

MarkWS commented Feb 19, 2015

We've added in custom data (shapefiles) and saved that to the local dir.
After saving when choosing "Upload to Mapbox" MBS crashes.
Win 7 Pro, MBS v0.2.5

@springmeyer
Copy link
Contributor

Can you please provide your log file? (%USERPROFILE%/.mapbox-studio/app.log)

@MarkWS
Copy link
Author

MarkWS commented Feb 19, 2015

no log file but there is a DB file, is that what you're looking for, if so how to send?

@MarkWS
Copy link
Author

MarkWS commented Feb 19, 2015

Sorry Dane, found it. Whats the best way to send?

@MarkWS
Copy link
Author

MarkWS commented Feb 19, 2015

here is a screen shot, let me know if you need the entire file and how to send.
capture

@wilhelmberg
Copy link
Contributor

@MarkWS a couple of things for you to try with your shapefiles:

  • projection

Are your shapefiles already in Web Mercator projection (EPSG:3857)?
If not, please reproject them before adding them to the project, this takes the load off of Mapbox Studio to do this on the fly.
You can change the projection with QGIS or with ogr2ogr:
ogr2ogr -f "ESRI Shapefile" in.shp out.shp -s_srs EPSG:<CURRENT-EPSG-CODE> -t_srs EPSG:3857

  • encoding

Are your shape files (or to be more specific the DBF files) UTF-8 encoded?
You can change the encoding with QGIS or with ogr2ogr and the -lco ENCODING=UTF-8 flag:
ogr2ogr out.shp in.shp -lco ENCODING=UTF-8

  • shapeindex

You can boost the performance of shapefiles by an order of magnitude by creating a spatial index:

  • open cmd prompt
  • cd into directory where new, reprojected shape files lives
  • execute:
"C:\Program Files\mapbox-studio\resources\app\node_modules\mapnik\lib\binding\node-v11-win32-x64\shapeindex" <YOUR-SHAPE-FILE>.shp

@MarkWS
Copy link
Author

MarkWS commented Feb 20, 2015

Thanks Wilhelm, this worked great.
We reprojected the files again to EPSG:3857 (which they were) and encoded UTF-8 and they uploaded fine. We did not need to adjust the Shapeindex but may try that as well. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants