GeoAPI 1.0
Build 2004-05-18

org.opengis.spatialschema.geometry.primitive
Interface PrimitiveFactory


public interface PrimitiveFactory

A factory of primitive geometric objects. All primitives created through this interface will use the factory's coordinate reference system. Creating primitives in a different CRS may requires a different instance of PrimitiveFactory.

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

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

Method Summary
 Curve createCurve(List<CurveSegment> segments)
          Takes a list of curve segments with the appropriate end-to-start relationships and creates a curve.
 DirectPosition createDirectPosition(double[] coordinates)
          Create a direct position at the specified location specified by coordinates.
 Point createPoint(double[] coordinates)
          Creates a point at the specified location specified by coordinates.
 Point createPoint(Position position)
          Creates a point at the specified position.
 Primitive createPrimitive(Envelope envelope)
          Returns an envelope as a primitive.
 Solid createSolid(SolidBoundary boundary)
          Constructs a solid by indicating its boundary as a collection of shells organized into a solid boundary.
 Surface createSurface(List<SurfacePatch> surfaces)
          Takes a list of surface patches with the appropriate side-toside relationships and creates a surface.
 Surface createSurface(SurfaceBoundary boundary)
          Constructs a surface by indicating its boundary as a collection of curves organized into the specified surface boundary.
 CoordinateReferenceSystem getCoordinateReferenceSystem()
          Returns the coordinate reference system in use for all primitive geometric objects to be created through this interface.
 

Method Detail

getCoordinateReferenceSystem

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


createPrimitive

Primitive createPrimitive(Envelope envelope)
Returns an envelope as a primitive. An envelope will often be used in query operations, and therefore must have a cast operation that returns a geometry. The actual return of the operation depends upon the dimension of the coordinate reference system and the extent of the envelope. In a 2D system, the primitive returned will be a surface (if the envelope does not collapse to a point or line). In 3D systems, the usual return is a solid.

EXAMPLE: In the case where the envelope is totally contained in the domain of validity of its coordinate reference system object, its associated primitive is the convex hull of the various permutations of the coordinates in the corners. For example, suppose that a particular envelope in 2D is defined as:
 lowerCorner = (x1, y1)
 upperCorner = (x2, y2)
(we ignore the CRS below, assuming that it is a global variable), then we can take the various permutations of the ordinate values to create a list of polygon corners:
 MultiPoint = { (x1, y1), (x1, y2), (x2, y1), (x2, y2) }
If we then apply the convex hull function to the multi point, we get a polygon as a surface. The extent of a polygon in 2D is totally defined by its boundary (internal surface patches are planar and do not need interior control points) which gives us a data type to represent surface in 2D:
 Ring = {
     LineString = { (x1, y1), (x1, y2), (x2, y2), (x2, y1), (x1, y1)}
 }
So that the surface boundary record contains the above-cited exterior ring, and an empty set of interior rings (convex sets have no "interior" holes).

UML identifier (constructor): GM_Primitive(GM_Envelope)

createDirectPosition

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


createPoint

Point createPoint(double[] coordinates)
Creates a point at the specified location specified by coordinates.


createPoint

Point createPoint(Position position)
Creates a point at the specified position.

UML identifier (constructor): GM_Point(GM_Position)

createCurve

Curve createCurve(List<CurveSegment> segments)
Takes a list of curve segments with the appropriate end-to-start relationships and creates a curve.

UML identifier (constructor): GM_Curve(GM_CurveSegment[1..n])

createSurface

Surface createSurface(List<SurfacePatch> surfaces)
Takes a list of surface patches with the appropriate side-toside relationships and creates a surface.

UML identifier (constructor): GM_Surface(GM_SurfacePatch[1..n])

createSurface

Surface createSurface(SurfaceBoundary boundary)
Constructs a surface by indicating its boundary as a collection of curves organized into the specified surface boundary. This method is guaranteed to work always in 2D coordinate spaces, In 3D coordinate spaces, this method shall require all of the defining boundary curve instances to be coplanar (lie in a single plane) which will define the surface interior.

UML identifier (constructor): GM_Surface(GM_SurfaceBoundary)

createSolid

Solid createSolid(SolidBoundary boundary)
Constructs a solid by indicating its boundary as a collection of shells organized into a solid boundary. Since this specification is limited to 3-dimensional coordinate reference systems, any solid is definable by its boundary.

UML identifier (constructor): GM_Solid(GM_SolidBoundary)

GeoAPI 1.0
Build 2004-05-18

Symbols, terms and definitions
Copyright OpenGIS® Consortium