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
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 |
} |
Also available in: Unified diff