GeoAPI 1.0
Build 2004-05-18

org.opengis.spatialschema.geometry.geometry
Interface GeometryFactory


public interface GeometryFactory

A factory of geometries. All geometries created through this interface will use the factory's coordinate reference system. Creating geometries in a different CRS may requires a different instance of GeometryFactory.

Version:
2.0
Author:
ISO/DIS 19107, OpenGIS® consortium

REVISIT OPEN ISSUE (a GeoAPI comment)
Should we extend Factory?

Method Summary
 Arc createArc(Position startPoint, Position endPoint, double bulge, double[] normal)
          Takes two positions and the offset of the midpoint of the arc from the midpoint of the chord, given by a distance and direction, and constructs the corresponding arc.
 Arc createArc(Position startPoint, Position midPoint, Position endPoint)
          Takes three positions and constructs the corresponding arc.
 ArcByBulge createArcByBulge(Position startPoint, Position endPoint, double bulge, double[] normal)
          Equivalents to the second constructor of arc, except the bulge representation is maintained.
 ArcString createArcString(List<Position> points)
          Takes a sequence of positions and constructs a sequence of 3-point arcs jointing them.
 ArcStringByBulge createArcStringByBulge(List<Position> points, double[] bulges, List<double[]> normals)
          Equivalent to the second constructor of arc, except the bulge representation is maintained internal to the object.
 Geodesic createGeodesic(Position startPoint, Position endPoint)
          Takes two positions and creates the appropriate geodesic joining them.
 GeodesicString createGeodesicString(List<Position> points)
          Takes two or more positions, interpolates using a geodesic defined from the geoid (or ellipsoid) of the coordinate reference system being used, and creates the appropriate geodesic string joining them.
 LineSegment createLineSegment(Position startPoint, Position endPoint)
          Takes two positions and creates the appropriate line segment joining them.
 LineString createLineString(List<Position> points)
          Takes two or more positions and creates the appropriate line string joining them.
 CoordinateReferenceSystem getCoordinateReferenceSystem()
          Returns the coordinate reference system in use for all geometries to be created through this interface.
 

Method Detail

getCoordinateReferenceSystem

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


createLineSegment

LineSegment createLineSegment(Position startPoint,
                              Position endPoint)
Takes two positions and creates the appropriate line segment joining them.

Parameters:
startPoint - The start point.
endPoint - The end point.
UML identifier (constructor): GM_LineSegment(GM_Position[2])

createLineString

LineString createLineString(List<Position> points)
Takes two or more positions and creates the appropriate line string joining them.

UML identifier (constructor): GM_LineString(GM_Position[2..n])

createGeodesic

Geodesic createGeodesic(Position startPoint,
                        Position endPoint)
Takes two positions and creates the appropriate geodesic joining them.

Parameters:
startPoint - The start point.
endPoint - The end point.

createGeodesicString

GeodesicString createGeodesicString(List<Position> points)
Takes two or more positions, interpolates using a geodesic defined from the geoid (or ellipsoid) of the coordinate reference system being used, and creates the appropriate geodesic string joining them.

UML identifier (constructor): GM_GeodesicString(GM_Position[2..n])

createArc

Arc createArc(Position startPoint,
              Position midPoint,
              Position endPoint)
Takes three positions and constructs the corresponding arc.

Parameters:
startPoint - The start point.
midPoint - Some point on the arc neither at the start or end.
endPoint - The end point.
UML identifier (constructor): GM_Arc(GM_Position[3])

createArc

Arc createArc(Position startPoint,
              Position endPoint,
              double bulge,
              double[] normal)
Takes two positions and the offset of the midpoint of the arc from the midpoint of the chord, given by a distance and direction, and constructs the corresponding arc. The midpoint of the resulting arc is given by:
midPoint = ((startPoint + endPoint)/2.0) + bulge×normal
In 2D coordinate reference systems, the bulge can be given a sign and the normal can be assumed to be the perpendicular to the line segment between the start and end point of the arc (the chord of the arc), pointing left. For example if the two points are P0 = (x0y0) and P1 = (x1y1), and the bulge is b, then the vector in the direction of P1 from P0 is:
u = (u0u1) = (x1-x0, y1-y0) / sqrt((x1-x0)2 + (y1-y0)2)
To complete a right-handed local coordinate system {u,v}, the two vectors must have a vector dot product of zero and a vector cross product of 1. By inspection, the leftward normal to complete the pair is:
v = (v0v1) = (-u1u0)
The midpoint of the arc, which is the midpoint of the chord offset by the bulge, becomes:
m = (P0 + P1)/2 + b×v
This is leftward if b > 0 and rightward if b < 0.

Parameters:
startPoint - The start point.
endPoint - The end point.
bulge - The distance of the midpoint of the arc from the midpoint of the chord.
normal - A direction normal to the chord.
UML identifier (constructor): GM_Arc(GM_Position[2],Real,Vector)

createArcString

ArcString createArcString(List<Position> points)
Takes a sequence of positions and constructs a sequence of 3-point arcs jointing them. By the nature of an arc string, the sequence must have an odd number of positions.

UML identifier (constructor): GM_ArcString(GM_Position[3,, 5,, 7...])

createArcByBulge

ArcByBulge createArcByBulge(Position startPoint,
                            Position endPoint,
                            double bulge,
                            double[] normal)
Equivalents to the second constructor of arc, except the bulge representation is maintained. The midpoint of the resulting arc is given by:
midPoint = ((startPoint + endPoint)/2.0) + bulge×normal

Parameters:
startPoint - The start point.
endPoint - The end point.
bulge - The distance of the midpoint of the arc from the midpoint of the chord.
normal - A direction normal to the chord.
UML identifier (constructor): GM_ArcByBulge(GM_Position[2],Real,Vector)

createArcStringByBulge

ArcStringByBulge createArcStringByBulge(List<Position> points,
                                        double[] bulges,
                                        List<double[]> normals)
Equivalent to the second constructor of arc, except the bulge representation is maintained internal to the object. The midpoints of the resulting arc is given by:
midPoint[n] = ((points[n] + points[n+1])/2.0) + (bulge * normal)

Parameters:
points - The points to use as start and end points for each arc. This list size must be equals to the bulge array length plus 1.
bulges - The distances of the midpoint of the arc from the midpoint of the chord.
normals - The directions normal to the chord. This list size must be the same than the bulge array length.
UML identifier (constructor): GM_ArcStringByBulge(GM_Position[2..n],Real[1..n],Vector[1..n])

GeoAPI 1.0
Build 2004-05-18

Symbols, terms and definitions
Copyright OpenGIS® Consortium