svn - r34223 - branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry

1 message Options
Embed this post
Permalink
svn_geotools

svn - r34223 - branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry

Reply Threaded More More options
Print post
Permalink
Author: jive
Date: 2009-10-24 23:11:00 -0400 (Sat, 24 Oct 2009)
New Revision: 34223

Modified:
   branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryBuilder.java
   branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java
Log:
more stuff

Modified: branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryBuilder.java
===================================================================
--- branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryBuilder.java 2009-10-25 03:09:28 UTC (rev 34222)
+++ branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryBuilder.java 2009-10-25 03:11:00 UTC (rev 34223)
@@ -1,10 +1,806 @@
 package org.osgeo.geometry;
 
+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.Curve;
+import org.osgeo.geometry.primitive.LineString;
+import org.osgeo.geometry.primitive.Point;
+import org.osgeo.geometry.primitive.Polygon;
+import org.osgeo.geometry.primitive.Ring;
+import org.osgeo.geometry.primitive.segments.Arc;
+import org.osgeo.geometry.primitive.segments.ArcByBulge;
+import org.osgeo.geometry.primitive.segments.CurveSegment;
+import org.osgeo.geometry.primitive.segments.LineStringSegment;
+
 /**
- * SimpleGeometryBuilder that is method compatible with the deegree requirements.
- *
+ * GeometryBuilder that is method compatible with the deegree requirements.
+ * <p>
+ * This builder is not very stateful (you need to pass in the CRS each time); but it does
+ * contain many helpful methods for the same construction.
+ * </p>
  * @author Jody Garnett
  */
 public class GeometryBuilder {
 
+    private GeometryFactory factory;
+
+    public GeometryBuilder( GeometryFactory factory ){
+        this.factory = factory;
+    }
+    
+    
+    /**
+     * Creates a {@link Point} in 2D space.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param x
+     *            value for first coordinate
+     * @param y
+     *            value for second coordinate
+     * @param crs
+     *            coordinate reference system, may be null
+     * @return created {@link Point}
+     */
+    public Point createPoint( String id, double x, double y, CRS crs ) {        
+        // check crs has 2 axis
+        return factory.point(id, new double[]{x,y}, crs);
+    }
+
+    /**
+     * Creates a {@link Point} in 3D space.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param x
+     *            value for first coordinate
+     * @param y
+     *            value for second coordinate
+     * @param z
+     *            value for third coordinate
+     * @param crs
+     *            coordinate reference system, may be null
+     * @return created {@link Point}
+     */
+    public Point createPoint( String id, double x, double y, double z, CRS crs ) {
+        return factory.point(id, new double[]{x,y,z}, crs);
+    }
+
+    /**
+     * Creates a {@link Point} with an arbitrary number of coordinates.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param coordinates
+     *            coordinate values
+     * @param crs
+     *            coordinate reference system, may be null
+     * @return created {@link Point}
+     */
+    public Point createPoint( String id, double[] coordinates, CRS crs ) {
+        return factory.point(id, coordinates, crs);
+    }  
+
+    /**
+     * Creates a {@link Polygon} surface.
+     *
+     * @param id
+     *            identifier of the new geometry instance
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param exteriorRing
+     *            ring that defines the outer boundary, this may be null (see section 9.2.2.5 of GML spec)
+     * @param interiorRings
+     *            list of rings that define the inner boundaries, may be empty or null
+     * @return created {@link Polygon}
+     */
+    public Polygon createPolygon( String id, CRS crs, Ring exteriorRing, List<Ring> interiorRings ) {
+        return factory.polygon(id, crs, exteriorRing, interiorRings);
+    }    
+
+    /**
+     * Creates a {@link LineString} geometry.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system
+     * @param points
+     *            control points
+     * @return created {@link LineString}
+     */
+    public LineString createLineString( String id, CRS crs, Points points ) {
+        return factory.lineString(id, crs, points);
+    }
+
+
+    /**
+     * Creates an {@link Envelope}.
+     *
+     * @param min
+     *            minimum corner coordinates
+     * @param max
+     *            maximum corner coordinates
+     * @param crs
+     *            coordinate reference system, may be null
+     * @return created {@link Envelope}
+     */
+    public Envelope createEnvelope( double[] min, double[] max, CRS crs ) {
+        Point lowerCorner = factory.point(null, min, crs );
+        Point upperCorner = factory.point(null, max, crs );
+        return factory.envelope( lowerCorner, upperCorner);
+    }
+
+    /**
+     * Creates an {@link Envelope} in 2D space.
+     *
+     * @param minx
+     *            minimum x corner coordinate
+     * @param miny
+     *            minimum y corner coordinate
+     * @param maxx
+     *            maximum x corner coordinate
+     * @param maxy
+     *            maximum y corner coordinate
+     * @param crs
+     *            coordinate reference system, may be null
+     * @return created {@link Envelope}
+     */
+    public Envelope createEnvelope( double minx, double miny, double maxx, double maxy, CRS crs ) {
+        Point lowerCorner = createPoint(null, minx, miny, crs );
+        Point upperCorner = createPoint(null, maxx, maxy, crs );
+        return factory.envelope( lowerCorner, upperCorner);
+    }
+
+    /**
+     * Create an {@link Envelope} from a list of Doubles.
+     *
+     * @param lowerCorner
+     * @param upperCorner
+     * @param crs
+     *            coordinate reference system, may be null
+     * @return the envelope
+     */
+    public Envelope createEnvelope( List<Double> lowerCorner, List<Double> upperCorner, CRS crs ) {
+        if ( lowerCorner.size() != upperCorner.size() ) {
+            throw new IllegalArgumentException( "LowerCorner must be of same dimension as upperCorner." );
+        }
+        double[] lc = new double[lowerCorner.size()];
+        double[] uc = new double[upperCorner.size()];
+        for ( int i = 0; i < lc.length; ++i ) {
+            lc[i] = lowerCorner.get( i );
+            uc[i] = upperCorner.get( i );
+        }
+        return createEnvelope( lc, uc, crs );
+    }    
+
+    /**
+     * Creates an untyped multi geometry from a list of {@link Geometry}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     * @return created {@link MultiGeometry}
+     */
+    public MultiGeometry<Geometry> createMultiGeometry( String id, CRS crs, List<Geometry> members ) {
+        return factory.multiGeometry(id, crs, members );
+    }
+
+    /**
+     * Creates a {@link MultiPoint} from a list of passed {@link Point}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     *            points that constitute the collection
+     * @return created {@link MultiPoint}
+     */
+    public MultiPoint createMultiPoint( String id, CRS crs, List<Point> members ) {
+        return factory.multiPoint( id, crs, members );
+    }
+
+    /**
+     * Creates a {@link MultiCurve} from a list of passed {@link LineString}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     *            curves that constitute the collection
+     * @return created {@link MultiLineString}
+     */
+    public MultiLineString createMultiLineString( String id, CRS crs, List<LineString> members ) {
+        return factory.multiLineString(id, crs, members);
+    }
+
+    /**
+     * Creates a {@link MultiPolygon} from a list of passed {@link Polygon}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     *            polygons that constitute the collection
+     * @return created {@link MultiPolygon}
+     */
+    public MultiPolygon createMultiPolygon( String id, CRS crs, List<Polygon> members ) {
+        return factory.multiPolygon(id, crs, members);
+    }
+    
+    //
+    // General Geometry methods
+    //
+
+    /**
+     * Creates a segmented {@link Curve} from one or more {@link CurveSegment}s. The last {@link Point} of segment
+     * <code>i</code> must equal the first {@link Point} of segment <code>i+1</code>.
+     *
+     * @param id
+     *            identifier of the new geometry instance
+     * @param segments
+     *            segments a curve shall be created from
+     * @param crs
+     *            coordinate reference system
+     * @return created {@link Curve}
+     */
+    public Curve createCurve( String id, CurveSegment[] segments, CRS crs ) {
+        return factory.curve(null, segments, crs);
+    }
+
+    /**
+     * Creates a {@link LineStringSegment} curve segment.
+     *
+     * @param points
+     *            points to create the {@link LineStringSegment} from
+     * @return created {@link CurveSegment}
+     */
+    public LineStringSegment createLineStringSegment( Points points ) {
+        return factory.lineStringSegment( points );
+    }
+
+    /**
+     * Creates an {@link Arc} curve segment.
+     *
+     * @param p1
+     *            first control point
+     * @param p2
+     *            second control point
+     * @param p3
+     *            third control point
+     *
+     * @return created {@link Arc}
+     */
+    public Arc createArc( Point p1, Point p2, Point p3 ) {
+        return factory.arc(p1, p2, p3);
+    }
+
+    /**
+     * Creates an {@link ArcByBulge} curve segment.
+     *
+     * @param p1
+     *            first control point
+     * @param p2
+     *            second control point
+     * @param bulge
+     *            height of the arc (multiplier for the normals)
+     * @param normal
+     *            normal vector, in 2D only one coordinate is necessary
+     * @return created {@link ArcStringByBulge}
+     */
+    public ArcByBulge createArcByBulge( Point p1, Point p2, double bulge, Point normal ) {
+        return factory.arcByBulge(p1, p2, bulge, normal);
+    }
+
+    /**
+     * Creates an {@link ArcByCenterPoint} curve segment.
+     *
+     * @param midPoint
+     * @param radius
+     * @param startAngle
+     * @param endAngle
+     * @return created {@link ArcByCenterPoint}
+     */
+    public ArcByCenterPoint createArcByCenterPoint( Point midPoint, Length radius, Angle startAngle, Angle endAngle ) {
+        return new DefaultArcByCenterPoint( midPoint, radius, startAngle, endAngle );
+    }
+
+    /**
+     * Creates an {@link ArcString} curve segment.
+     *
+     * @param points
+     *            control points, must contain <code>2 * k + 1</code> points
+     * @return created {@link ArcString}
+     */
+    public ArcString createArcString( Points points ) {
+        return new DefaultArcString( points );
+    }
+
+    /**
+     * Creates an {@link ArcStringByBulge} curve segment.
+     * <p>
+     * This variant of the arc computes the mid points of the arcs instead of storing the coordinates directly. The
+     * control point sequence consists of the start and end points of each arc plus the bulge.
+     *
+     * @param points
+     *            list of control points, must contain at least two points
+     * @param bulges
+     *            heights of the arcs (multipliers for the normals)
+     * @param normals
+     *            normal vectors
+     * @return created {@link ArcStringByBulge}
+     */
+    public ArcStringByBulge createArcStringByBulge( Points points, double[] bulges, Points normals ) {
+        return new DefaultArcStringByBulge( points, bulges, normals );
+    }
+
+    /**
+     * Creates a {@link Bezier} curve segment.
+     *
+     * @param points
+     *            list of control points
+     * @param degree
+     *            polynomial degree of the spline
+     * @param knot1
+     *            first of the two knots that define the spline basis functions
+     * @param knot2
+     *            second of the two knots that define the spline basis functions
+     * @return created {@link Bezier}
+     */
+    public Bezier createBezier( Points points, int degree, Knot knot1, Knot knot2 ) {
+        return new DefaultBezier( points, degree, knot1, knot2 );
+    }
+
+    /**
+     * Creates a {@link BSpline} curve segment.
+     *
+     * @param points
+     *            list of control points
+     * @param degree
+     *            polynomial degree of the spline
+     * @param knots
+     *            sequence of distinct knots that define the spline basis functions
+     * @param isPolynomial
+     *            set to true if this is a polynomial spline, otherwise it's a rational spline
+     * @return created {@link BSpline}
+     */
+    public BSpline createBSpline( Points points, int degree, List<Knot> knots, boolean isPolynomial ) {
+        return new DefaultBSpline( points, degree, knots, isPolynomial );
+    }
+
+    /**
+     * Creates a {@link Circle} curve segment.
+     *
+     * @param p1
+     *            first control point
+     * @param p2
+     *            second control point
+     * @param p3
+     *            third control point
+     *
+     * @return created {@link Arc}
+     */
+    public Circle createCircle( Point p1, Point p2, Point p3 ) {
+        return new DefaultCircle( p1, p2, p3 );
+    }
+
+    /**
+     * Creates an {@link CircleByCenterPoint} curve segment.
+     *
+     * @param midPoint
+     * @param radius
+     * @param startAngle
+     * @return created {@link CircleByCenterPoint}
+     */
+    public CircleByCenterPoint createCircleByCenterPoint( Point midPoint, Length radius, Angle startAngle ) {
+        return new DefaultCircleByCenterPoint( midPoint, radius, startAngle );
+    }
+
+    /**
+     * Creates a {@link Geodesic} curve segment.
+     *
+     * @param p1
+     *            first control point
+     * @param p2
+     *            second control point
+     * @return created {@link Geodesic}
+     */
+    public Geodesic createGeodesic( Point p1, Point p2 ) {
+        return new DefaultGeodesic( p1, p2 );
+    }
+
+    /**
+     * Creates a {@link GeodesicString} curve segment.
+     *
+     * @param points
+     *            control points, at least two
+     * @return created {@link GeodesicString}
+     */
+    public GeodesicString createGeodesicString( Points points ) {
+        return new DefaultGeodesicString( points );
+    }
+
+    /**
+     * Creates an {@link OffsetCurve} curve segment.
+     *
+     * @param baseCurve
+     *            the base geometry
+     * @param direction
+     *            the direction of the offset
+     * @param distance
+     *            the distance from the base curve
+     * @return created {@link GeodesicString}
+     */
+    public OffsetCurve createOffsetCurve( Curve baseCurve, Point direction, Length distance ) {
+        return new DefaultOffsetCurve( baseCurve, direction, distance );
+    }
+
+    /**
+     * Creates a {@link Surface} that consists of a number of {@link SurfacePatch} instances. The passed patches must
+     * touch in a topological sense to form a valid {@link Surface}.
+     *
+     * @param id
+     *            identifier of the new geometry instance
+     * @param patches
+     *            patches to create a surface
+     * @param crs
+     *            coordinate reference system, may be null
+     * @return created {@link Surface}
+     */
+    public Surface createSurface( String id, List<SurfacePatch> patches, CRS crs ) {
+        return new DefaultSurface( id, crs, pm, patches );
+    }
+
+    /**
+     * Creates a {@link PolygonPatch} surface patch.
+     *
+     * @param exteriorRing
+     *            ring that defines the outer boundary, this may be null (see section 9.2.2.5 of GML spec)
+     * @param interiorRings
+     *            list of rings that define the inner boundaries, may be empty or null
+     * @return created {@link PolygonPatch}
+     */
+    public PolygonPatch createPolygonPatch( Ring exteriorRing, List<Ring> interiorRings ) {
+        return new DefaultPolygonPatch( exteriorRing, interiorRings );
+    }
+
+    /**
+     * Creates a {@link Ring} from a list of passed {@link Curve}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     *            the <code>Curve</code>s that compose the <code>Ring</code>
+     * @return created {@link Ring}
+     */
+    public Ring createRing( String id, CRS crs, List<Curve> members ) {
+        return new DefaultRing( id, crs, pm, members );
+    }
+
+    /**
+     * Creates a simple {@link LinearRing} from a list of passed {@link Point}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param points
+     *            control points
+     * @return created {@link Ring}
+     */
+    public LinearRing createLinearRing( String id, CRS crs, Points points ) {
+        return new DefaultLinearRing( id, crs, pm, points );
+    }
+
+    /**
+     * Creates an {@link OrientableCurve}.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param baseCurve
+     *            base curve
+     * @param isReversed
+     *            set to true, if the orientation of the base curve shall be reversed in the created geometry
+     * @return created {@link OrientableCurve}
+     */
+    public OrientableCurve createOrientableCurve( String id, CRS crs, Curve baseCurve, boolean isReversed ) {
+        return new DefaultOrientableCurve( id, crs, baseCurve, isReversed );
+    }
+
+    /**
+     * Creates a {@link Triangle} surface patch.
+     *
+     * @param exterior
+     *            ring that contains exactly four planar points, the first and last point must be coincident
+     * @return created {@link Triangle}
+     */
+    public Triangle createTriangle( LinearRing exterior ) {
+        return new DefaultTriangle( exterior );
+    }
+
+    /**
+     * Creates a {@link Rectangle} surface patch.
+     *
+     * @param exterior
+     *            ring that contains exactly five planar points, the first and last point must match
+     * @return created {@link Rectangle}
+     */
+    public Rectangle createRectangle( LinearRing exterior ) {
+        return new DefaultRectangle( exterior );
+    }
+
+    /**
+     * Creates an {@link OrientableSurface}.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param baseSurface
+     *            base surface
+     * @param isReversed
+     *            set to true, if the orientation of the base surface shall be reversed
+     * @return created {@link OrientableCurve}
+     */
+    public OrientableSurface createOrientableSurface( String id, CRS crs, Surface baseSurface, boolean isReversed ) {
+        return new DefaultOrientableSurface( id, crs, baseSurface, isReversed );
+    }
+
+    /**
+     * Creates a {@link PolyhedralSurface}.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param memberPatches
+     *            patches that constitute the surface
+     * @return created {@link PolyhedralSurface}
+     */
+    public PolyhedralSurface createPolyhedralSurface( String id, CRS crs, List<PolygonPatch> memberPatches ) {
+        return new DefaultPolyhedralSurface( id, crs, pm, memberPatches );
+    }
+
+    /**
+     * Creates a {@link TriangulatedSurface}.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param memberPatches
+     *            patches that constitute the surface
+     * @return created {@link TriangulatedSurface}
+     */
+    public TriangulatedSurface createTriangulatedSurface( String id, CRS crs, List<Triangle> memberPatches ) {
+        return new DefaultTriangulatedSurface( id, crs, pm, memberPatches );
+    }
+
+    /**
+     * Creates a {@link Tin}.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param stopLines
+     * @param breakLines
+     * @param maxLength
+     * @param controlPoints
+     * @param patches
+     * @return created {@link Tin}
+     */
+    public Tin createTin( String id, CRS crs, List<List<LineStringSegment>> stopLines,
+                          List<List<LineStringSegment>> breakLines, Length maxLength, Points controlPoints,
+                          List<Triangle> patches ) {
+        return new DefaultTin( id, crs, pm, stopLines, breakLines, maxLength, controlPoints, patches );
+    }
+
+    /**
+     * Creates a {@link Clothoid} curve segment.
+     *
+     * @param referenceLocation
+     *            the affine mapping that places the curve defined by the Fresnel Integrals into the coordinate
+     *            reference system of this object
+     * @param scaleFactor
+     *            the value for the constant in the Fresnel's integrals
+     * @param startParameter
+     *            the arc length distance from the inflection point that will be the start point for this curve segment
+     * @param endParameter
+     *            the arc length distance from the inflection point that will be the end point for this curve segment
+     * @return created {@link Clothoid}
+     */
+    public Clothoid createClothoid( AffinePlacement referenceLocation, double scaleFactor, double startParameter,
+                                    double endParameter ) {
+        return new DefaultClothoid( referenceLocation, scaleFactor, startParameter, endParameter );
+    }
+
+    /**
+     * Creates a {@link Cone} surface patch.
+     *
+     * @param grid
+     *            the grid of control points that defines the Cone
+     * @return created {@link Cone}
+     */
+    public Cone createCone( List<Points> grid ) {
+        return new DefaultCone( grid );
+    }
+
+    /**
+     * Creates a {@link Cylinder} surface patch.
+     *
+     * @param grid
+     *            the grid of control points that defines the Cylinder
+     * @return created {@link Cylinder}
+     */
+    public Cylinder createCylinder( List<Points> grid ) {
+        return new DefaultCylinder( grid );
+    }
+
+    /**
+     * Creates a {@link Sphere} surface patch.
+     *
+     * @param grid
+     *            the grid of control points that defines the Sphere
+     * @return created {@link Sphere}
+     */
+    public Sphere createSphere( List<Points> grid ) {
+        return new DefaultSphere( grid );
+    }
+
+    /**
+     * Creates a {@link Clothoid} curve segment.
+     *
+     * @param points
+     *            control points, at least two
+     * @param vectorAtStart
+     *            the unit tangent vector at the start point of the spline
+     * @param vectorAtEnd
+     *            the unit tangent vector at the end point of the spline
+     * @return created {@link Clothoid}
+     */
+    public CubicSpline createCubicSpline( Points points, Point vectorAtStart, Point vectorAtEnd ) {
+        return new DefaultCubicSpline( points, vectorAtStart, vectorAtEnd );
+    }    
+    
+    /**
+     * Creates a {@link Solid}.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param exteriorSurface
+     *            the exterior surface (shell) of the solid, may be null
+     * @param interiorSurfaces
+     *            the interior surfaces of the solid, may be null or empty
+     * @return created {@link Solid}
+     */
+    public Solid createSolid( String id, CRS crs, Surface exteriorSurface, List<Surface> interiorSurfaces ) {
+        return new DefaultSolid( id, crs, pm, exteriorSurface, interiorSurfaces );
+    }
+
+    /**
+     * Creates a {@link MultiCurve} from a list of passed {@link Curve}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     *            curves that constitute the collection
+     * @return created {@link MultiCurve}
+     */
+    public MultiCurve createMultiCurve( String id, CRS crs, List<Curve> members ) {
+        return new DefaultMultiCurve( id, crs, pm, members );
+    }
+
+    /**
+     * Creates a {@link MultiSurface} from a list of passed {@link Surface}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     *            surfaces that constitute the collection
+     * @return created {@link MultiSurface}
+     */
+    public MultiSurface createMultiSurface( String id, CRS crs, List<Surface> members ) {
+        return new DefaultMultiSurface( id, crs, pm, members );
+    }
+
+    /**
+     * Creates a {@link MultiSolid} from a list of passed {@link Solid}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     *            solids that constitute the collection
+     * @return created {@link MultiSolid}
+     */
+    public MultiSolid createMultiSolid( String id, CRS crs, List<Solid> members ) {
+        return new DefaultMultiSolid( id, crs, pm, members );
+    }    
+    
+    /**
+     * Creates a {@link CompositeCurve} from a list of passed {@link Curve}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param members
+     *            curves that constitute the composited curve, each curve must end at the start point of the subsequent
+     *            curve in the list
+     * @return created {@link CompositeCurve}
+     */
+    public CompositeCurve createCompositeCurve( String id, CRS crs, List<Curve> members ) {
+        return new DefaultCompositeCurve( id, crs, pm, members );
+    }
+
+    /**
+     * Creates a {@link CompositeSurface} from a list of passed {@link Surface}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param memberSurfaces
+     *            surfaces that constitute the composited surface, the surfaces must join in pairs on common boundary
+     *            curves and must, when considered as a whole, form a single surface
+     * @return created {@link CompositeSurface}
+     */
+    public CompositeSurface createCompositeSurface( String id, CRS crs, List<Surface> memberSurfaces ) {
+        return new DefaultCompositeSurface( id, crs, pm, memberSurfaces );
+    }
+
+    /**
+     * Creates a {@link CompositeSolid} from a list of passed {@link Solid}s.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param memberSolids
+     *            solids that constitute the composited solid, the solids must join in pairs on common boundary surfaces
+     *            and which, when considered as a whole, form a single solid
+     * @return created {@link CompositeSolid}
+     */
+    public CompositeSolid createCompositeSolid( String id, CRS crs, List<Solid> memberSolids ) {
+        return new DefaultCompositeSolid( id, crs, pm, memberSolids );
+    }
+
+    /**
+     * Creates a general {@link CompositeGeometry} from a list of primitive geometries.
+     *
+     * @param id
+     *            identifier, may be null
+     * @param crs
+     *            coordinate reference system, may be null
+     * @param memberPrimitives
+     * @return created {@link CompositeGeometry}
+     */
+    public CompositeGeometry<GeometricPrimitive> createCompositeGeometry( String id, CRS crs,
+                                                                          List<GeometricPrimitive> memberPrimitives ) {
+        return new DefaultCompositeGeometry( id, crs, pm, memberPrimitives );
+    }
 }

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 03:09:28 UTC (rev 34222)
+++ branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java 2009-10-25 03:11:00 UTC (rev 34223)
@@ -276,7 +276,7 @@
      *
      * @return created {@link Arc}
      */
-    Arc createArc(Point p1, Point p2, Point p3);
+    Arc arc(Point p1, Point p2, Point p3);
 
     /**
      * Creates an {@link ArcByBulge} curve segment.
@@ -291,7 +291,7 @@
      *            normal vector, in 2D only one coordinate is necessary
      * @return created {@link ArcStringByBulge}
      */
-    ArcByBulge createArcByBulge(Point p1, Point p2, double bulge, Point normal);
+    ArcByBulge arcByBulge(Point p1, Point p2, double bulge, Point normal);
 
     /**
      * Creates an {@link ArcByCenterPoint} curve segment.
@@ -705,7 +705,7 @@
      *            surface
      * @return created {@link CompositeSurface}
      */
-    public CompositeSurface createCompositeSurface(String id, CRS crs, List<Surface> memberSurfaces);
+    public CompositeSurface compositeSurface(String id, CRS crs, List<Surface> memberSurfaces);
 
     /**
      * Creates a {@link CompositeSolid} from a list of passed {@link Solid}s.


------------------------------------------------------------------------------
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