-
Notifications
You must be signed in to change notification settings - Fork 111
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
Panic when reading geojson with null geometries in UnmarshallJSON() #38
Comments
Thanks for the report. I just pushed a commit to so that in this case However, it probably doesn't make sense to return an error for this and just leave the geometry as nil. That way you can actually filter the bad stuff out. What do you think? |
My personal preference is to give a warning but return nil geometries for the relevant features so I can filter them out before later work, or implement error handling at that stage, without having to preprocess the data. |
According to the RFC section 3.2 Feature Object, it says
It is actually valid when the |
@changchingchen makes sense. I have the fix here #58 I'll merge it and bump the version in a few days. |
I am writing a program using SA2 geometries from the Australian Statistical Standard Geography which I have converted into geojson with the below code snippet.
When I try to run my code
I receive the following panic error
This was apparently caused missing geometries in the file (for statistical geographical classifications with no true spatial elements) and subsequently a pointer error when UnmarshallJSON. I fixed this by removing features will missing geometries in Python and resaving the file.
This scenario may well happen again to other users, especially if other data providers include features without spatial elements. Do you think it wise to put a check in to see if the geometry is present, or provide a specific error message?
The text was updated successfully, but these errors were encountered: