Index: Polygon2DM.java
===================================================================
--- Polygon2DM.java	(revision 47431)
+++ Polygon2DM.java	(revision 47432)
@@ -22,22 +22,15 @@
  */
 package org.gvsig.fmap.geom.jts.primitive.surface.polygon;
 
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.CoordinateSequence;
+import java.awt.Shape;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.PathIterator;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-
-import com.vividsolutions.jts.geom.Coordinate;
-import com.vividsolutions.jts.geom.GeometryFactory;
-import com.vividsolutions.jts.geomgraph.Position;
-import com.vividsolutions.jts.operation.buffer.BufferParameters;
-import com.vividsolutions.jts.operation.buffer.OffsetCurveBuilder;
-import java.awt.Shape;
-import java.awt.geom.GeneralPath;
-
 import org.cresques.cts.ICoordTrans;
-
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.GeometryException;
 import org.gvsig.fmap.geom.aggregate.MultiLine;
@@ -45,11 +38,10 @@
 import org.gvsig.fmap.geom.jts.GeometryJTS;
 import org.gvsig.fmap.geom.jts.aggregate.MultiLine2DM;
 import org.gvsig.fmap.geom.jts.aggregate.MultiPolygon2DM;
-import org.gvsig.fmap.geom.jts.gputils.DefaultGeneralPathX;
+import org.gvsig.fmap.geom.jts.mgeom.MCoordinate;
 import org.gvsig.fmap.geom.jts.primitive.curve.line.BaseLine2DM;
 import org.gvsig.fmap.geom.jts.primitive.curve.line.Line2DM;
 import org.gvsig.fmap.geom.jts.primitive.point.Point2DM;
-import org.gvsig.fmap.geom.jts.primitive.ring.Ring2D;
 import org.gvsig.fmap.geom.jts.primitive.ring.Ring2DM;
 import org.gvsig.fmap.geom.jts.primitive.surface.split.SurfaceSplitOperation;
 import org.gvsig.fmap.geom.jts.util.ArrayListCoordinateSequence;
@@ -89,6 +81,12 @@
         super(Geometry.TYPES.POLYGON, coordinates);
         closePrimitive();
     }
+    
+    public Polygon2DM(ArrayListCoordinateSequence coordinates) {
+        super(Geometry.TYPES.POLYGON, coordinates);
+        closePrimitive();
+    }
+    
 
     /* (non-Javadoc)
      * @see org.gvsig.fmap.geom.primitive.Surface#setSurfaceAppearance(org.gvsig.fmap.geom.primitive.SurfaceAppearance)
@@ -128,6 +126,49 @@
     }
 
     @Override
+    public Geometry force2DM() throws GeometryOperationNotSupportedException, GeometryOperationException {
+        ArrayListCoordinateSequence coordinates2DM = new ArrayListCoordinateSequence(coordinates.size());
+        for (Coordinate coordinate : this.coordinates) {
+            coordinates2DM.add(MCoordinate.create2dWithMeasure(coordinate.x, coordinate.y, coordinate.getOrdinate(CoordinateSequence.M)));
+        }
+        Polygon2DM poligon2DM = new Polygon2DM(coordinates2DM);
+        poligon2DM.setProjection(this.getProjection());
+        for (int i = 0; i < getNumInteriorRings(); i++){
+            poligon2DM.addInteriorRing((Ring)getInteriorRing(i).force2DM());
+        }
+        return poligon2DM;
+    }
+
+    @Override
+    public Geometry force3D() throws GeometryOperationNotSupportedException, GeometryOperationException {
+        ArrayListCoordinateSequence coordinates3D = new ArrayListCoordinateSequence(coordinates.size());
+        for (Coordinate coordinate : this.coordinates) {
+            coordinates3D.add(new Coordinate(coordinate.x, coordinate.y, 0));
+        }
+        Polygon3D poligon3D = new Polygon3D(coordinates3D);
+        poligon3D.setProjection(this.getProjection());
+        for (int i = 0; i < getNumInteriorRings(); i++){
+            poligon3D.addInteriorRing((Ring)getInteriorRing(i).force3D());
+        }
+        return poligon3D;
+    }
+
+    @Override
+    public Geometry force3DM() throws GeometryOperationNotSupportedException, GeometryOperationException {
+        ArrayListCoordinateSequence coordinates3DM = new ArrayListCoordinateSequence(coordinates.size());
+        for (Coordinate coordinate : this.coordinates) {
+            coordinates3DM.add(MCoordinate.create3dWithMeasure(coordinate.x, coordinate.y, 0, coordinate.getOrdinate(CoordinateSequence.M)));
+        }
+        Polygon3DM poligon3DM = new Polygon3DM(coordinates3DM);
+        poligon3DM.setProjection(this.getProjection());
+        for (int i = 0; i < getNumInteriorRings(); i++){
+            poligon3DM.addInteriorRing((Ring)getInteriorRing(i).force3DM());
+        }
+        return poligon3DM;
+    }
+
+    
+    @Override
     @SuppressWarnings("CloneDoesntCallSuperClone")
     public Polygon clone() throws CloneNotSupportedException {
         return this.cloneGeometry();
@@ -314,7 +355,7 @@
                   return false;
               }
               for(int i=0; i < this.getNumVertices(); i++){
-                  if(other.coordinates.get(i).getOrdinate(2)!=this.coordinates.get(i).getOrdinate(2)){
+                  if(other.coordinates.get(i).getOrdinate(CoordinateSequence.M)!=this.coordinates.get(i).getOrdinate(CoordinateSequence.M)){
                       return false;
                   };
               }
