org.geotools.geometry
Class GeometryBuilder

java.lang.Object
  extended by org.geotools.geometry.GeometryBuilder

public class GeometryBuilder
extends java.lang.Object

A Builder to help with Geometry creation.

The factory interfaces provided by GeoAPI are hard to use in isolation (they are even hard to collect a matched set in order to work on the same problem). The main advantage a "builder" has over a factory is that it does not have to be thread safe and can hold state in order to make your job easier.

Author:
Jody Garnett

Constructor Summary
GeometryBuilder(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
           
GeometryBuilder(Hints hints)
           
GeometryBuilder(java.lang.String code)
           
 
Method Summary
 org.opengis.geometry.complex.CompositeCurve createCompositeCurve(java.util.List generator)
           
 org.opengis.geometry.complex.CompositePoint createCompositePoint(org.opengis.geometry.primitive.Point generator)
           
 org.opengis.geometry.complex.CompositeSurface createCompositeSurface(java.util.List generator)
           
 org.opengis.geometry.primitive.Curve createCurve(java.util.List segments)
           
 org.opengis.geometry.primitive.Curve createCurve(org.opengis.geometry.coordinate.PointArray points)
           
 org.opengis.geometry.DirectPosition createDirectPosition()
           
 org.opengis.geometry.DirectPosition createDirectPosition(double[] ordinates)
           
 org.opengis.geometry.Envelope createEnvelope(org.opengis.geometry.DirectPosition lowerCorner, org.opengis.geometry.DirectPosition upperCorner)
           
 org.opengis.geometry.coordinate.LineSegment createLineSegment(org.opengis.geometry.DirectPosition from, org.opengis.geometry.DirectPosition to)
           
 org.opengis.geometry.coordinate.LineSegment createLineSegment(org.opengis.geometry.coordinate.Position startPoint, org.opengis.geometry.coordinate.Position endPoint)
           
 org.opengis.geometry.coordinate.LineString createLineString(java.util.List points)
           
 org.opengis.geometry.coordinate.LineString createLineString(org.opengis.geometry.coordinate.PointArray points)
           
 org.opengis.geometry.aggregate.MultiCurve createMultiCurve(java.util.Set curves)
           
 org.opengis.geometry.aggregate.MultiPoint createMultiPoint(java.util.Set points)
           
 org.opengis.geometry.aggregate.MultiPrimitive createMultiPrimitive()
           
 org.opengis.geometry.aggregate.MultiPrimitive createMultiPrimitive(java.util.Set primitives)
           
 org.opengis.geometry.aggregate.MultiSurface createMultiSurface(java.util.Set surfaces)
           
 org.opengis.geometry.primitive.Point createPoint(double[] ordinates)
          Create a point with the provided ordinates
 org.opengis.geometry.primitive.Point createPoint(double ord1, double ord2)
          Create a point with the provided ordinates.
 org.opengis.geometry.primitive.Point createPoint(double ord1, double ord2, double ord3)
          Create a point with the provided ordinates.
 org.opengis.geometry.primitive.Point createPoint(org.opengis.geometry.coordinate.Position position)
           
 org.opengis.geometry.coordinate.PointArray createPointArray()
           
 org.opengis.geometry.coordinate.PointArray createPointArray(double[] array)
           
 org.opengis.geometry.coordinate.PointArray createPointArray(double[] array, int start, int end)
           
 org.opengis.geometry.coordinate.Polygon createPolygon(org.opengis.geometry.primitive.SurfaceBoundary boundary)
           
 org.opengis.geometry.coordinate.Polygon createPolygon(org.opengis.geometry.primitive.SurfaceBoundary boundary, org.opengis.geometry.primitive.Surface spanSurface)
           
 org.opengis.geometry.coordinate.PolyhedralSurface createPolyhedralSurface(java.util.List tiles)
           
 org.opengis.geometry.coordinate.Position createPosition(org.opengis.geometry.coordinate.Position position)
           
 org.opengis.geometry.coordinate.PointArray createPositionList(float[] array, int start, int end)
           
 org.opengis.geometry.primitive.Primitive createPrimitive(org.opengis.geometry.Envelope envelope)
           
 org.opengis.geometry.primitive.Ring createRing(java.util.List<org.opengis.geometry.primitive.OrientableCurve> orientableCurves)
           
 org.opengis.geometry.primitive.Solid createSolid(org.opengis.geometry.primitive.SolidBoundary boundary)
           
 org.opengis.geometry.primitive.Surface createSurface(java.util.List surfaces)
           
 org.opengis.geometry.primitive.Surface createSurface(org.opengis.geometry.primitive.SurfaceBoundary boundary)
           
 org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.primitive.OrientableCurve curve)
           
 org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.coordinate.PointArray points)
           
 org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.primitive.Ring exterior)
           
 org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.primitive.Ring exterior, java.util.List interiors)
           
 org.opengis.geometry.coordinate.Tin createTin(java.util.Set post, java.util.Set stopLines, java.util.Set breakLines, double maxLength)
           
 org.opengis.geometry.aggregate.AggregateFactory getAggregateFactory()
           
 org.opengis.geometry.complex.ComplexFactory getComplexFactory()
           
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
           
 org.opengis.geometry.coordinate.GeometryFactory getGeometryFactory()
           
 org.opengis.geometry.PositionFactory getPositionFactory()
           
 org.opengis.geometry.Precision getPrecision()
           
 org.opengis.geometry.primitive.PrimitiveFactory getPrimitiveFactory()
           
 void setCoordianteReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryBuilder

public GeometryBuilder(org.opengis.referencing.crs.CoordinateReferenceSystem crs)

GeometryBuilder

public GeometryBuilder(java.lang.String code)
                throws org.opengis.referencing.NoSuchAuthorityCodeException,
                       org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException
org.opengis.referencing.FactoryException

GeometryBuilder

public GeometryBuilder(Hints hints)
Method Detail

getCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()

setCoordianteReferenceSystem

public void setCoordianteReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem crs)

getPrecision

public org.opengis.geometry.Precision getPrecision()

getPositionFactory

public org.opengis.geometry.PositionFactory getPositionFactory()

getPrimitiveFactory

public org.opengis.geometry.primitive.PrimitiveFactory getPrimitiveFactory()

getAggregateFactory

public org.opengis.geometry.aggregate.AggregateFactory getAggregateFactory()

getGeometryFactory

public org.opengis.geometry.coordinate.GeometryFactory getGeometryFactory()

getComplexFactory

public org.opengis.geometry.complex.ComplexFactory getComplexFactory()

createDirectPosition

public org.opengis.geometry.DirectPosition createDirectPosition(double[] ordinates)

createPosition

public org.opengis.geometry.coordinate.Position createPosition(org.opengis.geometry.coordinate.Position position)

createPointArray

public org.opengis.geometry.coordinate.PointArray createPointArray()

createPointArray

public org.opengis.geometry.coordinate.PointArray createPointArray(double[] array)

createPointArray

public org.opengis.geometry.coordinate.PointArray createPointArray(double[] array,
                                                                   int start,
                                                                   int end)

createPositionList

public org.opengis.geometry.coordinate.PointArray createPositionList(float[] array,
                                                                     int start,
                                                                     int end)

createCurve

public org.opengis.geometry.primitive.Curve createCurve(java.util.List segments)
                                                 throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                        org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createCurve

public org.opengis.geometry.primitive.Curve createCurve(org.opengis.geometry.coordinate.PointArray points)
                                                 throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                        org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createPoint

public org.opengis.geometry.primitive.Point createPoint(double ord1,
                                                        double ord2)
Create a point with the provided ordinates.

Parameters:
ord1 -
ord2 -
Returns:
createPoint( new double[]{ ord1, ord2})

createPoint

public org.opengis.geometry.primitive.Point createPoint(double ord1,
                                                        double ord2,
                                                        double ord3)
Create a point with the provided ordinates.

Parameters:
ord1 -
ord2 -
ord3 -
Returns:
createPoint( new double[]{ ord1, ord2, ord3 })

createPoint

public org.opengis.geometry.primitive.Point createPoint(double[] ordinates)
                                                 throws org.opengis.geometry.MismatchedDimensionException
Create a point with the provided ordinates

Parameters:
ordinates -
Returns:
getPrimitiveFactory().createPoint(coordinates)
Throws:
org.opengis.geometry.MismatchedDimensionException

createPoint

public org.opengis.geometry.primitive.Point createPoint(org.opengis.geometry.coordinate.Position position)
                                                 throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                        org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createPrimitive

public org.opengis.geometry.primitive.Primitive createPrimitive(org.opengis.geometry.Envelope envelope)
                                                         throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createRing

public org.opengis.geometry.primitive.Ring createRing(java.util.List<org.opengis.geometry.primitive.OrientableCurve> orientableCurves)
                                               throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                      org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSolid

public org.opengis.geometry.primitive.Solid createSolid(org.opengis.geometry.primitive.SolidBoundary boundary)
                                                 throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                        org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurfaceBoundary

public org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.coordinate.PointArray points)
                                                                     throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                            org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurface

public org.opengis.geometry.primitive.Surface createSurface(java.util.List surfaces)
                                                     throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                            org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurface

public org.opengis.geometry.primitive.Surface createSurface(org.opengis.geometry.primitive.SurfaceBoundary boundary)
                                                     throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                            org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurfaceBoundary

public org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.primitive.Ring exterior,
                                                                            java.util.List interiors)
                                                                     throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                            org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurfaceBoundary

public org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.primitive.Ring exterior)
                                                                     throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                            org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurfaceBoundary

public org.opengis.geometry.primitive.SurfaceBoundary createSurfaceBoundary(org.opengis.geometry.primitive.OrientableCurve curve)
                                                                     throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                            org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createDirectPosition

public org.opengis.geometry.DirectPosition createDirectPosition()

createEnvelope

public org.opengis.geometry.Envelope createEnvelope(org.opengis.geometry.DirectPosition lowerCorner,
                                                    org.opengis.geometry.DirectPosition upperCorner)
                                             throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                    org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createLineSegment

public org.opengis.geometry.coordinate.LineSegment createLineSegment(org.opengis.geometry.coordinate.Position startPoint,
                                                                     org.opengis.geometry.coordinate.Position endPoint)
                                                              throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                     org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createLineString

public org.opengis.geometry.coordinate.LineString createLineString(java.util.List points)
                                                            throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                   org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createLineString

public org.opengis.geometry.coordinate.LineString createLineString(org.opengis.geometry.coordinate.PointArray points)
                                                            throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                   org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createLineSegment

public org.opengis.geometry.coordinate.LineSegment createLineSegment(org.opengis.geometry.DirectPosition from,
                                                                     org.opengis.geometry.DirectPosition to)

createMultiPrimitive

public org.opengis.geometry.aggregate.MultiPrimitive createMultiPrimitive()

createPolygon

public org.opengis.geometry.coordinate.Polygon createPolygon(org.opengis.geometry.primitive.SurfaceBoundary boundary)
                                                      throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                             org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createPolygon

public org.opengis.geometry.coordinate.Polygon createPolygon(org.opengis.geometry.primitive.SurfaceBoundary boundary,
                                                             org.opengis.geometry.primitive.Surface spanSurface)
                                                      throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                             org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createPolyhedralSurface

public org.opengis.geometry.coordinate.PolyhedralSurface createPolyhedralSurface(java.util.List tiles)
                                                                          throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                                 org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createTin

public org.opengis.geometry.coordinate.Tin createTin(java.util.Set post,
                                                     java.util.Set stopLines,
                                                     java.util.Set breakLines,
                                                     double maxLength)
                                              throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                     org.opengis.geometry.MismatchedDimensionException
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createCompositeCurve

public org.opengis.geometry.complex.CompositeCurve createCompositeCurve(java.util.List generator)

createCompositePoint

public org.opengis.geometry.complex.CompositePoint createCompositePoint(org.opengis.geometry.primitive.Point generator)

createCompositeSurface

public org.opengis.geometry.complex.CompositeSurface createCompositeSurface(java.util.List generator)

createMultiCurve

public org.opengis.geometry.aggregate.MultiCurve createMultiCurve(java.util.Set curves)

createMultiPoint

public org.opengis.geometry.aggregate.MultiPoint createMultiPoint(java.util.Set points)

createMultiPrimitive

public org.opengis.geometry.aggregate.MultiPrimitive createMultiPrimitive(java.util.Set primitives)

createMultiSurface

public org.opengis.geometry.aggregate.MultiSurface createMultiSurface(java.util.Set surfaces)


Copyright © 1996-2010 Geotools. All Rights Reserved.