tilemaker icon indicating copy to clipboard operation
tilemaker copied to clipboard

Is there anyway to add center for multipolygon

Open satya-auti opened this issue 3 years ago • 4 comments

we can add center point for polygon using inbuilt function (LayerAsCentroid). Is there any inbuilt function for Multipolygon?

satya-auti avatar Feb 28 '23 05:02 satya-auti

This should just work as normal with multipolygons, I think - does it not work for you?

systemed avatar Feb 28 '23 11:02 systemed

image

center point of the both polygon is between them. Is there anyway to set the individual point to center of the both polygon?

satya-auti avatar Mar 01 '23 05:03 satya-auti

Ah, I see what you mean. Currently tilemaker uses boost::geometry's centroid algorithm, which as you've seen chooses the single centroid of the assembled geometries as a whole. I think what you're looking for is something that writes several centroids, one for each constituent polygon. There's no way to do that at present but it might be an interesting thing to introduce.

systemed avatar Mar 01 '23 10:03 systemed

Fixed in v3.

systemed avatar Jan 15 '24 00:01 systemed