Revision 47668
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/gml/GeometryStrategies.java | ||
---|---|---|
43 | 43 |
import com.vividsolutions.jts.util.StringUtil; |
44 | 44 |
import org.apache.commons.lang3.StringUtils; |
45 | 45 |
import org.gvsig.fmap.geom.jts.gml.GMLHandler.Handler; |
46 |
import org.gvsig.fmap.geom.jts.util.JTSUtils; |
|
46 | 47 |
|
47 | 48 |
/** |
48 | 49 |
* Container for GML2 Geometry parsing strategies which can be represented in JTS. |
... | ... | |
161 | 162 |
// coord set |
162 | 163 |
try{ |
163 | 164 |
CoordinateSequence cs = (CoordinateSequence) arg.children.get(0); |
164 |
ls = gf.createLinearRing(cs);
|
|
165 |
}catch(ClassCastException e){
|
|
165 |
ls = JTSUtils.createJTSLinearRing(cs);
|
|
166 |
}catch(Exception e){ |
|
166 | 167 |
throw new SAXException("Cannot create a linear ring without atleast four coordinates or one coordinate sequence",e); |
167 | 168 |
} |
168 | 169 |
}else{ |
169 | 170 |
try{ |
170 | 171 |
Coordinate[] coords = (Coordinate[]) arg.children.toArray(new Coordinate[arg.children.size()]); |
171 | 172 |
ls = gf.createLinearRing(coords); |
172 |
}catch(ClassCastException e){
|
|
173 |
}catch(Exception e){ |
|
173 | 174 |
throw new SAXException("Cannot create a linear ring without atleast four coordinates or one coordinate sequence",e); |
174 | 175 |
} |
175 | 176 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/gml/GeometryStrategiesGML3.java | ||
---|---|---|
23 | 23 |
import org.apache.commons.lang3.tuple.ImmutablePair; |
24 | 24 |
import org.apache.commons.lang3.tuple.Pair; |
25 | 25 |
import static org.gvsig.fmap.geom.jts.gml.GeometryStrategies.getSrid; |
26 |
import org.gvsig.fmap.geom.jts.util.JTSUtils; |
|
26 | 27 |
import org.xml.sax.SAXException; |
27 | 28 |
|
28 | 29 |
/** |
... | ... | |
173 | 174 |
|
174 | 175 |
strats.put("exterior".toLowerCase(), oneChild); |
175 | 176 |
strats.put("surfaceMember".toLowerCase(), oneChild); |
177 |
strats.put("OrientableSurface".toLowerCase(), oneChild); |
|
178 |
strats.put("baseSurface".toLowerCase(), oneChild); |
|
176 | 179 |
|
177 | 180 |
strats.put("interior".toLowerCase(), manyChilds); |
178 | 181 |
|
... | ... | |
191 | 194 |
|
192 | 195 |
} |
193 | 196 |
}); |
197 |
strats.put("CompositeSurface".toLowerCase(), strats.get("MultiSurface".toLowerCase())); |
|
194 | 198 |
|
195 | 199 |
strats.put("curveMember".toLowerCase(), oneChild); |
196 | 200 |
|
... | ... | |
246 | 250 |
merger.add(segment); |
247 | 251 |
} |
248 | 252 |
List<LineString> merged = (List<LineString>) merger.getMergedLineStrings(); |
249 |
return gf.createLinearRing(merged.get(0).getCoordinateSequence()); |
|
253 |
return JTSUtils.createJTSLinearRing(merged.get(0).getCoordinateSequence()); |
|
254 |
|
|
250 | 255 |
} |
251 | 256 |
}); |
257 |
|
|
258 |
strats.put("Solid".toLowerCase(), null); |
|
252 | 259 |
|
253 | 260 |
return strats; |
254 | 261 |
|
Also available in: Unified diff