oracle.sdoapi.sref
Interface SRManager


public interface SRManager

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

gcsWGS84

public static final SpatialReference gcsWGS84
a geographic coordinate system (lon/lat) based on the WGS84 datum

nullSRS

public static final SpatialReference nullSRS

defaultGCS

public static final SpatialReference defaultGCS
a default geographic coordinate system (lon/lat) based on the WGS84 datum

defaultCS

public static final SpatialReference defaultCS
Method Detail

retrieve

public SpatialReference retrieve(java.lang.String name)
                          throws SRException
Retrieves parameters from the database for an SRS with a specified name. You must first set the connection (setConnection) to the database where the table CS_SRS is stored. Oracle8i release 2 (8.1.6) or later only.

retrieve

public SpatialReference retrieve(int srid)
                          throws SRException
Retrieves a spatial reference from the database with a specified SRID. You must first set the connection (setConnection) to the database where so that the table CS_SRS is accessible. Oracle8i release 2 (8.1.6) or later only.

setConnection

public 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). This is necessary for the two retrieve methods to work. Only supports Oracle 8i release 2 or a later version.

create

public SpatialReference create(java.lang.String wkt)
                        throws SRException
Constructs a spatial reference system from a well-known text string. A new SRID will be assigned to the spatial reference if no existing spatial reference system matches exactly the well-known text definition. The well-known text has the following format:
	<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>
 

createGeographicCS

public GeographicCS createGeographicCS(java.lang.String name,
                                       GeodeticDatum d,
                                       PrimeMeridian pm,
                                       AngularUnit unit)
                                throws SRException
Creates a new geographic coordinate system from given parameters.
Parameters:
name - the string name to be used for the new spatial reference system
d - the geodetic datum associated with this geographic coordinate system; if null, GeodeticDatum.wgs84 is used
pm - the prime meridian used; if null, default to Greenwich
unit - the angular unit to be used; if null, default to decimalDegree

createGeographicCS

public GeographicCS createGeographicCS(int id,
                                       java.lang.String name,
                                       GeodeticDatum d,
                                       PrimeMeridian pm,
                                       AngularUnit unit)
                                throws SRException
Creates a new geographic coordinate system from given parameters.
Parameters:
id - the SRID (integer) value used to identify the new spatial reference system
name - the string name to be used for the new spatial reference
d - the geodetic datum associated with this geographic coordinate system; if null, GeodeticDatum.wgs84 is used
pm - the prime meridian used; if null, default to Greenwich
unit - the angular unit to be used; if null, default to decimalDegree

createProjectedCS

public ProjectedCS createProjectedCS(java.lang.String name,
                                     GeographicCS gcs,
                                     Projection pj,
                                     LinearUnit unit)
                              throws SRException
Creates a new projected coordinate system from given parameters.
Parameters:
name - the string name for the new projected coordinate system
gcs - the base geographic coordinate system
pj - the map projection to be used
unit - the linear unit to be used; if null, default to meter

createProjectedCS

public ProjectedCS createProjectedCS(int id,
                                     java.lang.String name,
                                     GeographicCS gcs,
                                     Projection pj,
                                     LinearUnit unit)
                              throws SRException
Creates a new projected coordinate system from given parameters.
Parameters:
id - the SRID (integer) value used to identify the new spatial reference system
name - the string name for the new projected coordinate system
gcs - the base geographic coordinate system
pj - the map projection to be used
unit - the linear unit to be used; if null, default to meter

createNonEarthCS

public NonEarthCS createNonEarthCS(java.lang.String name,
                                   LinearUnit unit)
                            throws SRException
Creates a new non-Earth coordinate system.

initGeographicCS

public GeographicCS initGeographicCS(java.lang.String name,
                                     GeodeticDatum d,
                                     PrimeMeridian pm,
                                     AngularUnit unit,
                                     GeographicCS gcs)
                              throws SRException
Initializes a new geographic coordinate system from given parameters.
Parameters:
name - the string name to be used for the new spatial reference system
d - 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 instances

initGeographicCS

public GeographicCS initGeographicCS(int id,
                                     java.lang.String name,
                                     GeodeticDatum d,
                                     PrimeMeridian pm,
                                     AngularUnit unit,
                                     GeographicCS gcs)
                              throws SRException
Initializes a new geographic coordinate system from given parameters.
Parameters:
id - the SRID (integer) value used to identify the new spatial reference system
name - the string name to be used for the new spatial reference
d - the geodetic datum associated with this GCS; if null, GeodeticDatum.wgs84 is used
pm - the prime meridian used; if null, default to Greenwich
unit - the angular unit to be used; if null, default to decimalDegree
gcs - the geographic coordinate system instance to be initialized using supplied parameter instances

initProjectedCS

public ProjectedCS initProjectedCS(java.lang.String name,
                                   GeographicCS gcs,
                                   Projection pj,
                                   LinearUnit unit,
                                   ProjectedCS pcs)
                            throws SRException
Initializes a new projected coordinate system from given parameters.
Parameters:
name - the string name for the new projected coordinate system
gcs - the base geographic coordinate system
pj - the map projection to be used
unit - 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)

initProjectedCS

public ProjectedCS initProjectedCS(int id,
                                   java.lang.String name,
                                   GeographicCS gcs,
                                   Projection pj,
                                   LinearUnit unit,
                                   ProjectedCS pcs)
                            throws SRException
Initializes a new projected coordinate system from given parameters.
Parameters:
id - the SRID (integer) value used to identify the new spatial reference
name - the string name for the new projected coordinate system
gcs - the base geographic coordinate system
pj - the map projection to be used
unit - 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)

initNonEarthCS

public NonEarthCS initNonEarthCS(java.lang.String name,
                                 LinearUnit unit,
                                 NonEarthCS ncs)
                          throws SRException
Initializes a new non-Earth coordinate system. Not supported in current (8.1.6) release.

makePersistent

public int makePersistent(SpatialReference sr)
                   throws SRException
Stores the spatial reference system in database permanently.
Returns:
the new srid assigned by the server

getWKT

public java.lang.String getWKT(SpatialReference sr)
Returns the well-known text format for the spatial reference system with the given SRID.

createTransform

public Transform createTransform(SpatialReference source,
                                 SpatialReference target)
                          throws SRException
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.
Parameters:
src - the source spatial reference system
target - the target spatial reference system Users are expected to use the server side Transformation package or their own implementation.