From: Emmanuel B. <emm...@gm...> - 2012-09-14 15:58:29
|
Hello, I have a polygon layer for which I would like to produce a Polygon graph. I've been trying to use the PolygonGraphGenerator, but this one builds a "geometry" graph, while I would like to build it on features. I could see that there is a FeatureGraphGenerator, that decorates a graph generator that builds a graph from geometries. But it does not seem to work if the GraphGenerator is a PolygonGraphGenerator, apparently because the PolygonGraphGenerator methods take a Polygon object as parameters: /Exception in thread "main" java.lang.ClassCastException: org.geotools.feature.simple.SimpleFeatureImpl cannot be cast to com.vividsolutions.jts.geom.Polygon at org.geotools.graph.build.polygon.PolygonGraphGenerator.find(PolygonGraphGenerator.java:157) at org.geotools.graph.build.polygon.PolygonGraphGenerator.get(PolygonGraphGenerator.java:125) at org.geotools.graph.build.polygon.PolygonGraphGenerator.add(PolygonGraphGenerator.java:108) at org.geotools.graph.build.feature.FeatureGraphGenerator.add(FeatureGraphGenerator.java:59)/ Could somebody give me advice on this? Thanks in advance, Cheers Emmanuel |