org.geotools.geometry.iso.primitive
Class PrimitiveFactoryImpl

java.lang.Object
  extended by org.geotools.geometry.iso.primitive.PrimitiveFactoryImpl
All Implemented Interfaces:
java.io.Serializable, Factory, org.opengis.geometry.primitive.PrimitiveFactory

public class PrimitiveFactoryImpl
extends java.lang.Object
implements java.io.Serializable, Factory, org.opengis.geometry.primitive.PrimitiveFactory

Author:
Jackson Roehrig & Sanjay Jena
See Also:
Serialized Form

Constructor Summary
PrimitiveFactoryImpl()
          FactorySPI entry point
PrimitiveFactoryImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.geometry.PositionFactory positionFactory)
           
PrimitiveFactoryImpl(Hints hints)
          Just the defaults, use GeometryFactoryFinder for the rest
 
Method Summary
 CurveImpl createCurve(java.util.List<org.opengis.geometry.primitive.CurveSegment> segments)
           
 CurveBoundaryImpl createCurveBoundary(org.opengis.geometry.DirectPosition dp0, org.opengis.geometry.DirectPosition dp1)
          Creates a CurveBoundary
 CurveBoundaryImpl createCurveBoundary(org.opengis.geometry.primitive.Point p0, org.opengis.geometry.primitive.Point p1)
          Creates a CurveBoundary
 org.opengis.geometry.primitive.Curve createCurveByDirectPositions(java.util.List<org.opengis.geometry.DirectPosition> aDirectPositions)
          Creates a Curve conforming to the given DirectPositions Tested by Sanjay -
 CurveImpl createCurveByPositions(java.util.List<org.opengis.geometry.coordinate.Position> aPositions)
          Creates a curve bu Positions
 PointImpl createPoint(DirectPositionImpl dp)
          Creates a Point by copying the coordinates of a given DirectPosition
 PointImpl createPoint(double[] coord)
           
 PointImpl createPoint(org.opengis.geometry.coordinate.Position position)
           
 java.util.List<org.opengis.geometry.coordinate.Position> createPositions(java.util.List<org.opengis.geometry.DirectPosition> aDirectPositions)
          Converts a List of DirectPosition objects to a List of Position objects
 PrimitiveImpl createPrimitive(org.opengis.geometry.Envelope bounds)
           
 org.opengis.geometry.primitive.Ring createRing(java.util.List<org.opengis.geometry.primitive.OrientableCurve> orientableCurves)
           
 org.opengis.geometry.primitive.Ring createRingByDirectPositions(java.util.List<org.opengis.geometry.DirectPosition> directPositions)
          Creates a Ring conforming to the given DirectPositions.
 org.opengis.geometry.primitive.Ring createRingByPositions(java.util.List<org.opengis.geometry.coordinate.Position> aPositions)
          Creates a Ring conforming to the given Positions
 SolidImpl createSolid(org.opengis.geometry.primitive.SolidBoundary boundary)
           
 SurfaceImpl createSurface(java.util.List<org.opengis.geometry.primitive.SurfacePatch> surfacePatches)
           
 SurfaceImpl createSurface(org.opengis.geometry.primitive.SurfaceBoundary boundary)
           
 SurfaceBoundaryImpl createSurfaceBoundary(org.opengis.geometry.primitive.Ring exterior, java.util.List<org.opengis.geometry.primitive.Ring> interiors)
           
 SurfaceImpl createSurfaceByDirectPositions(java.util.List<org.opengis.geometry.DirectPosition> positions)
          Creates a simple surface without holes by a list of DirectPositions
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
           
 int getDimension()
          Returns the Coordinate Dimension of the used Coordinate System (Sanjay)
 java.util.Map getImplementationHints()
          These are the hints we used
 org.opengis.geometry.PositionFactory getPositionFactory()
           
 org.opengis.geometry.primitive.Ring processBoundsToRing(org.opengis.geometry.Envelope bounds, org.opengis.geometry.coordinate.LineSegment segment, int D)
          This is pass #2 ...
 org.opengis.geometry.coordinate.LineSegment processBoundsToSegment(org.opengis.geometry.Envelope bounds)
          This is the first and easy step ...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveFactoryImpl

public PrimitiveFactoryImpl()
FactorySPI entry point


PrimitiveFactoryImpl

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


PrimitiveFactoryImpl

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

getImplementationHints

public java.util.Map getImplementationHints()
These are the hints we used

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.primitive.PrimitiveFactory

getPositionFactory

public org.opengis.geometry.PositionFactory getPositionFactory()

getDimension

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

Returns:
dimension Coordinate Dimension used in this Factory

createPoint

public PointImpl createPoint(double[] coord)
Specified by:
createPoint in interface org.opengis.geometry.primitive.PrimitiveFactory

createPoint

public PointImpl createPoint(DirectPositionImpl dp)
Creates a Point by copying the coordinates of a given DirectPosition

Parameters:
dp - DirectPosition, will be copied
Returns:
PointImpl

createPoint

public PointImpl createPoint(org.opengis.geometry.coordinate.Position position)
                      throws org.opengis.geometry.MismatchedReferenceSystemException,
                             org.opengis.geometry.MismatchedDimensionException
Specified by:
createPoint in interface org.opengis.geometry.primitive.PrimitiveFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createCurveBoundary

public CurveBoundaryImpl createCurveBoundary(org.opengis.geometry.DirectPosition dp0,
                                             org.opengis.geometry.DirectPosition dp1)
Creates a CurveBoundary

Parameters:
dp0 -
dp1 -
Returns:
CurveBoundaryImpl

createCurveBoundary

public CurveBoundaryImpl createCurveBoundary(org.opengis.geometry.primitive.Point p0,
                                             org.opengis.geometry.primitive.Point p1)
Creates a CurveBoundary

Parameters:
p0 -
p1 -
Returns:
CurveBoundaryImpl

createCurve

public CurveImpl createCurve(java.util.List<org.opengis.geometry.primitive.CurveSegment> segments)
Specified by:
createCurve in interface org.opengis.geometry.primitive.PrimitiveFactory

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
Specified by:
createRing in interface org.opengis.geometry.primitive.PrimitiveFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurfaceBoundary

public SurfaceBoundaryImpl createSurfaceBoundary(org.opengis.geometry.primitive.Ring exterior,
                                                 java.util.List<org.opengis.geometry.primitive.Ring> interiors)
                                          throws org.opengis.geometry.MismatchedReferenceSystemException,
                                                 org.opengis.geometry.MismatchedDimensionException
Specified by:
createSurfaceBoundary in interface org.opengis.geometry.primitive.PrimitiveFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurface

public SurfaceImpl createSurface(java.util.List<org.opengis.geometry.primitive.SurfacePatch> surfacePatches)
                          throws org.opengis.geometry.MismatchedReferenceSystemException,
                                 org.opengis.geometry.MismatchedDimensionException
Specified by:
createSurface in interface org.opengis.geometry.primitive.PrimitiveFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSurface

public SurfaceImpl createSurface(org.opengis.geometry.primitive.SurfaceBoundary boundary)
                          throws org.opengis.geometry.MismatchedReferenceSystemException,
                                 org.opengis.geometry.MismatchedDimensionException
Specified by:
createSurface in interface org.opengis.geometry.primitive.PrimitiveFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createSolid

public SolidImpl createSolid(org.opengis.geometry.primitive.SolidBoundary boundary)
                      throws org.opengis.geometry.MismatchedReferenceSystemException,
                             org.opengis.geometry.MismatchedDimensionException
Specified by:
createSolid in interface org.opengis.geometry.primitive.PrimitiveFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

createPrimitive

public PrimitiveImpl createPrimitive(org.opengis.geometry.Envelope bounds)
                              throws org.opengis.geometry.MismatchedReferenceSystemException,
                                     org.opengis.geometry.MismatchedDimensionException
Specified by:
createPrimitive in interface org.opengis.geometry.primitive.PrimitiveFactory
Throws:
org.opengis.geometry.MismatchedReferenceSystemException
org.opengis.geometry.MismatchedDimensionException

processBoundsToSegment

public org.opengis.geometry.coordinate.LineSegment processBoundsToSegment(org.opengis.geometry.Envelope bounds)
This is the first and easy step ...

Parameters:
bounds -
dimension -

processBoundsToRing

public org.opengis.geometry.primitive.Ring processBoundsToRing(org.opengis.geometry.Envelope bounds,
                                                               org.opengis.geometry.coordinate.LineSegment segment,
                                                               int D)
This is pass #2 ...

Returns:

createRingByDirectPositions

public org.opengis.geometry.primitive.Ring createRingByDirectPositions(java.util.List<org.opengis.geometry.DirectPosition> directPositions)
Creates a Ring conforming to the given DirectPositions. Helps to build Rings for SurfaceBoundaries.

Parameters:
directPositions -
Returns:
a Ring

createRingByPositions

public org.opengis.geometry.primitive.Ring createRingByPositions(java.util.List<org.opengis.geometry.coordinate.Position> aPositions)
Creates a Ring conforming to the given Positions

Parameters:
aPositions -
Returns:

createCurveByDirectPositions

public org.opengis.geometry.primitive.Curve createCurveByDirectPositions(java.util.List<org.opengis.geometry.DirectPosition> aDirectPositions)
Creates a Curve conforming to the given DirectPositions Tested by Sanjay -

Parameters:
directPositions -
Returns:
a Ring

createPositions

public java.util.List<org.opengis.geometry.coordinate.Position> createPositions(java.util.List<org.opengis.geometry.DirectPosition> aDirectPositions)
Converts a List of DirectPosition objects to a List of Position objects

Parameters:
aDirectPositions - List of DirectPosition objects
Returns:
List of Position objects

createCurveByPositions

public CurveImpl createCurveByPositions(java.util.List<org.opengis.geometry.coordinate.Position> aPositions)
Creates a curve bu Positions

Parameters:
aPositions -
Returns:
Curve

createSurfaceByDirectPositions

public SurfaceImpl createSurfaceByDirectPositions(java.util.List<org.opengis.geometry.DirectPosition> positions)
Creates a simple surface without holes by a list of DirectPositions

Parameters:
positions - List of positions, the last positions must be equal to the first position
Returns:
a Surface defined by the given positions


Copyright © 1996-2010 Geotools. All Rights Reserved.