|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The interface for managing spatial reference systems and transformations. It can be considered an abstract factory for both spatial reference systems and transformations.
A SRManager is normally associated with a particular (Oracle Spatial) database which stores definitions for commonly used spatial reference systems. SRManager can retrieve such spatial reference systems from the database using their SRID or Name.
SRManager can also create and store user-defined spatial reference systems in the database and make them accessible by assigning them permanent SRIDs and NAMEs.
SRManager also creates new SRS transformation (defined by the interface Transform) from given source and target spatial reference systems. A Transform object can be applied to geometries and transform them into the target spatial reference system.
Field Summary | |
static SpatialReference |
defaultCS
|
static SpatialReference |
defaultGCS
a default geographic coordinate system (lon/lat) based on the WGS84 datum |
static SpatialReference |
gcsWGS84
a geographic coordinate system (lon/lat) based on the WGS84 datum |
static SpatialReference |
nullSRS
|
Method Summary | |
SpatialReference |
create(java.lang.String wkt)
Constructs a spatial reference system from a well-known text string. |
GeographicCS |
createGeographicCS(int id,
java.lang.String name,
GeodeticDatum d,
PrimeMeridian pm,
AngularUnit unit)
Creates a new geographic coordinate system from given parameters. |
GeographicCS |
createGeographicCS(java.lang.String name,
GeodeticDatum d,
PrimeMeridian pm,
AngularUnit unit)
Creates a new geographic coordinate system from given parameters. |
NonEarthCS |
createNonEarthCS(java.lang.String name,
LinearUnit unit)
Creates a new non-Earth coordinate system. |
ProjectedCS |
createProjectedCS(int id,
java.lang.String name,
GeographicCS gcs,
Projection pj,
LinearUnit unit)
Creates a new projected coordinate system from given parameters. |
ProjectedCS |
createProjectedCS(java.lang.String name,
GeographicCS gcs,
Projection pj,
LinearUnit unit)
Creates a new projected coordinate system from given parameters. |
Transform |
createTransform(SpatialReference source,
SpatialReference target)
Creates a new SRS transformation operator that can be used to transform geometries from the source spatial reference system to the target spatial reference system. |
java.lang.String |
getWKT(SpatialReference sr)
Returns the well-known text format for the spatial reference system with the given SRID. |
GeographicCS |
initGeographicCS(int id,
java.lang.String name,
GeodeticDatum d,
PrimeMeridian pm,
AngularUnit unit,
GeographicCS gcs)
Initializes a new geographic coordinate system from given parameters. |
GeographicCS |
initGeographicCS(java.lang.String name,
GeodeticDatum d,
PrimeMeridian pm,
AngularUnit unit,
GeographicCS gcs)
Initializes a new geographic coordinate system from given parameters. |
NonEarthCS |
initNonEarthCS(java.lang.String name,
LinearUnit unit,
NonEarthCS ncs)
Initializes a new non-Earth coordinate system. |
ProjectedCS |
initProjectedCS(int id,
java.lang.String name,
GeographicCS gcs,
Projection pj,
LinearUnit unit,
ProjectedCS pcs)
Initializes a new projected coordinate system from given parameters. |
ProjectedCS |
initProjectedCS(java.lang.String name,
GeographicCS gcs,
Projection pj,
LinearUnit unit,
ProjectedCS pcs)
Initializes a new projected coordinate system from given parameters. |
int |
makePersistent(SpatialReference sr)
Stores the spatial reference system in database permanently. |
SpatialReference |
retrieve(int srid)
Retrieves a spatial reference from the database with a specified SRID. |
SpatialReference |
retrieve(java.lang.String name)
Retrieves parameters from the database for an SRS with a specified name. |
void |
setConnection(oracle.jdbc.OracleConnection conn)
Sets up the connection to the database (under user MDSYS or any user who has access to table MDSYS.CS_SRS). |
Field Detail |
public static final SpatialReference gcsWGS84
public static final SpatialReference nullSRS
public static final SpatialReference defaultGCS
public static final SpatialReference defaultCS
Method Detail |
public SpatialReference retrieve(java.lang.String name) throws SRException
public SpatialReference retrieve(int srid) throws SRException
public void setConnection(oracle.jdbc.OracleConnection conn)
retrieve
methods
to work.
Only supports Oracle 8i release 2 or a later version.public SpatialReference create(java.lang.String wkt) throws SRException
<geographic cs> ::= GEOGCS [ "<name>", <datum>, <prime meridian>, <angular unit> ] <datum> ::= DATUM [ "<name>", <sphereoid> ] <spheroid> ::= SPHEROID ["<name>", <semi major axis>, <inverse flattening> ] <prime meridian> ::= PRIMEM ["<name>", <longitude> ] <longitude> ::= <number> <semi-major axis> ::= <number> <inverse flattening> ::= <number> <projected cs> ::= PROJCS [ "<name>", <geographic cs>, <projection>, { <parameter>,}* <linear unit>
public GeographicCS createGeographicCS(java.lang.String name, GeodeticDatum d, PrimeMeridian pm, AngularUnit unit) throws SRException
name
- the string name to be used for the new spatial reference systemd
- the geodetic datum associated with this geographic coordinate system;
if null, GeodeticDatum.wgs84 is usedpm
- the prime meridian used;
if null, default to Greenwichunit
- the angular unit to be used;
if null, default to decimalDegree
public GeographicCS createGeographicCS(int id, java.lang.String name, GeodeticDatum d, PrimeMeridian pm, AngularUnit unit) throws SRException
id
- the SRID (integer) value used to identify the new spatial
reference systemname
- the string name to be used for the new spatial referenced
- the geodetic datum associated with this geographic coordinate system;
if null, GeodeticDatum.wgs84 is usedpm
- the prime meridian used;
if null, default to Greenwichunit
- the angular unit to be used;
if null, default to decimalDegree
public ProjectedCS createProjectedCS(java.lang.String name, GeographicCS gcs, Projection pj, LinearUnit unit) throws SRException
name
- the string name for the new projected coordinate systemgcs
- the base geographic coordinate systempj
- the map projection to be usedunit
- the linear unit to be used;
if null, default to meter
public ProjectedCS createProjectedCS(int id, java.lang.String name, GeographicCS gcs, Projection pj, LinearUnit unit) throws SRException
id
- the SRID (integer) value used to identify the new spatial
reference systemname
- the string name for the new projected coordinate systemgcs
- the base geographic coordinate systempj
- the map projection to be usedunit
- the linear unit to be used;
if null, default to meter
public NonEarthCS createNonEarthCS(java.lang.String name, LinearUnit unit) throws SRException
public GeographicCS initGeographicCS(java.lang.String name, GeodeticDatum d, PrimeMeridian pm, AngularUnit unit, GeographicCS gcs) throws SRException
name
- the string name to be used for the new spatial reference systemd
- the geodetic datum associated with this geographic coordinate system;
if null then GeodeticDatum.wgs84 is used.pm
- the prime meridian used;
if null then default to Greenwich.unit
- the angular unit to be used;
if null then default to decimalDegree
.gcs
- the geographic coordinate system instance to be initialized using supplied
parameter instancespublic GeographicCS initGeographicCS(int id, java.lang.String name, GeodeticDatum d, PrimeMeridian pm, AngularUnit unit, GeographicCS gcs) throws SRException
id
- the SRID (integer) value used to identify the new spatial
reference systemname
- the string name to be used for the new spatial referenced
- the geodetic datum associated with this GCS;
if null, GeodeticDatum.wgs84 is usedpm
- the prime meridian used;
if null, default to Greenwichunit
- the angular unit to be used;
if null, default to decimalDegree
gcs
- the geographic coordinate system instance to be initialized using supplied
parameter instancespublic ProjectedCS initProjectedCS(java.lang.String name, GeographicCS gcs, Projection pj, LinearUnit unit, ProjectedCS pcs) throws SRException
name
- the string name for the new projected coordinate systemgcs
- the base geographic coordinate systempj
- the map projection to be usedunit
- the linear unit to be used;
if null, default to meter
pcs
- the projected coordinate system instance that is initialized using
the supplied parameter values (name, gcs, pj, and unit)public ProjectedCS initProjectedCS(int id, java.lang.String name, GeographicCS gcs, Projection pj, LinearUnit unit, ProjectedCS pcs) throws SRException
id
- the SRID (integer) value used to identify the new spatial
referencename
- the string name for the new projected coordinate systemgcs
- the base geographic coordinate systempj
- the map projection to be usedunit
- the linear unit to be used;
if null, default to meter
pcs
- the projected coordinate system instance that is initialized using
the supplied parameter values (id, name, gcs, pj, and unit)public NonEarthCS initNonEarthCS(java.lang.String name, LinearUnit unit, NonEarthCS ncs) throws SRException
public int makePersistent(SpatialReference sr) throws SRException
public java.lang.String getWKT(SpatialReference sr)
public Transform createTransform(SpatialReference source, SpatialReference target) throws SRException
src
- the source spatial reference systemtarget
- the target spatial reference system
Users are expected to use the server side Transformation package
or their own implementation.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |