org.opengis.geometry
Interface PositionFactory


public interface PositionFactory

A factory for managing direct position creation.

This factory will be created for a known Coordinate Reference System and precision model.

Since:
GeoAPI 2.1

Method Summary
 DirectPosition createDirectPosition(double[] coordinates)
          Creates a direct position at the specified location specified by coordinates.
 PointArray createPointArray()
          Creates a (possibiliy optimized) list for positions.
 PointArray createPointArray(double[] coordinates, int start, int length)
          Creates a list for positions initialised from the specified values.
 PointArray createPointArray(float[] coordinates, int start, int length)
          Creates a list for positions initialized from the specified values.
 Position createPosition(Position position)
          Constructs a position from an other position by copying the coordinate values of the position.
 CoordinateReferenceSystem getCoordinateReferenceSystem()
          Returns the coordinate reference system in use for all direct positions to be created through this interface.
 Precision getPrecision()
          The Precision used used by direct positions created via this factory.
 

Method Detail

getCoordinateReferenceSystem

CoordinateReferenceSystem getCoordinateReferenceSystem()
Returns the coordinate reference system in use for all direct positions to be created through this interface.


getPrecision

Precision getPrecision()
The Precision used used by direct positions created via this factory.

The Precision is used to inform topological operations of the number of significant digits maintained by the DirectPosition instances. This information both helps operations stop when the correct level of detail is reached, and ensure the result will be valid when rounded to the required precision.


createDirectPosition

DirectPosition createDirectPosition(double[] coordinates)
                                    throws MismatchedDimensionException
Creates a direct position at the specified location specified by coordinates.

Implementations have the option of taking ownership of the provided coordinate array. You should not attempt to reuse this array after it has been provided to this factory method.

Parameters:
coordinates - Array of ordinates used for this DirectPosition
Throws:
MismatchedDimensionException - if the coordinates array length doesn't match the coordinate reference system dimension.

createPosition

Position createPosition(Position position)
Constructs a position from an other position by copying the coordinate values of the position. There will be no further reference to the position instance.

Parameters:
position - A position.
Returns:
The position which defines the coordinates for the other position.

createPointArray

PointArray createPointArray()
Creates a (possibiliy optimized) list for positions. The list is initially empty. New direct positions can be stored using the List.add(E) method.


createPointArray

PointArray createPointArray(double[] coordinates,
                            int start,
                            int length)
Creates a list for positions initialised from the specified values.

Implementations have the option of taking ownership of the provided coordinate array. You should not attempt to reuse this array after it has been provided to this factory method.

Parameters:
coordinates - The coordinates to assign to the list of positions.
start - The first valid value in the coordinates array.
length - The number of valid values in the coordinates array.
Returns:
The list of positions.

createPointArray

PointArray createPointArray(float[] coordinates,
                            int start,
                            int length)
Creates a list for positions initialized from the specified values.

Implementations have the option of taking ownership of the provided coordinate array. You should not attempt to reuse this array after it has been provided to this factory method.

Parameters:
coordinates - The coordinates to assign to the list of positions.
start - The first valid value in the coordinates array.
length - The number of valid values in the coordinates array.
Returns:
The list of positions.


Copyright © 1994-2008 Open Geospatial Consortium. All Rights Reserved.