Revision 43909 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/DefaultGeometryManager.java
DefaultGeometryManager.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
package org.gvsig.fmap.geom.jts; |
26 | 26 |
|
27 |
import com.vividsolutions.jts.io.gml2.GMLReader; |
|
27 | 28 |
import java.awt.geom.PathIterator; |
28 | 29 |
import java.util.ArrayList; |
29 | 30 |
import java.util.HashMap; |
... | ... | |
57 | 58 |
import org.gvsig.fmap.geom.jts.primitive.Envelope3D; |
58 | 59 |
import org.gvsig.fmap.geom.jts.spatialindex.SpatialIndexFactoryJSIRTree; |
59 | 60 |
import org.gvsig.fmap.geom.jts.spatialindex.SpatialIndexFactoryJTSQuadtree; |
61 |
import org.gvsig.fmap.geom.jts.util.GMLUtils; |
|
60 | 62 |
import org.gvsig.fmap.geom.jts.util.JTSUtils; |
61 | 63 |
import org.gvsig.fmap.geom.operation.GeometryOperation; |
62 | 64 |
import org.gvsig.fmap.geom.operation.GeometryOperationContext; |
... | ... | |
673 | 675 |
this.flatness = flatness; |
674 | 676 |
} |
675 | 677 |
|
678 |
@Override |
|
679 |
public Geometry createFrom(Object data) throws CreateGeometryException, GeometryException { |
|
680 |
if( data == null ) { |
|
681 |
throw new IllegalArgumentException("null data is not allowed"); |
|
682 |
} |
|
683 |
if( data instanceof String ) { |
|
684 |
Geometry geom = GMLUtils.GML2Geometry((String) data); |
|
685 |
if( geom != null ) { |
|
686 |
return geom; |
|
687 |
} |
|
688 |
return this.createFrom((String)data); |
|
689 |
} |
|
690 |
if( data instanceof byte[] ) { |
|
691 |
return this.createFrom((byte[])data); |
|
692 |
} |
|
693 |
if( data instanceof com.vividsolutions.jts.geom.Geometry ) { |
|
694 |
return this.createFrom((com.vividsolutions.jts.geom.Geometry)data); |
|
695 |
} |
|
696 |
if( data instanceof Geometry ) { |
|
697 |
return ((Geometry)data).cloneGeometry(); |
|
698 |
} |
|
699 |
throw new IllegalArgumentException("Type of data ("+data.getClass().getName()+") not supported."); |
|
700 |
} |
|
701 |
|
|
676 | 702 |
public Geometry createFrom(String wkt, String srs) throws GeometryException { |
677 | 703 |
GeometryOperationContext context = new GeometryOperationContext(); |
678 | 704 |
context.setAttribute("text", wkt); |
Also available in: Unified diff