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

Request: add 'clip' operator #604

Closed
jipclaassens opened this issue Dec 7, 2023 · 9 comments
Closed

Request: add 'clip' operator #604

jipclaassens opened this issue Dec 7, 2023 · 9 comments
Assignees
Milestone

Comments

@jipclaassens
Copy link
Member

The current sub-operator can only cut out a polygon that has a matching domain or a void domain. What if I want to cut a different polygon set?

For example, I want to cut out all main roads (polygons) from a parcel polygon set. To my knowledge this is now not possible.

In ArcGiS, this operator is called 'clip':

image

@jipclaassens
Copy link
Member Author

Met Boost geometry zou dit sneller kunnen

Nu kan het met overlay_polygon, enkel in integers

@MaartenHilferink
Copy link
Collaborator

MaartenHilferink commented Apr 3, 2024

hoe presteert:

fpolygon(mul(ipolygon(INPUT), ipolygon(CLIP_FEATURE)))

of, korter:
fpolygon( ipolygon(INPUT) * ipolygon(CLIP_FEATURE))
?

@jipclaassens please provide feedback and we'll look into expected performance improvement with a boost geometry implementation.

@jipclaassens
Copy link
Member Author

jipclaassens commented May 15, 2024

@MaartenHilferink, this works indeed. However, even for a relatively small dataset, it is very slow.

With a simplified (at 10 meters) BBG of Amsterdam and with a smaller rectangular clip feature, it still takes quite a while. It calculates for the last 3 hours and still needs to finish.

@jipclaassens
Copy link
Member Author

jipclaassens commented May 27, 2024

Project:
https://github.com/ObjectVision/BegrenzingBebouwdGebied.git

Make studyarea .fss
/SourceData/BBG/MakeStudyArea
or
Paste the attached fss in the relevant LD folder: ..\LocalData\begrenzingbebouwdgebied\BBG

Mul test case:
/SourceData/BBG/StudyArea/test
StudyArea.zip

@jipclaassens jipclaassens removed their assignment May 27, 2024
@MaartenHilferink
Copy link
Collaborator

Rekentijd test (m.b.v. boost::polygon) 4 sec, test2 (m.b.v. boost::geometry's bg_intersect): direct, < 1 sec.
image

MaartenHilferink added a commit that referenced this issue Jun 28, 2024
@MaartenHilferink
Copy link
Collaborator

MaartenHilferink commented Jun 28, 2024

overlay_polygon is now also applicable on fpoint and dpoint arguments, by using boost::geometry
image

image

@MaartenHilferink
Copy link
Collaborator

MaartenHilferink commented Jun 28, 2024

Remaining todos:

  • allow cog_mul, cog_and for bg_intersect on floating point point sequences
  • cog_sub, bg_difference
  • cog_or, cog_add, bg_union
  • bg_overlay_polygon as alternative for overlay_polygon on integer coordinates

@MaartenHilferink
Copy link
Collaborator

image

@jipclaassens
Copy link
Member Author

@MaartenHilferink does this mean there new operators:

  • bg_intersect
  • bg_union
  • bg_xor
  • bg_difference
  • bg_overlay_polygon
  • bp_overlay_polygon

In that case, we need to update the documentation.

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