3 ms·
This would be interesting/useful for smoothing geospatial polygons (eg, KML).
by kungfooey 16y ago
This would be interesting/useful for smoothing geospatial polygons (eg, KML).
- wmil 16y agoDmitri Lebedev had a public domain python script up at ryba4.com but the site seems to be down. It's handy, I've used it for KML generation and a command line SVG path simplify tool. Google maps won't download a file larger than 3MB so simplifying can be important.
- yannickt 16y agoAt a previous job I implemented a tool to smooth map areas and at the same time preserve the topology between the areas (e.g. there would be no gaps between Texas and Louisiana after the smoothing). I had a lot of fun writing it.
- albertsun 16y agoThat sounds very useful. How did you do it? Could you share it? Did you create an algorithm that would smooth polygons the same way going clockwise or counter-clockwise so that the shared boundaries would be simplified the same way? Or did your algorithm take into account the entire topology?
- yannickt 16y agoIt was indeed very useful :). Unfortunately I cannot share too much due to NDA (not that I consider what I did cutting edge...). But I will say that I couldn't take the entire topology into account due to limitations with the host SDK (I was working on a plug-in for a leading vector graphics application).
- ideamonk 16y agoGEOS has an implementation of it http://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/#django.contrib.gis.geos.GEOSGeometry.simplify http://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/#d... and postgis lets you simplify in sql query itself.