|
|
|
svn_geotools
|
Author: jive
Date: 2009-10-24 22:25:55 -0400 (Sat, 24 Oct 2009) New Revision: 34214 Modified: branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/SimpleGeometryBuilder.java branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/points/Points.java Log: commit Modified: branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java =================================================================== --- branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java 2009-10-25 01:59:03 UTC (rev 34213) +++ branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java 2009-10-25 02:25:55 UTC (rev 34214) @@ -83,6 +83,26 @@ * @author Jody Garnett */ public interface GeometryFactory { + /** + * Points represent the fundamental building block + * of the geometry data structure. Represented as + * a Iterable of Points; all sharing the same CRS. + * @param coordinates array of double matching the axis order of the crs + * @param crs Coordinate Reference System + * @return Points + */ + Points points( double[] coordinates, CRS crs); + + /** + * Points represent the fundamental building block + * of the geometry data structure. Represented as + * a Iterable of Points; all sharing the same CRS. + * @param coordinates Separate double arrays for each axis + * @param crs Coordinate Reference System + * @return Points + */ + Points points( double[][] coordinates, CRS crs); + // Simple /** * Creates a {@link Point} with provided coordinates and CRS. @@ -129,17 +149,16 @@ /** - * Creates an {@link Envelope}. + * Creates an {@link Envelope} based on lowerCorner and upperCorner. * - * @param min - * minimum corner coordinates + * @param points Points capturing the lower and upper bounds. * @param max * maximum corner coordinates * @param crs * coordinate reference system, may be null * @return created {@link Envelope} */ - public Envelope envelope( double[] min, double[] max, CRS crs ); + public Envelope envelope( Point lowerCorner, Point upperCorner ); /** * Creates an {@link Envelope} in 2D space. Modified: branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/SimpleGeometryBuilder.java =================================================================== --- branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/SimpleGeometryBuilder.java 2009-10-25 01:59:03 UTC (rev 34213) +++ branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/SimpleGeometryBuilder.java 2009-10-25 02:25:55 UTC (rev 34214) @@ -3,6 +3,11 @@ import java.util.List; import org.osgeo.commons.crs.CRS; +import org.osgeo.geometry.multi.MultiCurve; +import org.osgeo.geometry.multi.MultiGeometry; +import org.osgeo.geometry.multi.MultiLineString; +import org.osgeo.geometry.multi.MultiPoint; +import org.osgeo.geometry.multi.MultiPolygon; import org.osgeo.geometry.points.Points; import org.osgeo.geometry.primitive.LineString; import org.osgeo.geometry.primitive.Point; @@ -120,10 +125,6 @@ * @return created {@link Envelope} */ public Envelope createEnvelope( double[] min, double[] max, CRS crs ) { - return factory.envelope( - return new DefaultEnvelope( null, crs, pm, new DefaultPoint( null, crs, pm, min ), - new DefaultPoint( null, crs, - pm, max ) ); } /** Modified: branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/points/Points.java =================================================================== --- branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/points/Points.java 2009-10-25 01:59:03 UTC (rev 34213) +++ branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/points/Points.java 2009-10-25 02:25:55 UTC (rev 34214) @@ -17,6 +17,7 @@ */ package org.osgeo.geometry.points; +import org.osgeo.commons.crs.CRS; import org.osgeo.geometry.primitive.LineString; import org.osgeo.geometry.primitive.Point; @@ -43,6 +44,13 @@ public int getDimension(); /** + * Returns the associated spatial reference system. + * + * @return spatial reference system, may be null + */ + public CRS getCRS(); + + /** * Returns the number of represented {@link Point}s. * * @return the number of points @@ -79,6 +87,8 @@ * <p> * NOTE: This method should be avoided, as it may involve expensive operations. * </p> + * <p> + * This array is returned in the order provided by each Point: p1x,p1y, * * @return coordinates as a one-dimensional array */ ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ GeoTools-commits mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/geotools-commits |
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |