org.geotools.geometry.iso.coordinate
Class GeometryFactoryImpl

java.lang.Object
  extended by org.geotools.geometry.iso.coordinate.GeometryFactoryImpl
All Implemented Interfaces:
Factory, org.opengis.geometry.coordinate.GeometryFactory

public class GeometryFactoryImpl
extends java.lang.Object
implements Factory, org.opengis.geometry.coordinate.GeometryFactory

convenience methods to create objects of the coordinate geometry package using only java native types as parameters

Author:
Jackson Roehrig & Sanjay Jena

Constructor Summary
GeometryFactoryImpl()
          FactorySPI entry point
GeometryFactoryImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.geometry.PositionFactory pf)
           
GeometryFactoryImpl(Hints hints)
          Just the defaults, use GeometryFactoryFinder for the rest
 
Method Summary
 org.opengis.geometry.coordinate.Arc createArc(org.opengis.geometry.coordinate.Position startPoint, org.opengis.geometry.coordinate.Position endPoint, double bulge, double[] normal)
           
 org.opengis.geometry.coordinate.Arc createArc(org.opengis.geometry.coordinate.Position startPoint, org.opengis.geometry.coordinate.Position midPoint, org.opengis.geometry.coordinate.Position endPoint)
           
 org.opengis.geometry.coordinate.ArcByBulge createArcByBulge(org.opengis.geometry.coordinate.Position startPoint, org.opengis.geometry.coordinate.Position endPoint, double bulge, double[] normal)
           
 org.opengis.geometry.coordinate.ArcString createArcString(java.util.List<org.opengis.geometry.coordinate.Position> points)
           
 org.opengis.geometry.coordinate.ArcStringByBulge createArcStringByBulge(java.util.List<org.opengis.geometry.coordinate.Position> points, double[] bulges, java.util.List<double[]> normals)
           
 org.opengis.geometry.coordinate.BSplineCurve createBSplineCurve(int degree, org.opengis.geometry.coordinate.PointArray points, java.util.List<org.opengis.geometry.coordinate.Knot> knots, org.opengis.geometry.coordinate.KnotType knotSpec)
           
 org.opengis.geometry.coordinate.BSplineSurface createBSplineSurface(java.util.List<org.opengis.geometry.coordinate.PointArray> points, int[] degree, java.util.List<org.opengis.geometry.coordinate.Knot>[] knots, org.opengis.geometry.coordinate.KnotType knotSpec)
           
 org.opengis.geometry.DirectPosition createDirectPosition()
           
 org.opengis.geometry.DirectPosition createDirectPosition(org.opengis.geometry.DirectPosition dp)
           
 org.opengis.geometry.DirectPosition createDirectPosition(double[] coord)
           
 java.util.Collection<org.opengis.geometry.DirectPosition> createDirectPositions(java.util.Collection<double[]> coordList, java.util.Collection<org.opengis.geometry.DirectPosition> directPositions)
           
 org.opengis.geometry.Envelope createEnvelope(org.opengis.geometry.DirectPosition lowerCorner, org.opengis.geometry.DirectPosition upperCorner)
           
 EnvelopeImpl createEnvelope(double[] c)
          Creates an Envelope with the given coordinates.
 EnvelopeImpl createEnvelope(org.opengis.geometry.Envelope env)
          Creates a new Envelope equal to the given envelope
 org.opengis.geometry.coordinate.Geodesic createGeodesic(org.opengis.geometry.coordinate.Position startPoint, org.opengis.geometry.coordinate.Position endPoint)
           
 org.opengis.geometry.coordinate.GeodesicString createGeodesicString(java.util.List<org.opengis.geometry.coordinate.Position> points)
           
 LineSegmentImpl createLineSegment(double[] fromPosition, double[] toPosition, double startPar)
          Creates a line segment between fromPosition and toPosition.
 org.opengis.geometry.coordinate.LineSegment createLineSegment(org.opengis.geometry.coordinate.Position startPoint, org.opengis.geometry.coordinate.Position endPoint)
           
 LineSegmentImpl createLineSegment(org.opengis.geometry.coordinate.Position p0, org.opengis.geometry.coordinate.Position p1, double startPar)
          Creates a LineSegment with a given value as startParam
 LineStringImpl createLineString(java.util.List<org.opengis.geometry.coordinate.Position> positions)
           
 LineStringImpl createLineString(java.util.List<org.opengis.geometry.coordinate.Position> positions, double startPar)
          Creates LineString from Array of DirectPosition2D
 LineStringImpl createLineString(PointArrayImpl pointArray, double startPar)
           
 java.util.Collection<LineStringImpl> createLineStrings(java.util.Collection<java.util.List<double[]>> coordLists, java.util.List<LineStringImpl> lineStrings)
           
 org.opengis.geometry.aggregate.MultiPrimitive createMultiPrimitive()
           
 PointArrayImpl createPointArray(java.util.List<org.opengis.geometry.coordinate.Position> positions)
          Creates a new PointArray
 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<org.opengis.geometry.coordinate.Polygon> tiles)
           
 org.opengis.geometry.coordinate.Position createPosition(org.opengis.geometry.DirectPosition dp)
           
 PositionImpl createPosition(double[] coord)
          Creates a Position with the given ordinates coord.
 java.util.List<org.opengis.geometry.coordinate.Position> createPositions(java.util.Collection<double[]> coordList, java.util.List<org.opengis.geometry.coordinate.Position> positions)
           
 org.opengis.geometry.coordinate.Tin createTin(java.util.Set<org.opengis.geometry.coordinate.Position> post, java.util.Set<org.opengis.geometry.coordinate.LineString> stopLines, java.util.Set<org.opengis.geometry.coordinate.LineString> breakLines, double maxLength)
           
 TriangleImpl createTriangle(org.opengis.geometry.coordinate.TriangulatedSurface ts, org.opengis.geometry.DirectPosition p1, org.opengis.geometry.DirectPosition p2, org.opengis.geometry.DirectPosition p3)
          Creates a Triangle from three DirectPositions Builds the Surface Boundary for the Triangle
 java.util.ArrayList<org.opengis.geometry.coordinate.Triangle> createTriangles(java.util.ArrayList<double[][]> triangles)
           
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
           
 int getDimension()
          Returns the Coordinate Dimension of the used Coordinate System (Sanjay)
 java.util.Map getImplementationHints()
          Report back to FactoryRegistry about our configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryFactoryImpl

public GeometryFactoryImpl()
FactorySPI entry point


GeometryFactoryImpl

public GeometryFactoryImpl(Hints hints)
Just the defaults, use GeometryFactoryFinder for the rest


GeometryFactoryImpl

public GeometryFactoryImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                           org.opengis.geometry.PositionFactory pf)
Parameters:
crs -
Method Detail

getImplementationHints

public java.util.Map getImplementationHints()
Report back to FactoryRegistry about our configuration.

FactoryRegistry will check to make sure that there are no duplicates created (so there will be only a "single" PositionFactory created with this configuration).

Specified by:
getImplementationHints in interface Factory
Returns:
The map of hints, or an empty map if none.

getCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Specified by:
getCoordinateReferenceSystem in interface org.opengis.geometry.coordinate.GeometryFactory

getDimension

public int getDimension()
Returns the Coordinate Dimension of the used Coordinate System (Sanjay)

Returns:
dimension Coordinate Dimension used in this Factory

createDirectPosition

public org.opengis.geometry.DirectPosition createDirectPosition()
Specified by:
createDirectPosition in interface org.opengis.geometry.coordinate.GeometryFactory

createDirectPosition

public org.opengis.geometry.DirectPosition createDirectPosition(double[] coord)
Specified by:
createDirectPosition in interface org.opengis.geometry.coordinate.GeometryFactory

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
Specified by:
createEnvelope in interface org.opengis.geometry.coordinate.GeometryFactory
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
Specified by:
createLineSegment in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createPolygon

public org.opengis.geometry.coordinate.Polygon createPolygon(org.opengis.geometry.primitive.SurfaceBoundary boundary)
                                                      throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                             org.opengis.geometry.MismatchedDimensionException
Specified by:
createPolygon in interface org.opengis.geometry.coordinate.GeometryFactory
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
Specified by:
createPolygon in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createMultiPrimitive

public org.opengis.geometry.aggregate.MultiPrimitive createMultiPrimitive()
Specified by:
createMultiPrimitive in interface org.opengis.geometry.coordinate.GeometryFactory

createDirectPosition

public org.opengis.geometry.DirectPosition createDirectPosition(org.opengis.geometry.DirectPosition dp)
Parameters:
dp -
Returns:
DirectPositionImpl

createDirectPositions

public java.util.Collection<org.opengis.geometry.DirectPosition> createDirectPositions(java.util.Collection<double[]> coordList,
                                                                                       java.util.Collection<org.opengis.geometry.DirectPosition> directPositions)
Parameters:
coordList -
directPositions -
Returns:
Collection

createPosition

public PositionImpl createPosition(double[] coord)
Creates a Position with the given ordinates coord. The array coord must have at least two elements

Parameters:
coord - is the array of ordinates of the position
Returns:
PositionImpl

createPosition

public org.opengis.geometry.coordinate.Position createPosition(org.opengis.geometry.DirectPosition dp)

createPointArray

public PointArrayImpl createPointArray(java.util.List<org.opengis.geometry.coordinate.Position> positions)
Creates a new PointArray

Parameters:
positions -
Returns:
PointArrayImpl

createEnvelope

public EnvelopeImpl createEnvelope(double[] c)
Creates an Envelope with the given coordinates.

Parameters:
Coordinate - c of a point p. The created envelope will have this coordinate as lower and upper corner
Returns:
EnvelopeImpl The created envelope will have the coordinate as lower and upper corner.

createEnvelope

public EnvelopeImpl createEnvelope(org.opengis.geometry.Envelope env)
Creates a new Envelope equal to the given envelope

Parameters:
env -
Returns:
Envelope

createPositions

public java.util.List<org.opengis.geometry.coordinate.Position> createPositions(java.util.Collection<double[]> coordList,
                                                                                java.util.List<org.opengis.geometry.coordinate.Position> positions)
Parameters:
coordList -
positions -
Returns:
Collection

createLineSegment

public LineSegmentImpl createLineSegment(double[] fromPosition,
                                         double[] toPosition,
                                         double startPar)
Creates a line segment between fromPosition and toPosition. The coordinate dimension of the segment is fromPosition.length, fromPosition.length and toPoint.length must be equal and greater then 1 This method creates a LineSegment without references to the parent Curve. this will cause NullPointerExceptions in use of some methods

Parameters:
fromPosition -
toPosition -
startPar -
Returns:
LineSegmentImpl
Throws:
org.opengis.geometry.MismatchedDimensionException
java.lang.IllegalArgumentException

createLineSegment

public LineSegmentImpl createLineSegment(org.opengis.geometry.coordinate.Position p0,
                                         org.opengis.geometry.coordinate.Position p1,
                                         double startPar)
Creates a LineSegment with a given value as startParam

Parameters:
p0 -
p1 -
startPar -
Returns:
a new LineSegmentImpl

createLineString

public LineStringImpl createLineString(PointArrayImpl pointArray,
                                       double startPar)
Parameters:
pointArray -
startPar -
Returns:
LineStringImpl

createLineString

public LineStringImpl createLineString(java.util.List<org.opengis.geometry.coordinate.Position> positions,
                                       double startPar)
Creates LineString from Array of DirectPosition2D

Parameters:
positions -
startPar -
Returns:
LineString

createLineStrings

public java.util.Collection<LineStringImpl> createLineStrings(java.util.Collection<java.util.List<double[]>> coordLists,
                                                              java.util.List<LineStringImpl> lineStrings)
Parameters:
coordLists -
lineStrings -
Returns:
Collection

createLineString

public LineStringImpl createLineString(java.util.List<org.opengis.geometry.coordinate.Position> positions)
                                throws org.opengis.geometry.MismatchedReferenceSystemException,
                                       org.opengis.geometry.MismatchedDimensionException
Specified by:
createLineString in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createTriangle

public TriangleImpl createTriangle(org.opengis.geometry.coordinate.TriangulatedSurface ts,
                                   org.opengis.geometry.DirectPosition p1,
                                   org.opengis.geometry.DirectPosition p2,
                                   org.opengis.geometry.DirectPosition p3)
Creates a Triangle from three DirectPositions Builds the Surface Boundary for the Triangle

Parameters:
ts -
p1 -
p2 -
p3 -
Returns:
Triangle

createTriangles

public java.util.ArrayList<org.opengis.geometry.coordinate.Triangle> createTriangles(java.util.ArrayList<double[][]> triangles)
Parameters:
triangles -
Returns:
ArrayList

createArcString

public org.opengis.geometry.coordinate.ArcString createArcString(java.util.List<org.opengis.geometry.coordinate.Position> points)
                                                          throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                 org.opengis.geometry.MismatchedDimensionException
Specified by:
createArcString in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createArcStringByBulge

public org.opengis.geometry.coordinate.ArcStringByBulge createArcStringByBulge(java.util.List<org.opengis.geometry.coordinate.Position> points,
                                                                               double[] bulges,
                                                                               java.util.List<double[]> normals)
                                                                        throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                               org.opengis.geometry.MismatchedDimensionException
Specified by:
createArcStringByBulge in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createBSplineCurve

public org.opengis.geometry.coordinate.BSplineCurve createBSplineCurve(int degree,
                                                                       org.opengis.geometry.coordinate.PointArray points,
                                                                       java.util.List<org.opengis.geometry.coordinate.Knot> knots,
                                                                       org.opengis.geometry.coordinate.KnotType knotSpec)
                                                                throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                       org.opengis.geometry.MismatchedDimensionException
Specified by:
createBSplineCurve in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createBSplineSurface

public org.opengis.geometry.coordinate.BSplineSurface createBSplineSurface(java.util.List<org.opengis.geometry.coordinate.PointArray> points,
                                                                           int[] degree,
                                                                           java.util.List<org.opengis.geometry.coordinate.Knot>[] knots,
                                                                           org.opengis.geometry.coordinate.KnotType knotSpec)
                                                                    throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                           org.opengis.geometry.MismatchedDimensionException
Specified by:
createBSplineSurface in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createGeodesicString

public org.opengis.geometry.coordinate.GeodesicString createGeodesicString(java.util.List<org.opengis.geometry.coordinate.Position> points)
                                                                    throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                           org.opengis.geometry.MismatchedDimensionException
Specified by:
createGeodesicString in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createPolyhedralSurface

public org.opengis.geometry.coordinate.PolyhedralSurface createPolyhedralSurface(java.util.List<org.opengis.geometry.coordinate.Polygon> tiles)
                                                                          throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                                 org.opengis.geometry.MismatchedDimensionException
Specified by:
createPolyhedralSurface in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createTin

public org.opengis.geometry.coordinate.Tin createTin(java.util.Set<org.opengis.geometry.coordinate.Position> post,
                                                     java.util.Set<org.opengis.geometry.coordinate.LineString> stopLines,
                                                     java.util.Set<org.opengis.geometry.coordinate.LineString> breakLines,
                                                     double maxLength)
                                              throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                     org.opengis.geometry.MismatchedDimensionException
Specified by:
createTin in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createArc

public org.opengis.geometry.coordinate.Arc createArc(org.opengis.geometry.coordinate.Position startPoint,
                                                     org.opengis.geometry.coordinate.Position midPoint,
                                                     org.opengis.geometry.coordinate.Position endPoint)
                                              throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                     org.opengis.geometry.MismatchedDimensionException
Specified by:
createArc in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createArc

public org.opengis.geometry.coordinate.Arc createArc(org.opengis.geometry.coordinate.Position startPoint,
                                                     org.opengis.geometry.coordinate.Position endPoint,
                                                     double bulge,
                                                     double[] normal)
                                              throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                     org.opengis.geometry.MismatchedDimensionException
Specified by:
createArc in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createArcByBulge

public org.opengis.geometry.coordinate.ArcByBulge createArcByBulge(org.opengis.geometry.coordinate.Position startPoint,
                                                                   org.opengis.geometry.coordinate.Position endPoint,
                                                                   double bulge,
                                                                   double[] normal)
                                                            throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                                   org.opengis.geometry.MismatchedDimensionException
Specified by:
createArcByBulge in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createGeodesic

public org.opengis.geometry.coordinate.Geodesic createGeodesic(org.opengis.geometry.coordinate.Position startPoint,
                                                               org.opengis.geometry.coordinate.Position endPoint)
                                                        throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                               org.opengis.geometry.MismatchedDimensionException
Specified by:
createGeodesic in interface org.opengis.geometry.coordinate.GeometryFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException


Copyright © 1996-2010 Geotools. All Rights Reserved.