-
Notifications
You must be signed in to change notification settings - Fork 9
fix crs on polygon clipping #309
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
Open
asinghvi17
wants to merge
11
commits into
main
Choose a base branch
from
as/clipping_crs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+215
−38
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
416de76
fix crs on intersection
asinghvi17 de4679e
Fix CRS propagation in union and difference clipping operations
asinghvi17 466e456
Add trait-based `_linearring` function to handle LineString/LinearRin…
asinghvi17 f04c9dd
Fix CRS propagation in intersection to support ArchGDAL geometries
asinghvi17 6c9f406
Add sources for GOCore to main Project.toml
asinghvi17 fbdd81a
Bump Core and GO patch versions
asinghvi17 0b17714
Add sweat tests for combinations of type mismatches
asinghvi17 e3091c7
maybe fix tests
asinghvi17 6b9d201
Update src/utils/utils.jl
asinghvi17 dae42e5
Update src/utils/utils.jl
asinghvi17 0b22ad9
Error when using different crses that are not nothing
asinghvi17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| name = "GeometryOpsCore" | ||
| uuid = "05efe853-fabf-41c8-927e-7063c8b9f013" | ||
| authors = ["Anshul Singhvi <[email protected]>", "Rafael Schouten <[email protected]>", "Skylar Gering <[email protected]>", "and contributors"] | ||
| version = "0.1.7" | ||
| version = "0.1.8" | ||
|
|
||
| [deps] | ||
| DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,14 @@ | ||
|
|
||
| # Trait-based _linearring to handle any GeoInterface-compatible geometry | ||
| _linearring(geom) = _linearring(GI.trait(geom), geom) | ||
|
|
||
| # If it's already a LinearRing, return as-is | ||
| _linearring(::GI.LinearRingTrait, geom) = geom | ||
|
|
||
| # If it's a LineString (e.g., from ArchGDAL), convert to LinearRing preserving CRS | ||
| _linearring(::GI.LineStringTrait, geom) = | ||
| GI.LinearRing(GI.getpoint(geom); crs=GI.crs(geom)) | ||
|
|
||
| # Concrete type specializations for GI wrappers (optimization) | ||
| _linearring(geom::GI.LineString) = GI.LinearRing(parent(geom); extent=geom.extent, crs=geom.crs) | ||
| _linearring(geom::GI.LinearRing) = geom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| name = "GeometryOps" | ||
| uuid = "3251bfac-6a57-4b6d-aa61-ac1fef2975ab" | ||
| authors = ["Anshul Singhvi <[email protected]>", "Rafael Schouten <[email protected]>", "Skylar Gering <[email protected]>", "and contributors"] | ||
| version = "0.1.31" | ||
| version = "0.1.32" | ||
|
|
||
| [deps] | ||
| AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" | ||
|
|
@@ -21,6 +21,9 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" | |
| Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
| Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | ||
|
|
||
| [sources] | ||
| GeometryOpsCore = {path = "GeometryOpsCore"} | ||
|
|
||
| [weakdeps] | ||
| DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" | ||
| FlexiJoins = "e37f2e79-19fa-4eb7-8510-b63b51fe0a37" | ||
|
|
@@ -48,7 +51,7 @@ FlexiJoins = "0.1.30" | |
| GeoFormatTypes = "0.4" | ||
| GeoInterface = "1.2" | ||
| GeometryBasics = "0.4.7, 0.5" | ||
| GeometryOpsCore = "=0.1.7" | ||
| GeometryOpsCore = "=0.1.8" | ||
| LibGEOS = "0.9.2" | ||
| LinearAlgebra = "1" | ||
| Proj = "1" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is type unstable.
I think we need to error if they are not nothing but different.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the equality check type unstable? but more to the point, how would it be possible to make it type stable? You'd just hoist the instability to outside this function...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have the comparison
EPSG(4326) == EPSG(3857)you were comparing a runtime Int for a branch that returned eitherEPSG(4326)ornothing. So a return type ofUnion{Nothing,EPSG}. That will leak everywhere, and after some nesting inapplycould even lead toAnys.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be clearer to put the
isnothingchecks first as the compiler will remove those anyway, then the only real check -==will happen right above theelse ... error()and make things more clear.