From: Emmanuel P. <epi...@ya...> - 2007-12-05 16:06:52
|
Further investigation seems to indicate that my problem might be related to shapes with "holes" in them, as the following closeups show: http://www.lri.fr/~pietriga/2007/12/wb06.png (the one in Italy/San Marin) http://www.lri.fr/~pietriga/2007/12/wb07.png (the one near the Caspain sea) http://www.lri.fr/~pietriga/2007/12/wb08.png (the one in South Africa/Lesotho) Are such shapes supposed to be handled in a specific manner when drawing them from their vertex list? What is going on is unclear to me... Emmanuel > B) If I do: > > Geometry geometry = feature.getPrimaryGeometry(); > // > this actually returns a MultiPolygon > Object[] polygons = > PolygonExtracter.getPolygons(geometry).toArray(); > for (int k=0;k<polygons.length;k++){ > Geometry polygon = (Geometry)polygons[k]; > Coordinate[] coords = polygon.getCoordinates(); > /* ... */ > // draw a polygon on screen by instantiating a > java.awt.Polygon from coords > } > > then I get a much better result as shown in [2], > except in a few places: see [3,4]. > > Note that in all cases, Geometry.isValid() returns > true. > > [2] http://www.lri.fr/~pietriga/2007/12/wb02.png > [3] http://www.lri.fr/~pietriga/2007/12/wb03.png > [4] http://www.lri.fr/~pietriga/2007/12/wb04.png ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping |