From: Maciej Sawicki <viroos.pl@gm...> - 2010-01-12 23:56:58
I need to create xml file that I will use to print. I use this code
as base for parsing shp file. Beside changing polygons representation
into xml format i need to remove objects that will be poorly visible
I don't know what criteria chose. I think removing objects with small
border length would be better then removing objects with small area
(so long objects will reduce to line). But maybe there is special
algorithm for that?
In other words I want to find only that objects that are visible at
given zoom level.
TIA for help.
From: Michael Bedward <michael.bedward@gm...> - 2010-01-17 01:59:32
Nice question :)
I think you're right that border length would be a better criterion
than area if you're writing your own algorithm. But you might like to
look at the code for the Decimator class in gt-main
This is a helper class for rendering that reduces the detail of
geometries. It accepts an AffineTransform argument so you can use that
to specify the map scale. I think you'd need to adapt the code for
your own case but it may be a lot better than starting from scratch.
Hope this helps.
From: Michael Bedward <michael.bedward@gm...> - 2010-01-20 23:38:51
> But I asked similar question in other place and I get answer to
> use Ramer-Douglas-Peucker algorithm for simplifying shapes. I think
> this will also eliminate too small shapes.
JTS offers the DP algorithm for simplifying geometries by modifying
the set of vertices in a geometry to reduce its detail. I didn't think
it removed a geometry if it was small - though I haven't checked that.
If it does, I guess you could choose the algorithm that gives you the
Get latest updates about Open Source Projects, Conferences and News.