-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
GeoJSON driver lco RFC7946 should be YES #4010
Comments
I'm not so keen on using RFC7946 by default. Doing so imply that we reproject to EPSG:4326 which might not always be suitable. |
I agree with Even and just because of the CRS. But what bugs me is that I never remember |
That is a fair point, I agree. What do you think about the default |
Coordinate precision applies also to other text bases formats (GML, CSV). Binary formats usually use doubles for storing coordinates and inaccuracy of floating points tend to lead loads of decimal (decimal 10.1 becomes 10.1000003814697265625). I am not sure what to say about the default precision. Degree units with 5 decimals may be enough for visualizing but when the aim is to deliver then I think that there should be as little data loss as possible. Differences in coordinates at nanometer level make them still not equal for computers. GeoJSON is a somewhat lossy format but it is still used as a medium for delivering data. With 7 decimals the precision corresponds to about 1 cm. That's usually good enough for visualizing but it is likely that some coordinates in a typical GIS data would not survive a roundtrip like PostGIS - GeoJSON - PostGIS. Every now and then I think that defaults are evil and it would be better to force users to give exact parameters and make them to take the responsibility but most of the time I understand that it would be cruel. So what is your suggestion for making everyone happy? |
My 2 cents as I opened the original issue on the QGIS side: I think as we are talking about GeoJSON and other geospatial formats, it is difficult to find reasoning to use precision beyond 1 cm in 99 % of use cases. Of course there are the ~1% of use cases where the decimals beyond 7 do matter, but I think the formats be default should serve the 99% of cases really well rather than having the 99% suffer in performance because of the 1%. What is the downside of having all of the decimals included in GeoJSONs? Quite often GeoJSON is used on the web and having less JSON to parse with can speed up applications significantly. Leaflet, OpenLayers, kepler.gl all happily use GeoJSON and all of them obviously have better performance if there is less data to chew. Also in cases of data transfer, does it make sense to include the data by default if it is commonly known it is inaccurate and not useful? Should there be a flag to indicate if the data should include all the decimals and by default the decimals should be limited to 7? So in general this would help to reduce file sizes. These are just my thoughts 🤷🏼♂️ |
I may agree that PRECISION=7 could be a a better default for GeoJSON(2008) but why not to think a bit deeper by the same? Even precision=7 gives unreasonable many decimals when the data are in some projected coordinate system. Perhaps a better option would be to implement a selection I thought that users could avoid having so many decimals also by cleaning their data by rounding but that does not seem to work with GeoJSON.
With GML the result is as I assumed:
Another place to think deeper is to consider if all text based formats could handle the coordinate precision in the same way and by using same parameters. Now we have |
I think this idea is worth considering but maybe this issue is not a right place, if GeoJSON 2008 is going to be the default value for now. @jratike80 should a another issue be made for that and this one be closed? |
This ticket is about if |
FWIW, if this ever comes to debate again, I'm +1 for
|
Expected behavior and actual behavior.
GeoJSON driver uses obsolete GeoJSON 2008 standard by default with
RFC7946
default value beingNO
. Since GeoJSON 2008 standard is marked as obsolete and it redirects to newer RFC7946 standard, the default value ofRFC7946
should be 'YES'.Additional context
This issue relates to this QGIS issue.
The text was updated successfully, but these errors were encountered: