public abstract class ArcSDEGeometryBuilder extends Object
SeShape objects and vice versa.
SeShape's are gathered from an SeRow ArcSDE API's result object and
holds it's geometry attributes as a three dimensional array of double primitives as
explained bellow.
By this way, we avoid the creation of ArcSDE's java implementation of OGC geometries for later translation to JTS, avoiding too the dependency on the ArcSDE native library which the geometry package of the ArcSDE Java API depends on.
Given double [][][]coords the meaning of this array is as follow:
1
coords[0].
This abstract class will use specialized subclass for constructing the proper geometry type
| Modifier and Type | Method and Description |
|---|---|
static ArcSDEGeometryBuilder |
builderFor(Class<? extends Geometry> jtsGeometryClass)
Factory method that returns an instance of
ArcSDEGeometryBuilder specialized in
contructing JTS geometries of the JTS Geometry class passed as argument. |
Geometry |
construct(SeShape shape,
GeometryFactory geometryFactory)
Takes an ArcSDE's
SeShape and builds a JTS Geometry. |
SeShape |
constructShape(Geometry geometry,
SeCoordinateReference seSrs)
Creates the ArcSDE Java API representation of a
Geometry object in its shape
format, suitable to filter expressions as the SDE API expects |
static Geometry |
defaultValueFor(Class<?> geoClass)
Create an empty geometry for the indicated class
|
protected Geometry |
getEmpty()
returns an empty JTS geometry who's type is given by the
ArcSDEGeometryBuilder
subclass instance specialization that implements it. |
protected abstract Geometry |
newGeometry(double[][][] coords,
GeometryFactory geometryFactory)
Builds a JTS Geometry who't type is given by the
ArcSDEGeometryBuilder subclass
instance specialization that implements it |
protected CoordinateSequence |
toCoords(double[] coordList,
CoordinateSequenceFactory csFact)
Builds an array of JTS
Coordinate instances that's geometrically equals to the
SeShape single coordinates array passed as argument. |
protected SDEPoint[] |
toPointsArray(Coordinate[] coords) |
public Geometry construct(SeShape shape,
GeometryFactory geometryFactory)
throws SeException,
DataSourceException
SeShape and builds a JTS Geometry. The geometry type
constructed depends on this ArcSDEGeometryBuilder specialized subclassshape - the ESRI's ArcSDE java api shape upon wich to create the new JTS geometrygeometryFactory - shape.isNil()SeException - if it occurs fetching the coordinates array from shapeDataSourceException - if the org.locationtech.jts.geom.GeometryFactory
this builder is backed by can't create the org.locationtech.jts.geom.Geometry
with the org.locationtech.jts.geom.Coordinate[] provided by
newGeometrypublic final SeShape constructShape(Geometry geometry,
SeCoordinateReference seSrs)
throws ArcSdeException
Geometry object in its shape
format, suitable to filter expressions as the SDE API expectsgeometry - the JTS Geometry object to get the SDE representation fromseSrs - Coordinate Reference System of the underlying SeLayer object for
wich the SeShape is constructed.SeShape representation of passed GeometryArcSDEGeometryBuildingExceptionArcSdeExceptionprotected abstract Geometry newGeometry(double[][][] coords,
GeometryFactory geometryFactory)
throws DataSourceException
ArcSDEGeometryBuilder subclass
instance specialization that implements itcoords - SeShape's coordinate array to build the geometry fromgeometryFactory - DataSourceException - if an error occurs while creating the JTS Geometryprotected Geometry getEmpty()
ArcSDEGeometryBuilder
subclass instance specialization that implements it.
this method is called in case that SeShape.isNil() == true
UnsupportedOperationExceptionprotected final CoordinateSequence toCoords(double[] coordList,
CoordinateSequenceFactory csFact)
Coordinate instances that's geometrically equals to the
SeShape single coordinates array passed as argument.coordList - array of coordinates of a single shape part to build a Coordinate
fromcoordList array of Coordinate
instancesprotected SDEPoint[] toPointsArray(Coordinate[] coords)
public static ArcSDEGeometryBuilder builderFor(Class<? extends Geometry> jtsGeometryClass) throws IllegalArgumentException
ArcSDEGeometryBuilder specialized in
contructing JTS geometries of the JTS Geometry class passed as argument. Note that
jtsGeometryClass must be one of the supported concrete JTS Geometry classes.jtsGeometryClass - IllegalArgumentException - if jtsGeometryClass is not a concrete JTS
Geometry class (like org.locationtech.jts.geom.MultiPoint.class
i.e.)public static Geometry defaultValueFor(Class<?> geoClass)
Copyright © 1996–2019 Geotools. All rights reserved.