Skip to content
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

Improved GeoJSON support #96

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Improved GeoJSON support #96

wants to merge 8 commits into from

Conversation

favyen2
Copy link
Collaborator

@favyen2 favyen2 commented Oct 25, 2024

Improve GeoJSON support:

  • GeojsonVectorFormat - support a "coordinate mode" option to write GeoJSON with CRS coordinates. Previously it writes "pixel coordinates" which are CRS coordinates multiplied by x/y resolution. That option is still there, but the default will now be to write CRS coordinates since these are understood by other GIS tools. Information about which coordinates are used is included in the GeoJSON file, so GeojsonVectorFormat can always read previously written files even if they don't match the configured coordinate mode.
  • GeojsonVectorFormat - support option to always write longitude/latitude (WGS84) coordinates.
  • LocalFiles - instead of always assuming input GeoJSON is longitude/latitude, interpret the "crs" property if it is set. This is all handled by fiona. Note that GeoJSON created by GeojsonVectorFormat in pixel coordinates won't be interpreted correctly by LocalFiles.

Resolves #26.

- LocalFiles now supports reading from GeoJSONs that have "crs" property set.
- GeojsonVectorFormat now supports option to control whether it should use pixel
  coordinates, CRS coordinates, or always convert to longitude/latitude coordinates.
  Regardless of which way it is written, it can undo it when reading.
@favyen2 favyen2 marked this pull request as draft October 25, 2024 20:05
@favyen2
Copy link
Collaborator Author

favyen2 commented Oct 25, 2024

  • unit test for GeojsonVectorFormat

@favyen2 favyen2 marked this pull request as ready for review October 25, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support flag for GeoJSON vector format to use longitude/latitude coordinates
2 participants