-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
British National Grid prj - I don't know that shp type #189
Comments
it's the |
is that even legal in shapefiles? I thought no and had a test that checked that we errored, but looking at the spec it doesn't say you can't |
Thanks for looking! I'll be honest I'm very new to shapefiles, where can I find the shape type equalling "null"?. Happy to put in my own checks for excluding those files to avoid it erroring. |
well the issue is that when you open a zipfile with 4 shapefiles in it this library tries to convert all 4 of them, and if one of them breaks then the whole thing breaks so that's why you're getting the error. So I think it's technically an error in this library. |
Leaving a note in case anyone has weird behaviour with British National Grid shapefiles. I have a scottish shapefile and the resulting geojson polygons are offset from their real positions by ~50 meters or so. The .prj has this:
If I replace it with a shapefile .prj I know is acurrately parsed, it lines up perfectly with the terrain:
I have no idea why whatever tool created the 1st .prj file has created it in such a way, but from now on I'm going to parse the .prj file, and replace it's contents with the 2nd if I detect it's British National Grid just to be sure. Despite the other differences I narrowed it down to one value that that lines up the polygons with the terrain correctly: I understand very little about projection systems so maybe there's a better way of fixing it but for now I'm going to do a text replacement if I detect it 🤷 Using jszip package:
|
I have 2 zip shapefiles, I believe they are both using the British National Grid (EPSG:27700)
One of them works fine, it's .prj contents are:
The other does not work and has this:
They seem to have slightly different values:
PROJCS: British_National_Grid vs British National Grid
GEOGCS: GCS_OSGB_1936 vs Ordnance Survey Great Brit
DATUM: D_OSGB_1936 vs Ordnance Survey Great Brit
I cannot control the output of these files as the latter comes from the Scottish goverment website.
Is there anything I can do to correct it during the processing with this lib?
I've uploaded "good" and "bad" zip files for reference
bad.zip
good.zip
It's not an invalid shapefile because uploading to https://mapshaper.org seems to process it fine
The text was updated successfully, but these errors were encountered: