Index: Point2DZ.java
===================================================================
--- Point2DZ.java	(revision 38598)
+++ Point2DZ.java	(revision 38599)
@@ -22,115 +22,119 @@
 package org.gvsig.fmap.geom.primitive.impl;
 
 import org.cresques.cts.IProjection;
-
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.primitive.FShape;
 import org.gvsig.fmap.geom.primitive.Point;
 import org.gvsig.fmap.geom.type.GeometryType;
 
 /**
- * Punto 3D.
+ * 3D point implementation.
  * 
  * @author Vicente Caballero Navarro
+ * @author gvSIG team
  */
 public class Point2DZ extends Point2D implements Point {
 
-    public static final String PERSISTENCE_DEFINITION_NAME =
-        "Point2DimensionsZ";
-    private static final long serialVersionUID = 1L;
+	private static final long serialVersionUID = 3113070237182638858L;
 
-    /**
-     * The constructor with the GeometryType like and argument
-     * is used by the {@link GeometryType}{@link #create()} to create the
-     * geometry
-     * 
-     * @param type
-     *            The geometry type
-     */
-    public Point2DZ(GeometryType geomType) {
-        super(geomType);
-        coordinates[2] = 0;
-    }
+	public static final String PERSISTENCE_DEFINITION_NAME = "Point2DimensionsZ";
+	private double z = 0.0d;
 
-    /**
-     * Constructor used in the {@link Geometry#cloneGeometry()} method
-     * 
-     * @param id
-     * @param projection
-     * @param x
-     * @param y
-     * @param z
-     */
-    Point2DZ(GeometryType geomType, String id, IProjection projection,
-        double x, double y, double z) {
-        super(geomType, id, projection, x, y);
-        coordinates[2] = z;
-    }
+	/**
+	 * The constructor with the GeometryType like and argument is used by the
+	 * {@link GeometryType}{@link #create()} to create the geometry
+	 * 
+	 * @param type
+	 *            The geometry type
+	 */
+	public Point2DZ(GeometryType geomType) {
+		super(geomType);
+	}
 
-    public Point2DZ(double x, double y, double z) {
-        super(TYPES.POINT, SUBTYPES.GEOM3D);
-        coordinates[0] = x;
-        coordinates[1] = y;
-        coordinates[2] = z;
-    }
+	/**
+	 * Constructor used in the {@link Geometry#cloneGeometry()} method
+	 * 
+	 * @param id
+	 * @param projection
+	 * @param x
+	 * @param y
+	 * @param z
+	 */
+	Point2DZ(GeometryType geomType, String id, IProjection projection,
+			double x, double y, double z) {
+		super(geomType, id, projection, x, y);
+		this.z = z;
+	}
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.gvsig.fmap.geom.primitive.impl.Point2D#getShapeType()
-     */
-    public int getShapeType() {
-        return TYPES.POINT;
+    public Point2DZ(double x, double y, double z, GeometryType geometryType) {
+        super(geometryType);
+        this.x = x;
+        this.y = y;
+        this.z = z;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.gvsig.fmap.geom.primitive.impl.Point2D#cloneFShape()
-     */
-    public FShape cloneFShape() {
-        return new Point2DZ(getGeometryType(), id, projection, coordinates[0],
-            coordinates[1], coordinates[2]);
-    }
+	public Point2DZ(double x, double y, double z) {
+		super(TYPES.POINT, SUBTYPES.GEOM3D);
+		this.x = x;
+		this.y = y;
+		this.z = z;
+	}
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.gvsig.fmap.geom.primitive.impl.Point2D#getDimension()
-     */
-    public int getDimension() {
-        return 3;
-    }
+	public int getShapeType() {
+		return TYPES.POINT;
+	}
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.gvsig.fmap.geom.primitive.impl.Point2D#equals(java.lang.Object)
-     */
-    public boolean equals(Object other) {
-        if (!super.equals(other)) {
-            return false;
-        }
+	public FShape cloneFShape() {
+		return new Point2DZ(getGeometryType(), id, projection, x, y, z);
+	}
 
-        Point2DZ pother = (Point2DZ) other;
-        if (Math.abs(this.coordinates[2] - pother.coordinates[2]) > 0.0000001) {
-            return false;
-        }
-        return true;
-    }
+	public int getDimension() {
+		return 3;
+	}
 
-    public void setCoordinates(double[] values) {
-        super.setCoordinates(values);
-        if (values.length > 2) {
-            coordinates[2] = values[2];
-        }
-    }
+	public boolean equals(Object other) {
+		if (!super.equals(other)) {
+			return false;
+		}
 
-    public String toString() {
-        StringBuffer buffer = new StringBuffer();
-        buffer.append("Point2DZ(");
-        toStringCoordinates(buffer);
-        buffer.append(")");
-        return buffer.toString();
-    }
+		Point2DZ pother = (Point2DZ) other;
+		if (Math.abs(this.z - pother.z) > 0.0000001) {
+			return false;
+		}
+		return true;
+	}
+
+	public void setCoordinates(double[] values) {
+		super.setCoordinates(values);
+		if (values.length > 2) {
+			z = values[2];
+		}
+	}
+
+	public void setCoordinateAt(int dimension, double value) {
+		if (dimension == Geometry.DIMENSIONS.Z) {
+			this.z = value;
+		} else {
+			super.setCoordinateAt(dimension, value);
+		}
+	}
+
+	public double getCoordinateAt(int dimension) {
+		return (dimension == Geometry.DIMENSIONS.Z) ? this.z : super
+				.getCoordinateAt(dimension);
+	}
+
+	public double getOrdinate(int dimension) {
+		return (dimension == Geometry.DIMENSIONS.Z) ? this.z : super
+				.getCoordinateAt(dimension);
+	}
+
+	public double[] getCoordinates() {
+		return new double[] { getX(), getY(), this.z };
+	}
+
+	protected String getFullTypeName() {
+		return "Point2DZ";
+	}
+
 }
