Revision 44099 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/primitive/point/Point2DM.java
Point2DM.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
import com.vividsolutions.jts.geom.Coordinate; |
29 | 29 |
import com.vividsolutions.jts.geom.CoordinateSequence; |
30 |
import org.cresques.cts.IProjection; |
|
30 | 31 |
|
31 | 32 |
import org.gvsig.fmap.geom.Geometry; |
32 | 33 |
import org.gvsig.fmap.geom.GeometryException; |
... | ... | |
58 | 59 |
/** |
59 | 60 |
* |
60 | 61 |
*/ |
61 |
public Point2DM(Coordinate coordinates) { |
|
62 |
public Point2DM(IProjection proj, Coordinate coordinates) {
|
|
62 | 63 |
super(Geometry.SUBTYPES.GEOM2DM, MCoordinate.convertCoordinate(coordinates)); |
64 |
this.setProjection(proj); |
|
63 | 65 |
} |
64 | 66 |
|
65 | 67 |
/** |
66 | 68 |
* |
67 | 69 |
*/ |
68 | 70 |
public Point2DM() { |
69 |
this(JTSUtils.createMCoordinate(0, 0, 0)); |
|
71 |
this(null, JTSUtils.createMCoordinate(0, 0, 0));
|
|
70 | 72 |
} |
71 | 73 |
|
72 | 74 |
/** |
73 | 75 |
* |
74 | 76 |
*/ |
75 | 77 |
public Point2DM(double x, double y, double m) { |
76 |
this(JTSUtils.createMCoordinate(x, y, m)); |
|
78 |
this(null, JTSUtils.createMCoordinate(x, y, m));
|
|
77 | 79 |
} |
78 | 80 |
|
79 | 81 |
public double getM() { |
... | ... | |
109 | 111 |
* @see org.gvsig.fmap.geom.Geometry#cloneGeometry() |
110 | 112 |
*/ |
111 | 113 |
public Point cloneGeometry() { |
112 |
return new Point2DM(MCoordinate.convertCoordinate((Coordinate) coordinate.clone())); |
|
114 |
return new Point2DM(this.getProjection(), MCoordinate.convertCoordinate((Coordinate) coordinate.clone()));
|
|
113 | 115 |
} |
114 | 116 |
|
115 | 117 |
/* |
... | ... | |
256 | 258 |
* @see org.gvsig.fmap.geom.Geometry#offset(double) |
257 | 259 |
*/ |
258 | 260 |
public Geometry offset(double distance) throws GeometryOperationNotSupportedException, GeometryOperationException { |
259 |
return JTSUtils.createGeometry(getJTS().buffer(distance)); |
|
261 |
return JTSUtils.createGeometry(this.getProjection(), getJTS().buffer(distance));
|
|
260 | 262 |
} |
261 | 263 |
|
262 | 264 |
public String toString() { |
Also available in: Unified diff