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

Rename reproject to reproject! because it is changing the geometry inplace #402

Open
felixcremer opened this issue Nov 29, 2023 · 1 comment

Comments

@felixcremer
Copy link
Contributor

While reprojecting a geometry I got very confused that my starting geometry got reprojected in place.
I think we should add this info to the documentation and also add a ! to the function name to clarify that the reprojection happens in place.

using GADM
using ArchGDAL
julia> deu = GADM.get("DEU", depth=0)
(geom = ArchGDAL.IGeometry{ArchGDAL.wkbMultiPolygon}[Geometry: MULTIPOLYGON (((7.98642063100016 47.5555305480001, ... 02)))], GID_0 = ["DEU"], COUNTRY = ["Germany"])

julia> projdeu = ArchGDAL.reproject(only(deu.geom), EPSG(4326), ProjString(newproj))
Geometry: MULTIPOLYGON (((67.8564039238532 -13.2639375695037 ... 25)))

julia> deu
(geom = ArchGDAL.IGeometry{ArchGDAL.wkbMultiPolygon}[Geometry: MULTIPOLYGON (((67.8564039238532 -13.2639375695037 ... 25)))], GID_0 = ["DEU"], COUNTRY = ["Germany"])
@rafaqz
Copy link
Collaborator

rafaqz commented Nov 29, 2023

Sorry, I can't remember why there is no bang. I guess we need both methods and the non-bang method to make a copy.

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

No branches or pull requests

2 participants