-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start updating intersection point function * Improve intersection point calculation and add tests * Add test and comments * Add check for missing data in primitive data tests * Bump patch version * Remove Proj from Project.toml Co-authored-by: Anshul Singhvi <anshulsinghvi@gmail.com> --------- Co-authored-by: Anshul Singhvi <anshulsinghvi@gmail.com>
- Loading branch information
1 parent
696326c
commit 1e46749
Showing
5 changed files
with
78 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Test | ||
import GeoInterface as GI, GeometryOps as GO, LibGEOS as LG | ||
|
||
l1 = GI.LineString([(90000.0, 1000.0), (90000.0, 22500.0), (95000.0, 22500.0), (95000.0, 1000.0), (90000.0, 1000.0)]) | ||
l2 = GI.LineString([(90000.0, 7500.0), (107500.0, 27500.0), (112500.0, 27500.0), (95000.0, 7500.0), (90000.0, 7500.0)]) | ||
l3 = GI.LineString([(90000.0, 90000.0), (90000.0, 105000.0), (105000.0, 105000.0), (105000.0, 90000.0), (90000.0, 90000.0)]) | ||
l4 = GI.LineString([(-98000.0, 90000.0), (-98000.0, 105000.0), (98000.0, 105000.0), (98000.0, 90000.0), (-98000.0, 90000.0)]) | ||
l5 = GI.LineString([(19999.999, 25000.0), (19999.999, 29000.0), (39999.998999999996, 29000.0), (39999.998999999996, 25000.0), (19999.999, 25000.0)]) | ||
l6 = GI.LineString([(0.0, 25000.0), (0.0, 29000.0), (20000.0, 29000.0), (20000.0, 25000.0), (0.0, 25000.0)]) | ||
|
||
p1, p2 = GI.Polygon([l1]), GI.Polygon([l2]) | ||
|
||
# Three intersection points | ||
GO_l1_l2_mp = GI.MultiPoint(GO.intersection_points(l1, l2)) | ||
LG_l1_l2_mp = GI.MultiPoint(collect(GI.getpoint(LG.intersection(l1, l2)))) | ||
@test GO.equals(GO_l1_l2_mp, LG_l1_l2_mp) | ||
|
||
# Four intersection points with large intersection | ||
GO_l3_l4_mp = GI.MultiPoint(GO.intersection_points(l3, l4)) | ||
LG_l3_l4_mp = GI.MultiPoint(collect(GI.getpoint(LG.intersection(l3, l4)))) | ||
@test GO.equals(GO_l3_l4_mp, LG_l3_l4_mp) | ||
|
||
# Four intersection points with very small intersection | ||
GO_l5_l6_mp = GI.MultiPoint(GO.intersection_points(l5, l6)) | ||
LG_l5_l6_mp = GI.MultiPoint(collect(GI.getpoint(LG.intersection(l5, l6)))) | ||
@test GO.equals(GO_l5_l6_mp, LG_l5_l6_mp) | ||
|
||
# Test that intersection points between lines and polygons is equivalent | ||
GO_p1_p2_mp = GI.MultiPoint(GO.intersection_points(p1, p2)) | ||
@test GO.equals(GO_p1_p2_mp, GO_l1_l2_mp) | ||
|
||
# No intersection points between polygon and line | ||
GO_p1_l6 = GO.intersection_points(p1, l6) | ||
@test isempty(GO_p1_l6) |
This file contains 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 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
1e46749
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.
@JuliaRegistrator register
1e46749
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.
Registration pull request created: JuliaRegistries/General/109702
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: