Polygon intersection with bounding box with polygon's holes intact

المشرف العام

Administrator
طاقم الإدارة
I am trying to serve GeoJSON FeatureCollection tiles with each feature's geometries trimmed to the tile boundary. I am working on a Leaflet plugin to re-assemble the geometries. It works by building up a pool of lines for a unique feature, removing any equal lines in opposing directions, then walking any unwalked lines to recreate the linear rings.

This currently works, except I am having trouble dealing with polygon holes. When I have a polygon with a hole and generate the GeoJSON to intersect it with the tile boundary - I lose the hole information.

Does anyone have any ideas on how I could keep the hole information intact on the server side, or alternatively detect this happening on the client-side?

Here is a screenshot of two adjacent tiles, to demonstrate: http://cl.ly/image/0c2j260s2N2E

I hope this is clear!

Thanks



أكثر...
 
أعلى