I'm a newbie to the GIS world and I'm trying to convert a shapefile to GeoJSON for use in Mapbox.
When I view the resulting layer in Mapbox, most of the features appear southeast by 20-30 feet of where they should be to match up properly with the underlying Mapbox map. (View at http://blueroomdesign.net/stlv/)
How do I adjust the Mapshaper command to fix this offset issue?
Here's the command line I'm currently using to convert it:
mapshaper -i prcl.shp -proj latlon -o prcl_out.geojson precision=0.000001
Some of the information from running the Mapshaper Info command on the shp file (below) looks relevant but I'm not quite sure how to interpret it or correct for it in the conversion process.
Layer name: prcl
Records: 127,748
Geometry
Type: polygon
Bounds: 551318.459568 982946.566771 592589.572865 1070913.306444
Proj.4: +proj=tmerc +x_0=152400.3048006096 +lon_0=-90.5 +k_0=0.9999333333333333 +lat_0=35.83333333333334 +to_meter=0.3048006096012192 +ellps=clrk66
Here's a link to the original shapefile zip: St Louis Parcel Data
Best Answer
When I inspect that shapefile using
ogrinfo
I see that it's a state plane projection that uses a NAD27 datum:It's likely you're experiencing problems with Mapshaper when projecting the data from the NAD27 to WGS84 datum as it's not accounting for the datum shift. This will cause your data to become misaligned when projected from the Missouri East state plane to WGS84.
I'm not able to find how to specify the input file's CRS in Mapshaper's documentation, but using ogr2ogr (another CLI tool for processing geospatial data), you can:
The resulting GeoJSON file is 49MB so I took a sample of it and uploaded it as a Github Gist which you may view here: https://gist.github.com/clhenrick/7f90a863d153f9ae2871012a1d624e0d