Revision 20964 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/aggregate/MultiPoint2D.java
MultiPoint2D.java | ||
---|---|---|
46 | 46 |
|
47 | 47 |
import org.cresques.cts.IProjection; |
48 | 48 |
import org.gvsig.fmap.geom.Geometry; |
49 |
import org.gvsig.fmap.geom.GeometryManager; |
|
49 | 50 |
import org.gvsig.fmap.geom.handler.AbstractHandler; |
50 | 51 |
import org.gvsig.fmap.geom.primitive.FShape; |
51 | 52 |
import org.gvsig.fmap.geom.primitive.Point2D; |
53 |
import org.gvsig.fmap.geom.type.GeometryType; |
|
52 | 54 |
|
53 |
import com.vividsolutions.jts.geom.Coordinate; |
|
54 |
import com.vividsolutions.jts.geom.GeometryFactory; |
|
55 |
|
|
56 | 55 |
/** |
57 | 56 |
* Multipunto 2D. |
58 | 57 |
* |
... | ... | |
61 | 60 |
public class MultiPoint2D extends BaseMultiPrimitive implements MultiPoint { |
62 | 61 |
|
63 | 62 |
private static final long serialVersionUID = 1L; |
63 |
|
|
64 |
private static GeometryType geomType = GeometryManager.getInstance() |
|
65 |
.registerGeometryType(MultiPoint2D.class); |
|
66 |
public static int GEOM_TYPE = geomType.getType(); |
|
64 | 67 |
|
65 | 68 |
public MultiPoint2D(IProjection projection, Point2D[] points) { |
66 | 69 |
this(null, projection, points); |
... | ... | |
158 | 161 |
/* |
159 | 162 |
* (non-Javadoc) |
160 | 163 |
* |
161 |
* @see com.iver.cit.gvsig.fmap.core.FGeometryCollection#toJTSGeometry() |
|
162 |
*/ |
|
163 |
public com.vividsolutions.jts.geom.Geometry toJTSGeometry() { |
|
164 |
Coordinate[] theGeoms = new Coordinate[geometries.length]; |
|
165 |
for (int i = 0; i < theGeoms.length; i++) { |
|
166 |
java.awt.geom.Point2D p = geometries[i] |
|
167 |
.getHandlers(Geometry.SELECTHANDLER)[0].getPoint(); |
|
168 |
Coordinate c = new Coordinate(p.getX(), p.getY()); |
|
169 |
theGeoms[i] = c; |
|
170 |
} |
|
171 |
com.vividsolutions.jts.geom.MultiPoint geomCol = new GeometryFactory() |
|
172 |
.createMultiPoint(theGeoms); |
|
173 |
return geomCol; |
|
174 |
} |
|
175 |
|
|
176 |
/* |
|
177 |
* (non-Javadoc) |
|
178 |
* |
|
179 | 164 |
* @see com.iver.cit.gvsig.fmap.core.FShape#getShapeType() |
180 | 165 |
*/ |
181 | 166 |
public int getShapeType() { |
Also available in: Unified diff