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

Add Maximum Inscribed Circle #311

Closed

Conversation

PieceMaker
Copy link

@PieceMaker PieceMaker commented Apr 27, 2020

A Voronoi-based maximum inscribed circle algorithm based on the JavaScript library max-inscribed-circle.

OSGeo ticket https://trac.osgeo.org/geos/ticket/1028.

@nyalldawson
Copy link

Did you see #310 ?

@PieceMaker
Copy link
Author

Wow, I did not see that. Beat me by a few days...

@dr-jts
Copy link
Contributor

dr-jts commented Apr 27, 2020

Also see this JTS blog post for more background.

My guess is that the iterative approach in #310 will be faster than the densified Voronoi approach. Would be interesting if you can compare them.

Also note that I plan to add a "viewport constraint" as well, to be able to find the visual centre of. a polygon which is only partially visible in a rectangular viewport.

And finally, others have experimented with this for label placement, and have actually decided that in itself MIC is not ideal for labelling. See some discussion in the Mapnik project for instance [1][2].

[1] mapnik/mapnik#3780
[2] mapnik/mapnik#3811

@dr-jts
Copy link
Contributor

dr-jts commented Apr 27, 2020

This enhancement to weight using centroid might also be worthwhile for labelling purposes:

Of course this is no longer the MIC then.

@PieceMaker
Copy link
Author

@dr-jts Thank you very much for the links. That info is very insightful. I'll see if I can write a comparison once the iterative method is merged in.

I will go ahead and close this PR.

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.

3 participants