Skip to content

Automatically Densify simple polygons when creating centerlines - #7060

Closed
geographika wants to merge 2 commits into
MapServer:mainfrom
geographika:centerline
Closed

geographika wants to merge 2 commits into
MapServer:mainfrom
geographika:centerline

Conversation

@geographika

Copy link
Copy Markdown
Member

Automatically densify simple polygons before creating msGEOSVoronoiDiagram.
Possible fix for #7058.

The number of points and the value of 3 for msDensify are based on a test dataset. I'm not sure of general applicability.

@geographika
geographika requested a review from sdlime March 29, 2024 12:24
@sdlime

sdlime commented Mar 30, 2024

Copy link
Copy Markdown
Member

I think I actually had this in place early on with this work but teased things apart. I don’t recall why though. What you propose seems like a good idea. I was wondering the same thing though on number of points and value for densify. I thought I used some trivial test cases with a triangle and square early on.

Really will need to test on this end.

Comment thread src/mapgeos.c Resolved
@geographika geographika changed the title Automaitcally Densify simple polygons when creating centerlines Automatically Densify simple polygons when creating centerlines Mar 30, 2024
Co-authored-by: Even Rouault <[email protected]>
@geographika

Copy link
Copy Markdown
Member Author

I think I actually had this in place early on with this work but teased things apart. I don’t recall why though. What you propose seems like a good idea. I was wondering the same thing though on number of points and value for densify. I thought I used some trivial test cases with a triangle and square early on.

I thought you'd have considered this, and the arbitrary values are a worry. At first, I was trying to simply ignore/log the errors, but that seemed much harder to implement as the shape it processed during parsing, so the function can't simply log an error and return NULL.

I ran into the issue whilst creating the MapServer tutorial - centerline is a great option to have, but running densify on a full dataset kills performance.

@sdlime

sdlime commented Mar 30, 2024 •

Copy link
Copy Markdown
Member

I think I actually had this in place early on with this work but teased things apart. I don’t recall why though. What you propose seems like a good idea. I was wondering the same thing though on number of points and value for densify. I thought I used some trivial test cases with a triangle and square early on.

I thought you'd have considered this, and the arbitrary values are a worry. At first, I was trying to simply ignore/log the errors, but that seemed much harder to implement as the shape it processed during parsing, so the function can't simply log an error and return NULL.

I ran into the issue whilst creating the MapServer tutorial - centerline is a great option to have, but running densify on a full dataset kills performance.

What constitutes a simple feature is more problematic. I'd think the we could figure out a densify value based on the distance between the points (there aren't that many of then - perhaps the shortest distance between points (or a fraction thereof). I do like the idea of auto densify though...

@geographika

Copy link
Copy Markdown
Member Author

I was hoping there were some criteria for which features would work in the GEOS codebase (I presume this is where the feature fails) but not many details from what I can find https://github.com/search?q=repo%3Alibgeos%2Fgeos++GEOSVoronoiDiagram&type=code

Comment thread src/mapgeos.c

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rouault for the code review!

@jmckenna jmckenna added this to the 8.2.0 Release milestone Apr 4, 2024
@geographika

Copy link
Copy Markdown
Member Author

Closed - see discussions at #7058

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.

4 participants