org.geotools.geometry
Class GeometryBuilder

Object
  extended by GeometryBuilder

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

Constructor Detail

GeometryBuilder

public GeometryBuilder(CoordinateReferenceSystem crs)

GeometryBuilder

public GeometryBuilder(String code)
                throws NoSuchAuthorityCodeException,
                       FactoryException
Throws:
NoSuchAuthorityCodeException
FactoryException

GeometryBuilder

public GeometryBuilder(Hints hints)
Method Detail

getCoordinateReferenceSystem

public CoordinateReferenceSystem getCoordinateReferenceSystem()

setCoordianteReferenceSystem

public void setCoordianteReferenceSystem(CoordinateReferenceSystem crs)

getPrecision

public Precision getPrecision()

getPositionFactory

public PositionFactory getPositionFactory()

getPrimitiveFactory

public PrimitiveFactory getPrimitiveFactory()

getAggregateFactory

public AggregateFactory getAggregateFactory()

getGeometryFactory

public GeometryFactory getGeometryFactory()

getComplexFactory

public ComplexFactory getComplexFactory()

createDirectPosition

public DirectPosition createDirectPosition(double[] ordinates)

createPosition

public Position createPosition(Position position)

createPointArray

public PointArray createPointArray()

createPointArray

public PointArray createPointArray(double[] array)

createPointArray

public PointArray createPointArray(double[] array,
                                   int start,
                                   int end)

createPositionList

public PointArray createPositionList(float[] array,
                                     int start,
                                     int end)

createCurve

public Curve createCurve(List segments)
                  throws MismatchedReferenceSystemException,
                         MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createCurve

public Curve createCurve(PointArray points)
                  throws MismatchedReferenceSystemException,
                         MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createPoint

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

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

createPoint

public 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 Point createPoint(double[] ordinates)
                  throws MismatchedDimensionException
Create a point with the provided ordinates

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

createPoint

public Point createPoint(Position position)
                  throws MismatchedReferenceSystemException,
                         MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createPrimitive

public Primitive createPrimitive(Envelope envelope)
                          throws MismatchedReferenceSystemException,
                                 MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createRing

public Ring createRing(List<OrientableCurve> orientableCurves)
                throws MismatchedReferenceSystemException,
                       MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createSolid

public Solid createSolid(SolidBoundary boundary)
                  throws MismatchedReferenceSystemException,
                         MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createSurfaceBoundary

public SurfaceBoundary createSurfaceBoundary(PointArray points)
                                      throws MismatchedReferenceSystemException,
                                             MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createSurface

public Surface createSurface(List surfaces)
                      throws MismatchedReferenceSystemException,
                             MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createSurface

public Surface createSurface(SurfaceBoundary boundary)
                      throws MismatchedReferenceSystemException,
                             MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createSurfaceBoundary

public SurfaceBoundary createSurfaceBoundary(Ring exterior,
                                             List interiors)
                                      throws MismatchedReferenceSystemException,
                                             MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createSurfaceBoundary

public SurfaceBoundary createSurfaceBoundary(Ring exterior)
                                      throws MismatchedReferenceSystemException,
                                             MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createSurfaceBoundary

public SurfaceBoundary createSurfaceBoundary(OrientableCurve curve)
                                      throws MismatchedReferenceSystemException,
                                             MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createDirectPosition

public DirectPosition createDirectPosition()

createEnvelope

public Envelope createEnvelope(DirectPosition lowerCorner,
                               DirectPosition upperCorner)
                        throws MismatchedReferenceSystemException,
                               MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createLineSegment

public LineSegment createLineSegment(Position startPoint,
                                     Position endPoint)
                              throws MismatchedReferenceSystemException,
                                     MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createLineString

public LineString createLineString(List points)
                            throws MismatchedReferenceSystemException,
                                   MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createLineString

public LineString createLineString(PointArray points)
                            throws MismatchedReferenceSystemException,
                                   MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createLineSegment

public LineSegment createLineSegment(DirectPosition from,
                                     DirectPosition to)

createMultiPrimitive

public MultiPrimitive createMultiPrimitive()

createPolygon

public Polygon createPolygon(SurfaceBoundary boundary)
                      throws MismatchedReferenceSystemException,
                             MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createPolygon

public Polygon createPolygon(SurfaceBoundary boundary,
                             Surface spanSurface)
                      throws MismatchedReferenceSystemException,
                             MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createPolyhedralSurface

public PolyhedralSurface createPolyhedralSurface(List tiles)
                                          throws MismatchedReferenceSystemException,
                                                 MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createTin

public Tin createTin(Set post,
                     Set stopLines,
                     Set breakLines,
                     double maxLength)
              throws MismatchedReferenceSystemException,
                     MismatchedDimensionException
Throws:
MismatchedReferenceSystemException
MismatchedDimensionException

createCompositeCurve

public CompositeCurve createCompositeCurve(List generator)

createCompositePoint

public CompositePoint createCompositePoint(Point generator)

createCompositeSurface

public CompositeSurface createCompositeSurface(List generator)

createMultiCurve

public MultiCurve createMultiCurve(Set curves)

createMultiPoint

public MultiPoint createMultiPoint(Set points)

createMultiPrimitive

public MultiPrimitive createMultiPrimitive(Set primitives)

createMultiSurface

public MultiSurface createMultiSurface(Set surfaces)


Copyright © 1996-2014 Geotools. All Rights Reserved.