Revision 38388 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/util/Converter.java
Converter.java | ||
---|---|---|
49 | 49 |
import java.lang.reflect.Array; |
50 | 50 |
import java.util.ArrayList; |
51 | 51 |
|
52 |
import org.gvsig.fmap.geom.Geometry; |
|
53 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
54 |
import org.gvsig.fmap.geom.GeometryManager; |
|
55 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
56 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
57 |
import org.gvsig.fmap.geom.aggregate.MultiCurve; |
|
58 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
|
59 |
import org.gvsig.fmap.geom.aggregate.MultiPrimitive; |
|
60 |
import org.gvsig.fmap.geom.aggregate.MultiSurface; |
|
61 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
62 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
|
63 |
import org.gvsig.fmap.geom.primitive.Surface; |
|
64 |
import org.slf4j.Logger; |
|
65 |
import org.slf4j.LoggerFactory; |
|
66 |
|
|
52 | 67 |
import com.vividsolutions.jts.algorithm.CGAlgorithms; |
53 | 68 |
import com.vividsolutions.jts.algorithm.RobustCGAlgorithms; |
54 | 69 |
import com.vividsolutions.jts.geom.Coordinate; |
... | ... | |
62 | 77 |
import com.vividsolutions.jts.geom.Point; |
63 | 78 |
import com.vividsolutions.jts.geom.Polygon; |
64 | 79 |
|
65 |
import org.slf4j.Logger; |
|
66 |
import org.slf4j.LoggerFactory; |
|
67 |
|
|
68 |
import org.gvsig.fmap.geom.Geometry; |
|
69 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
70 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
71 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
72 |
import org.gvsig.fmap.geom.GeometryManager; |
|
73 |
import org.gvsig.fmap.geom.aggregate.MultiCurve; |
|
74 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
|
75 |
import org.gvsig.fmap.geom.aggregate.MultiPrimitive; |
|
76 |
import org.gvsig.fmap.geom.aggregate.MultiSurface; |
|
77 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
78 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
|
79 |
import org.gvsig.fmap.geom.primitive.Surface; |
|
80 |
|
|
81 | 80 |
/** |
82 | 81 |
* Clase con varios m�todos est�ticos utilizados para pasar de java2d a jts |
83 | 82 |
* y viceversa. |
... | ... | |
152 | 151 |
shpNew = geomManager.createPoint(((Point) geo).getX(), |
153 | 152 |
((Point) geo).getY(), SUBTYPES.GEOM2D); |
154 | 153 |
} |
154 |
|
|
155 |
if (geo instanceof com.vividsolutions.jts.geom.MultiPoint) { |
|
156 |
shpNew = (MultiPoint)geomManager.create(TYPES.MULTIPOINT, SUBTYPES.GEOM2D); |
|
157 |
Coordinate[] coord = ((com.vividsolutions.jts.geom.MultiPoint)geo).getCoordinates(); |
|
158 |
for (int i = 0; i < coord.length; i++) { |
|
159 |
((MultiPoint)shpNew).addPoint(geomManager.createPoint(coord[i].x, coord[i].y, SUBTYPES.GEOM2D)); |
|
160 |
} |
|
161 |
} |
|
155 | 162 |
|
156 | 163 |
if (geo.isEmpty()) { |
157 | 164 |
shpNew = null; |
Also available in: Unified diff