java.lang.Cloneable
public class SpatialReference
extends java.lang.Object
implements java.lang.Cloneable
The SpatialReference class is a binding for the C++ OGRSpatialReference class.
Normally application code can fetch needed parameter values for this SRS using GetAttrValue(), but in special cases the underlying parse tree (or OGR_SRSNode objects) can be accessed more directly.
See the tutorial for more information on how to use this class.
Constructor | Description |
---|---|
SpatialReference() |
Constructor.
|
SpatialReference(java.lang.String wkt) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
__str__() |
Convert this SRS into a pretty WKT format.
|
int |
AddGuessedTOWGS84() |
|
int |
AutoIdentifyEPSG() |
Set EPSG authority info if possible.
|
java.lang.Object |
clone() |
|
SpatialReference |
Clone() |
Make a duplicate of this SpatialReference object.
|
SpatialReference |
CloneGeogCS() |
Make a duplicate of the GEOGCS node of this SpatialReference object.
|
SpatialReference |
ConvertToOtherProjection(java.lang.String other_projection) |
|
SpatialReference |
ConvertToOtherProjection(java.lang.String other_projection,
java.util.Vector options) |
|
int |
CopyGeogCSFrom(SpatialReference src_srs) |
Copy GEOGCS from another OGRSpatialReference.
|
void |
delete() |
|
int |
DemoteTo2D() |
|
int |
DemoteTo2D(java.lang.String name) |
|
int |
EPSGTreatsAsLatLong() |
This method returns TRUE if EPSG feels this geographic coordinate
system should be treated as having lat/long coordinate ordering.
|
int |
EPSGTreatsAsNorthingEasting() |
|
boolean |
equals(java.lang.Object obj) |
|
java.lang.String |
ExportToMICoordSys() |
Export coordinate system in Mapinfo style CoordSys format.
|
int |
ExportToMICoordSys(java.lang.String[] argout) |
Export coordinate system in Mapinfo style CoordSys format.
|
int |
ExportToPCI(java.lang.String[] proj,
java.lang.String[] units,
double[] parms) |
Export coordinate system in PCI projection definition.
|
java.lang.String |
ExportToPrettyWkt() |
Convert this SRS into a nicely formatted WKT string for display to a person.
|
java.lang.String |
ExportToPrettyWkt(int simplify) |
Convert this SRS into a nicely formatted WKT string for display to a person.
|
int |
ExportToPrettyWkt(java.lang.String[] argout) |
Convert this SRS into a nicely formatted WKT string for display to a person.
|
int |
ExportToPrettyWkt(java.lang.String[] argout,
int simplify) |
Convert this SRS into a nicely formatted WKT string for display to a person.
|
java.lang.String |
ExportToProj4() |
Export coordinate system in PROJ.4 format.
|
int |
ExportToProj4(java.lang.String[] argout) |
Export coordinate system in PROJ.4 format.
|
int |
ExportToPROJJSON(java.lang.String[] argout) |
|
int |
ExportToPROJJSON(java.lang.String[] argout,
java.util.Vector options) |
|
int |
ExportToUSGS(int[] projsys,
int[] zone,
double[] parms,
int[] datum) |
Export coordinate system in USGS GCTP projection definition.
|
java.lang.String |
ExportToWkt() |
Convert this SRS into WKT format.
|
int |
ExportToWkt(java.lang.String[] argout) |
Convert this SRS into WKT format.
|
int |
ExportToWkt(java.lang.String[] argout,
java.util.Vector options) |
|
java.lang.String |
ExportToXML() |
Export coordinate system in XML format.
|
java.lang.String |
ExportToXML(java.lang.String dialect) |
Export coordinate system in XML format.
|
int |
ExportToXML(java.lang.String[] argout) |
Export coordinate system in XML format.
|
int |
ExportToXML(java.lang.String[] argout,
java.lang.String dialect) |
Export coordinate system in XML format.
|
double |
GetAngularUnits() |
Fetch angular geographic coordinate system units.
|
java.lang.String |
GetAngularUnitsName() |
Fetch angular geographic coordinate system units name.
|
AreaOfUse |
GetAreaOfUse() |
|
java.lang.String |
GetAttrValue(java.lang.String name) |
Fetch first attribute of named node.
|
java.lang.String |
GetAttrValue(java.lang.String name,
int child) |
Fetch indicated attribute of named node.
|
java.lang.String |
GetAuthorityCode(java.lang.String target_key) |
Get the authority code for a node.
|
java.lang.String |
GetAuthorityName(java.lang.String target_key) |
Get the authority name for a node.
|
int |
GetAxesCount() |
|
int |
GetAxisMappingStrategy() |
|
java.lang.String |
GetAxisName(java.lang.String target_key,
int iAxis) |
Get the axis name for a node.
|
int |
GetAxisOrientation(java.lang.String target_key,
int iAxis) |
Get the axis orientation for a node.
|
int[] |
GetDataAxisToSRSAxisMapping(SWIGTYPE_p_int nLen,
SWIGTYPE_p_p_int pList) |
|
double |
GetInvFlattening() |
|
double |
GetLinearUnits() |
Fetch linear projection units.
|
java.lang.String |
GetLinearUnitsName() |
Fetch linear projection units name.
|
java.lang.String |
GetName() |
|
double |
GetNormProjParm(java.lang.String name) |
Fetch a normalized projection parameter value.
|
double |
GetNormProjParm(java.lang.String name,
double default_val) |
Fetch a normalized projection parameter value.
|
double |
GetProjParm(java.lang.String name) |
Fetch a projection parameter value.
|
double |
GetProjParm(java.lang.String name,
double default_val) |
Fetch a projection parameter value.
|
double |
GetSemiMajor() |
|
double |
GetSemiMinor() |
|
double |
GetTargetLinearUnits(java.lang.String target_key) |
|
double[] |
GetTOWGS84() |
Fetch TOWGS84 parameters, if available.
|
int |
GetTOWGS84(double[] argout) |
Fetch TOWGS84 parameters, if available.
|
int |
GetUTMZone() |
Get UTM zone information.
|
int |
hashCode() |
|
boolean |
HasTOWGS84() |
|
int |
ImportFromEPSG(int nCode) |
Initialize SRS based on EPSG GCS or PCS code.
|
int |
ImportFromEPSGA(int arg) |
|
int |
ImportFromERM(java.lang.String proj,
java.lang.String datum,
java.lang.String units) |
|
int |
ImportFromESRI(java.util.Vector ppszInput) |
Import coordinate system from ESRI .prj format(s).
|
int |
ImportFromMICoordSys(java.lang.String coord_sys) |
Import Mapinfo style CoordSys definition.
|
int |
ImportFromOzi(java.util.Vector papszLines) |
|
int |
ImportFromPCI(java.lang.String proj) |
Import coordinate system from PCI projection definition.
|
int |
ImportFromPCI(java.lang.String proj,
java.lang.String units) |
Import coordinate system from PCI projection definition.
|
int |
ImportFromPCI(java.lang.String proj,
java.lang.String units,
double[] prjParams) |
Import coordinate system from PCI projection definition.
|
int |
ImportFromProj4(java.lang.String proj4) |
Import PROJ.4 coordinate string.
|
int |
ImportFromUrl(java.lang.String url) |
Set spatial reference from a URL.
|
int |
ImportFromUSGS(int iProjSys) |
Import coordinate system from USGS projection definition.
|
int |
ImportFromUSGS(int iProjSys,
int iZone) |
Import coordinate system from USGS projection definition.
|
int |
ImportFromUSGS(int iProjSys,
int iZone,
double[] padfPrjParams) |
Import coordinate system from USGS projection definition.
|
int |
ImportFromUSGS(int iProjSys,
int iZone,
double[] padfPrjParams,
int iDatum) |
Import coordinate system from USGS projection definition.
|
int |
ImportFromWkt(java.lang.String wkt) |
Import from WKT string.
|
int |
ImportFromXML(java.lang.String xmlString) |
Import coordinate system from XML format (GML only currently).
|
int |
IsCompound() |
Check if coordinate system is compound.
|
int |
IsDerivedGeographic() |
|
int |
IsGeocentric() |
Check if geocentric coordinate system.
|
int |
IsGeographic() |
Check if geographic coordinate system.
|
int |
IsLocal() |
Check if local coordinate system.
|
int |
IsProjected() |
Check if projected coordinate system.
|
int |
IsSame(SpatialReference other) |
Do these two spatial references describe the same system ?
|
int |
IsSame(SpatialReference rhs,
java.util.Vector options) |
|
int |
IsSameGeogCS(SpatialReference other) |
Do the GeogCS'es match?
|
int |
IsSameVertCS(SpatialReference other) |
Do the VertCS'es match?
|
int |
IsVertical() |
Check if vertical coordinate system.
|
int |
MorphFromESRI() |
Convert in place from ESRI WKT format.
|
int |
MorphToESRI() |
Convert in place to ESRI WKT format.
|
int |
PromoteTo3D() |
|
int |
PromoteTo3D(java.lang.String name) |
|
int |
SetACEA(double stdp1,
double stdp2,
double clat,
double clong,
double fe,
double fn) |
|
int |
SetAE(double clat,
double clong,
double fe,
double fn) |
|
int |
SetAngularUnits(java.lang.String name,
double to_radians) |
Set the angular units for the geographic coordinate system.
|
int |
SetAttrValue(java.lang.String name,
java.lang.String value) |
Set attribute value in spatial reference.
|
int |
SetAuthority(java.lang.String target_key,
java.lang.String authority,
int code) |
Set the authority for a node.
|
void |
SetAxisMappingStrategy(int strategy) |
|
int |
SetBonne(double stdp,
double cm,
double fe,
double fn) |
|
int |
SetCEA(double stdp1,
double cm,
double fe,
double fn) |
|
int |
SetCompoundCS(java.lang.String name,
SpatialReference horizcs,
SpatialReference vertcs) |
|
int |
SetCS(double clat,
double clong,
double fe,
double fn) |
|
int |
SetDataAxisToSRSAxisMapping(int[] nList) |
|
int |
SetEC(double stdp1,
double stdp2,
double clat,
double clong,
double fe,
double fn) |
|
int |
SetEckertIV(double cm,
double fe,
double fn) |
|
int |
SetEckertVI(double cm,
double fe,
double fn) |
|
int |
SetEquirectangular(double clat,
double clong,
double fe,
double fn) |
|
int |
SetEquirectangular2(double clat,
double clong,
double pseudostdparallellat,
double fe,
double fn) |
|
int |
SetFromUserInput(java.lang.String definition) |
Set spatial reference from various text formats.
|
int |
SetGaussSchreiberTMercator(double clat,
double clong,
double sc,
double fe,
double fn) |
|
int |
SetGeocCS() |
Set the user visible GEOCCS name.
|
int |
SetGeocCS(java.lang.String name) |
Set the user visible GEOCCS name.
|
int |
SetGeogCS(java.lang.String pszGeogName,
java.lang.String pszDatumName,
java.lang.String pszSpheroidName,
double dfSemiMajor,
double dfInvFlattening) |
Set geographic coordinate system.
|
int |
SetGeogCS(java.lang.String pszGeogName,
java.lang.String pszDatumName,
java.lang.String pszSpheroidName,
double dfSemiMajor,
double dfInvFlattening,
java.lang.String pszPMName) |
Set geographic coordinate system.
|
int |
SetGeogCS(java.lang.String pszGeogName,
java.lang.String pszDatumName,
java.lang.String pszSpheroidName,
double dfSemiMajor,
double dfInvFlattening,
java.lang.String pszPMName,
double dfPMOffset) |
Set geographic coordinate system.
|
int |
SetGeogCS(java.lang.String pszGeogName,
java.lang.String pszDatumName,
java.lang.String pszSpheroidName,
double dfSemiMajor,
double dfInvFlattening,
java.lang.String pszPMName,
double dfPMOffset,
java.lang.String pszAngularUnits) |
Set geographic coordinate system.
|
int |
SetGeogCS(java.lang.String pszGeogName,
java.lang.String pszDatumName,
java.lang.String pszSpheroidName,
double dfSemiMajor,
double dfInvFlattening,
java.lang.String pszPMName,
double dfPMOffset,
java.lang.String pszAngularUnits,
double dfConvertToRadians) |
Set geographic coordinate system.
|
int |
SetGEOS(double cm,
double satelliteheight,
double fe,
double fn) |
|
int |
SetGH(double cm,
double fe,
double fn) |
|
int |
SetGnomonic(double clat,
double clong,
double fe,
double fn) |
|
int |
SetGS(double cm,
double fe,
double fn) |
|
int |
SetHOM(double clat,
double clong,
double azimuth,
double recttoskew,
double scale,
double fe,
double fn) |
|
int |
SetHOM2PNO(double clat,
double dfLat1,
double dfLong1,
double dfLat2,
double dfLong2,
double scale,
double fe,
double fn) |
|
int |
SetIGH() |
|
int |
SetKrovak(double clat,
double clong,
double azimuth,
double pseudostdparallellat,
double scale,
double fe,
double fn) |
|
int |
SetLAEA(double clat,
double clong,
double fe,
double fn) |
|
int |
SetLCC(double stdp1,
double stdp2,
double clat,
double clong,
double fe,
double fn) |
|
int |
SetLCC1SP(double clat,
double clong,
double scale,
double fe,
double fn) |
|
int |
SetLCCB(double stdp1,
double stdp2,
double clat,
double clong,
double fe,
double fn) |
|
int |
SetLinearUnits(java.lang.String name,
double to_meters) |
Set the linear units for the projection.
|
int |
SetLinearUnitsAndUpdateParameters(java.lang.String name,
double to_meters) |
Set the linear units for the projection.
|
int |
SetLocalCS(java.lang.String name) |
Set the user visible LOCAL_CS name.
|
int |
SetMC(double clat,
double clong,
double fe,
double fn) |
|
int |
SetMercator(double clat,
double clong,
double scale,
double fe,
double fn) |
|
int |
SetMercator2SP(double stdp1,
double clat,
double clong,
double fe,
double fn) |
|
int |
SetMollweide(double cm,
double fe,
double fn) |
|
int |
SetNormProjParm(java.lang.String name,
double val) |
Set a projection parameter with a normalized value.
|
int |
SetNZMG(double clat,
double clong,
double fe,
double fn) |
|
int |
SetOrthographic(double clat,
double clong,
double fe,
double fn) |
|
int |
SetOS(double dfOriginLat,
double dfCMeridian,
double scale,
double fe,
double fn) |
|
int |
SetPolyconic(double clat,
double clong,
double fe,
double fn) |
|
int |
SetProjCS() |
Set the user visible PROJCS name.
|
int |
SetProjCS(java.lang.String name) |
Set the user visible PROJCS name.
|
int |
SetProjection(java.lang.String name) |
Set a projection name.
|
int |
SetProjParm(java.lang.String name,
double val) |
Set a projection parameter value.
|
int |
SetPS(double clat,
double clong,
double scale,
double fe,
double fn) |
|
int |
SetRobinson(double clong,
double fe,
double fn) |
|
int |
SetSinusoidal(double clong,
double fe,
double fn) |
|
int |
SetSOC(double latitudeoforigin,
double cm,
double fe,
double fn) |
|
int |
SetStatePlane(int zone) |
Set State Plane projection definition.
|
int |
SetStatePlane(int zone,
int is_nad83) |
Set State Plane projection definition.
|
int |
SetStatePlane(int zone,
int is_nad83,
java.lang.String unitsname) |
Set State Plane projection definition.
|
int |
SetStatePlane(int zone,
int is_nad83,
java.lang.String unitsname,
double units) |
Set State Plane projection definition.
|
int |
SetStereographic(double clat,
double clong,
double scale,
double fe,
double fn) |
|
int |
SetTargetLinearUnits(java.lang.String target,
java.lang.String name,
double to_meters) |
Set the linear units for the projection.
|
int |
SetTM(double clat,
double clong,
double scale,
double fe,
double fn) |
|
int |
SetTMG(double clat,
double clong,
double fe,
double fn) |
|
int |
SetTMSO(double clat,
double clong,
double scale,
double fe,
double fn) |
|
int |
SetTMVariant(java.lang.String pszVariantName,
double clat,
double clong,
double scale,
double fe,
double fn) |
|
int |
SetTOWGS84(double p1,
double p2,
double p3) |
Set the Bursa-Wolf conversion to WGS84.
|
int |
SetTOWGS84(double dfDX,
double dfDY,
double dfDZ,
double dfEX,
double dfEY,
double dfEZ,
double dfPPM) |
Set the Bursa-Wolf conversion to WGS84.
|
int |
SetUTM(int zone) |
Set UTM projection definition.
|
int |
SetUTM(int zone,
int north) |
Set UTM projection definition.
|
int |
SetVDG(double clong,
double fe,
double fn) |
|
int |
SetVertCS() |
|
int |
SetVertCS(java.lang.String VertCSName) |
|
int |
SetVertCS(java.lang.String VertCSName,
java.lang.String VertDatumName) |
|
int |
SetVertCS(java.lang.String VertCSName,
java.lang.String VertDatumName,
int VertDatumType) |
Set the user visible VERT_CS name.
|
int |
SetVerticalPerspective(double topoOriginLat,
double topoOriginLon,
double topoOriginHeight,
double viewPointHeight,
double fe,
double fn) |
|
int |
SetWellKnownGeogCS(java.lang.String name) |
Set a GeogCS based on well known name.
|
java.lang.String |
toString() |
Convert this SRS into a pretty WKT format.
|
int |
Validate() |
Validate SRS tokens.
|
public SpatialReference(java.lang.String wkt)
This constructor takes an optional string argument which if passed should be a WKT representation of an SRS. Passing this is equivalent to not passing it, and then calling importFromWkt() with the WKT string.
Note that newly created objects are given a reference count of one.
wkt
- well known text definition to which the object should
be initialized, or null (the default).public SpatialReference()
Same as below with wkt == null.
SpatialReference(String wkt)
public void delete()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String ExportToWkt()
Same as below but the string is returned as a return value
ExportToWkt(String[] argout)
public java.lang.String ExportToPrettyWkt(int simplify)
Same as below but the string is returned as a return value
ExportToPrettyWkt(String[] argout, int simplify)
public java.lang.String ExportToPrettyWkt()
Same as below with simplify == 0 and the string is returned as a return value
ExportToPrettyWkt(String[] argout, int simplify)
public java.lang.String ExportToProj4()
Same as below but the string is returned as a return value
ExportToProj4(String[] argout)
public java.lang.String ExportToXML(java.lang.String dialect)
ExportToXML(String[] argout, String dialect)
public java.lang.String ExportToXML()
ExportToXML(String[] argout, String dialect)
public java.lang.String ExportToMICoordSys()
public double[] GetTOWGS84()
public int SetTOWGS84(double p1, double p2, double p3)
Same as below with dfEX == dfEY == dfEZ == dfPPM == 0
SetTOWGS84(double dfDX, double dfDY, double dfDZ, double dfEX, double dfEY, double dfEZ, double dfPPM)
public java.lang.String __str__()
public java.lang.String GetName()
public int IsSame(SpatialReference rhs, java.util.Vector options)
public int IsSame(SpatialReference other)
other
- the SRS being compared to.public int IsSameGeogCS(SpatialReference other)
other
- the SRS being compared against.public int IsSameVertCS(SpatialReference other)
other
- the SRS being compared against.public int IsGeographic()
public int IsDerivedGeographic()
public int IsProjected()
public int IsCompound()
public int IsGeocentric()
public int IsLocal()
public int IsVertical()
public int EPSGTreatsAsLatLong()
Currently this returns TRUE for all geographic coordinate systems with an EPSG code set, and AXIS values set defining it as lat, long. Note that coordinate systems with an EPSG code and no axis settings will be assumed to not be lat/long.
FALSE will be returned for all coordinate systems that are not geographic, or that do not have an EPSG code set.
public int EPSGTreatsAsNorthingEasting()
public int SetAuthority(java.lang.String target_key, java.lang.String authority, int code)
target_key
- the partial or complete path to the node to
set an authority on. i.e. "PROJCS", "GEOGCS" or "GEOGCS|UNIT".authority
- authority name, such as "EPSG".code
- code for value with this authority.public java.lang.String GetAttrValue(java.lang.String name, int child)
This method uses GetAttrNode() to find the named node, and then extracts the value of the indicated child. Thus a call to GetAttrValue("UNIT",1) would return the second child of the UNIT node, which is normally the length of the linear unit in meters.
name
- the tree node to look for (case insensitive).child
- the child of the node to fetch (zero based).public java.lang.String GetAttrValue(java.lang.String name)
This method uses GetAttrNode() to find the named node, and then extracts the value of the first child.
name
- the tree node to look for (case insensitive).public int SetAttrValue(java.lang.String name, java.lang.String value)
Missing intermediate nodes in the path will be created if not already in existence. If the attribute has no children one will be created and assigned the value otherwise the zeroth child will be assigned the value.
name
- full path to attribute to be set. For instance
"PROJCS|GEOGCS|UNITS".value
- value to be assigned to node, such as "meter".
This may be null if you just want to force creation of the intermediate
path.public int SetAngularUnits(java.lang.String name, double to_radians)
This method creates a UNITS subnode with the specified values as a child of the GEOGCS node.
name
- the units name to be used. Some preferred units
names can be found in ogr_srs_api.h such as SRS_UA_DEGREE.to_radians
- the value to multiple by an angle in the indicated
units to transform to radians. Some standard conversion factors can
be found in ogr_srs_api.h.public double GetAngularUnits()
If no units are available, a value of SRS_UA_DEGREE_CONV will be assumed. This method only checks directly under the GEOGCS node for units.
public java.lang.String GetAngularUnitsName()
If no units are available, a value of "degree" will be assumed. This method only checks directly under the GEOGCS node for units.
public int SetTargetLinearUnits(java.lang.String target, java.lang.String name, double to_meters)
This method creates a UNIT subnode with the specified values as a child of the target node.
target
- the keyword to set the linear units for. i.e. "PROJCS" or "VERT_CS"name
- the units name to be used. Some preferred units
names can be found in ogr_srs_api.h such as SRS_UL_METER, SRS_UL_FOOT
and SRS_UL_US_FOOT.to_meters
- the value to multiple by a length in the indicated
units to transform to meters. Some standard conversion factors can
be found in ogr_srs_api.h.public int SetLinearUnits(java.lang.String name, double to_meters)
This method creates a UNITS subnode with the specified values as a child of the PROJCS or LOCAL_CS node.
name
- the units name to be used. Some preferred units
names can be found in ogr_srs_api.h such as SRS_UL_METER, SRS_UL_FOOT
and SRS_UL_US_FOOT.to_meters
- the value to multiple by a length in the indicated
units to transform to meters. Some standard conversion factors can
be found in ogr_srs_api.h.public int SetLinearUnitsAndUpdateParameters(java.lang.String name, double to_meters)
This method creates a UNITS subnode with the specified values as a child of the PROJCS or LOCAL_CS node. It works the same as the SetLinearUnits() method, but it also updates all existing linear projection parameter values from the old units to the new units.
name
- the units name to be used. Some preferred units
names can be found in ogr_srs_api.h such as SRS_UL_METER, SRS_UL_FOOT
and SRS_UL_US_FOOT.to_meters
- the value to multiple by a length in the indicated
units to transform to meters. Some standard conversion factors can
be found in ogr_srs_api.h.public double GetTargetLinearUnits(java.lang.String target_key)
public double GetLinearUnits()
If no units are available, a value of "Meters" and 1.0 will be assumed. This method only checks directly under the PROJCS or LOCAL_CS node for units.
public java.lang.String GetLinearUnitsName()
If no units are available, a value of "Meters" will be assumed. This method only checks directly under the PROJCS or LOCAL_CS node for units.
public java.lang.String GetAuthorityCode(java.lang.String target_key)
This method is used to query an AUTHORITY[] node from within the WKT tree, and fetch the code value.
While in theory values may be non-numeric, for the EPSG authority all code values should be integral.
target_key
- the partial or complete path to the node to
get an authority from. i.e. "PROJCS", "GEOGCS", "GEOGCS|UNIT" or null to
search for an authority node on the root element.public java.lang.String GetAuthorityName(java.lang.String target_key)
This method is used to query an AUTHORITY[] node from within the WKT tree, and fetch the authority name value.
The most common authority is "EPSG".
target_key
- the partial or complete path to the node to
get an authority from. i.e. "PROJCS", "GEOGCS", "GEOGCS|UNIT" or null to
search for an authority node on the root element.public AreaOfUse GetAreaOfUse()
public java.lang.String GetAxisName(java.lang.String target_key, int iAxis)
This method is used to query an AXIS[] node from within the WKT tree, and fetch the axis name value.
target_key
- the partial or complete path to the node to
get an authority from. i.e. "PROJCS", "GEOGCS" or null to
search for an authority node on the root element.iAxis
- axis index (starting with 0)public int GetAxesCount()
public int GetAxisOrientation(java.lang.String target_key, int iAxis)
This method is used to query an AXIS[] node from within the WKT tree, and fetch the axis orientation value.
target_key
- the partial or complete path to the node to
get an authority from. i.e. "PROJCS", "GEOGCS" or null to
search for an authority node on the root element.iAxis
- axis index (starting with 0)public int GetAxisMappingStrategy()
public void SetAxisMappingStrategy(int strategy)
public int[] GetDataAxisToSRSAxisMapping(SWIGTYPE_p_int nLen, SWIGTYPE_p_p_int pList)
public int SetDataAxisToSRSAxisMapping(int[] nList)
public int SetUTM(int zone, int north)
This will generate a projection definition with the full set of transverse mercator projection parameters for the given UTM zone. If no PROJCS[] description is set yet, one will be set to look like "UTM Zone %d, {Northern, Southern} Hemisphere".
zone
- UTM zone.north
- 1 for northern hemisphere, or 0 for southern
hemisphere.public int SetUTM(int zone)
Same as below with north == 1
SetUTM(int zone, int north)
public int GetUTMZone()
public int SetStatePlane(int zone, int is_nad83, java.lang.String unitsname, double units)
This will attempt to generate a complete definition of a state plane zone based on generating the entire SRS from the EPSG tables. If the EPSG tables are unavailable, it will produce a stubbed LOCAL_CS definition and return OGRERR_FAILURE.
zone
- State plane zone number, in the USGS numbering scheme (as
distinct from the Arc/Info and Erdas numbering scheme.is_nad83
- 1 if the NAD83 zone definition should be used or 0
if the NAD27 zone definition should be used.unitsname
- Linear unit name to apply overriding the
legal definition for this zone.units
- Linear unit conversion factor to apply overriding
the legal definition for this zone.public int SetStatePlane(int zone, int is_nad83, java.lang.String unitsname)
Same as below with units == 0
SetStatePlane(int zone, int is_nad83, String unitsname, double units)
public int SetStatePlane(int zone, int is_nad83)
Same as below with unitsname == "" and units == 0
SetStatePlane(int zone, int is_nad83, String unitsname, double units)
public int SetStatePlane(int zone)
Same as below with is_nad83 == 1, unitsname == "" and units == 0
SetStatePlane(int zone, int is_nad83, String unitsname, double units)
public int AutoIdentifyEPSG()
This method inspects a WKT definition, and adds EPSG authority nodes where an aspect of the coordinate system can be easily and safely corresponded with an EPSG identifier. In practice, this method will evolve over time. In theory it can add authority nodes for any object (i.e. spheroid, datum, GEOGCS, units, and PROJCS) that could have an authority node. Mostly this is useful to inserting appropriate PROJCS codes for common formulations (like UTM n WGS84).
If it success the OGRSpatialReference is updated in place, and the method return 0. If the method fails to identify the general coordinate system, a RuntimeException() will be throwned
public int SetProjection(java.lang.String name)
name
- the projection name, which should be selected from
the macros in ogr_srs_api.h, such as SRS_PT_TRANSVERSE_MERCATOR.public int SetProjParm(java.lang.String name, double val)
Adds a new PARAMETER under the PROJCS with the indicated name and value.
Please check http://www.remotesensing.org/geotiff/proj_list pages for legal parameter names for specific projections.
name
- the parameter name, which should be selected from
the macros in ogr_srs_api.h, such as SRS_PP_CENTRAL_MERIDIAN.val
- value to assign.public double GetProjParm(java.lang.String name, double default_val)
NOTE: This code should be modified to translate non degree angles into degrees based on the GEOGCS unit. This has not yet been done.
name
- the name of the parameter to fetch, from the set of
SRS_PP codes in ogr_srs_api.h.default_val
- the value to return if this parameter doesn't exist.public double GetProjParm(java.lang.String name)
Same as below with default_val == 0
GetProjParm(String name, double default_val)
public int SetNormProjParm(java.lang.String name, double val)
This method is the same as SetProjParm() except that the value of the parameter passed in is assumed to be in "normalized" form (decimal degrees for angular values, meters for linear values. The values are converted in a form suitable for the GEOGCS and linear units in effect.
name
- the parameter name, which should be selected from
the macros in ogr_srs_api.h, such as SRS_PP_CENTRAL_MERIDIAN.val
- value to assign.public double GetNormProjParm(java.lang.String name, double default_val)
This method is the same as GetProjParm() except that the value of the parameter is "normalized" into degrees or meters depending on whether it is linear or angular.
name
- the name of the parameter to fetch, from the set of
SRS_PP codes in ogr_srs_api.h.default_val
- the value to return if this parameter doesn't exist.public double GetNormProjParm(java.lang.String name)
Same as below with default_val == 0
GetNormProjParm(String name, double default_val)
public double GetSemiMajor()
public double GetSemiMinor()
public double GetInvFlattening()
public int SetACEA(double stdp1, double stdp2, double clat, double clong, double fe, double fn)
public int SetAE(double clat, double clong, double fe, double fn)
public int SetBonne(double stdp, double cm, double fe, double fn)
public int SetCEA(double stdp1, double cm, double fe, double fn)
public int SetCS(double clat, double clong, double fe, double fn)
public int SetEC(double stdp1, double stdp2, double clat, double clong, double fe, double fn)
public int SetEckertIV(double cm, double fe, double fn)
public int SetEckertVI(double cm, double fe, double fn)
public int SetEquirectangular(double clat, double clong, double fe, double fn)
public int SetEquirectangular2(double clat, double clong, double pseudostdparallellat, double fe, double fn)
public int SetGaussSchreiberTMercator(double clat, double clong, double sc, double fe, double fn)
public int SetGS(double cm, double fe, double fn)
public int SetGH(double cm, double fe, double fn)
public int SetIGH()
public int SetGEOS(double cm, double satelliteheight, double fe, double fn)
public int SetGnomonic(double clat, double clong, double fe, double fn)
public int SetHOM(double clat, double clong, double azimuth, double recttoskew, double scale, double fe, double fn)
public int SetHOM2PNO(double clat, double dfLat1, double dfLong1, double dfLat2, double dfLong2, double scale, double fe, double fn)
public int SetKrovak(double clat, double clong, double azimuth, double pseudostdparallellat, double scale, double fe, double fn)
public int SetLAEA(double clat, double clong, double fe, double fn)
public int SetLCC(double stdp1, double stdp2, double clat, double clong, double fe, double fn)
public int SetLCC1SP(double clat, double clong, double scale, double fe, double fn)
public int SetLCCB(double stdp1, double stdp2, double clat, double clong, double fe, double fn)
public int SetMC(double clat, double clong, double fe, double fn)
public int SetMercator(double clat, double clong, double scale, double fe, double fn)
public int SetMercator2SP(double stdp1, double clat, double clong, double fe, double fn)
public int SetMollweide(double cm, double fe, double fn)
public int SetNZMG(double clat, double clong, double fe, double fn)
public int SetOS(double dfOriginLat, double dfCMeridian, double scale, double fe, double fn)
public int SetOrthographic(double clat, double clong, double fe, double fn)
public int SetPolyconic(double clat, double clong, double fe, double fn)
public int SetPS(double clat, double clong, double scale, double fe, double fn)
public int SetRobinson(double clong, double fe, double fn)
public int SetSinusoidal(double clong, double fe, double fn)
public int SetStereographic(double clat, double clong, double scale, double fe, double fn)
public int SetSOC(double latitudeoforigin, double cm, double fe, double fn)
public int SetTM(double clat, double clong, double scale, double fe, double fn)
public int SetTMVariant(java.lang.String pszVariantName, double clat, double clong, double scale, double fe, double fn)
public int SetTMG(double clat, double clong, double fe, double fn)
public int SetTMSO(double clat, double clong, double scale, double fe, double fn)
public int SetVDG(double clong, double fe, double fn)
public int SetVerticalPerspective(double topoOriginLat, double topoOriginLon, double topoOriginHeight, double viewPointHeight, double fe, double fn)
public int SetWellKnownGeogCS(java.lang.String name)
This may be called on an empty OGRSpatialReference to make a geographic coordinate system, or on something with an existing PROJCS node to set the underlying geographic coordinate system of a projected coordinate system.
The following well known text values are currently supported:
name
- name of well known geographic coordinate system.public int SetFromUserInput(java.lang.String definition)
This method will examine the provided input, and try to deduce the format, and then use it to initialize the spatial reference system. It may take the following forms:
This method is intended to be flexible, but by it's nature it is imprecise as it must guess information about the format intended. When possible applications should call the specific method appropriate if the input is known to be in a particular format.
definition
- text definition to try to deduce SRS from.public int CopyGeogCSFrom(SpatialReference src_srs)
The GEOGCS information is copied into this SpatialReference from another. If this object has a PROJCS root already, the GEOGCS is installed within it, otherwise it is installed as the root.
src_srs
- the spatial reference to copy the GEOGCS information from.public int SetTOWGS84(double dfDX, double dfDY, double dfDZ, double dfEX, double dfEY, double dfEZ, double dfPPM)
This will create the TOWGS84 node as a child of the DATUM. It will fail if there is no existing DATUM node. Unlike most OGRSpatialReference methods it will insert itself in the appropriate order, and will replace an existing TOWGS84 node if there is one.
The parameters have the same meaning as EPSG transformation 9606 (Position Vector 7-param. transformation).
dfDX
- X child in meters.dfDY
- Y child in meters.dfDZ
- Z child in meters.dfEX
- X rotation in arc seconds (optional, defaults to zero).dfEY
- Y rotation in arc seconds (optional, defaults to zero).dfEZ
- Z rotation in arc seconds (optional, defaults to zero).dfPPM
- scaling factor (parts per million).public boolean HasTOWGS84()
public int GetTOWGS84(double[] argout)
argout
- allocated array of 7 doubles into which up to 7 coefficients are placed.public int AddGuessedTOWGS84()
public int SetLocalCS(java.lang.String name)
This method is will ensure a LOCAL_CS node is created as the root, and set the provided name on it. It must be used before SetLinearUnits().
name
- the user visible name to assign. Not used as a key.public int SetGeogCS(java.lang.String pszGeogName, java.lang.String pszDatumName, java.lang.String pszSpheroidName, double dfSemiMajor, double dfInvFlattening, java.lang.String pszPMName, double dfPMOffset, java.lang.String pszAngularUnits, double dfConvertToRadians)
This method is used to set the datum, ellipsoid, prime meridian and angular units for a geographic coordinate system. It can be used on it's own to establish a geographic spatial reference, or applied to a projected coordinate system to establish the underlying geographic coordinate system.
pszGeogName
- user visible name for the geographic coordinate system
(not to serve as a key).pszDatumName
- key name for this datum. The OpenGIS specification
lists some known values, and otherwise EPSG datum names with a standard
transformation are considered legal keys.pszSpheroidName
- user visible spheroid name (not to serve as a key)dfSemiMajor
- the semi major axis of the spheroid.dfInvFlattening
- the inverse flattening for the spheroid.
This can be computed from the semi minor axis as
1/f = 1.0 / (1.0 - semiminor/semimajor).pszPMName
- the name of the prime meridian (not to serve as a key)
If this is null a default value of "Greenwich" will be used.dfPMOffset
- the longitude of greenwich relative to this prime
meridian.pszAngularUnits
- the angular units name (see ogr_srs_api.h for some
standard names). If null a value of "degrees" will be assumed.dfConvertToRadians
- value to multiply angular units by to transform
them to radians. A value of SRS_UL_DEGREE_CONV will be used if
pszAngularUnits is null.public int SetGeogCS(java.lang.String pszGeogName, java.lang.String pszDatumName, java.lang.String pszSpheroidName, double dfSemiMajor, double dfInvFlattening, java.lang.String pszPMName, double dfPMOffset, java.lang.String pszAngularUnits)
Same as below with dfConvertToRadians = 0.0174532925199433
public int SetGeogCS(java.lang.String pszGeogName, java.lang.String pszDatumName, java.lang.String pszSpheroidName, double dfSemiMajor, double dfInvFlattening, java.lang.String pszPMName, double dfPMOffset)
Same as below with pszAngularUnits = "degree" and dfConvertToRadians = 0.0174532925199433
public int SetGeogCS(java.lang.String pszGeogName, java.lang.String pszDatumName, java.lang.String pszSpheroidName, double dfSemiMajor, double dfInvFlattening, java.lang.String pszPMName)
Same as below with dfPMOffset = 0.0, pszAngularUnits = "degree" and dfConvertToRadians = 0.0174532925199433
public int SetGeogCS(java.lang.String pszGeogName, java.lang.String pszDatumName, java.lang.String pszSpheroidName, double dfSemiMajor, double dfInvFlattening)
Same as below with pszPMName = "Greenwich", dfPMOffset = 0.0, pszAngularUnits = "degree" and dfConvertToRadians = 0.0174532925199433
public int SetProjCS(java.lang.String name)
This method is will ensure a PROJCS node is created as the root, and set the provided name on it. If used on a GEOGCS coordinate system, the GEOGCS node will be demoted to be a child of the new PROJCS root.
name
- the user visible name to assign. May be nullpublic int SetProjCS()
Same as below with name == null
SetProjCS(String name)
public int SetGeocCS(java.lang.String name)
This method is will ensure a GEOCCS node is created as the root, and set the provided name on it. If used on a GEOGCS coordinate system, the DATUM and PRIMEM nodes from the GEOGCS will be transferred over to the GEOGCS.
name
- the user visible name to assign. Not used as a key. May be nullpublic int SetGeocCS()
Same as below with name == null
SetGeocCS(String name)
public int SetVertCS(java.lang.String VertCSName, java.lang.String VertDatumName, int VertDatumType)
This method is will ensure a VERT_CS node is created if needed. If the existing coordinate system is GEOGCS or PROJCS rooted, then it will be turned into a COMPD_CS.
VertCSName
- the user visible name of the vertical coordinate
system. Not used as a key.VertDatumName
- the user visible name of the vertical datum. It
is helpful if this matches the EPSG name.VertDatumType
- the OGC vertical datum type, usually 2005.public int SetVertCS(java.lang.String VertCSName, java.lang.String VertDatumName)
public int SetVertCS(java.lang.String VertCSName)
public int SetVertCS()
public int SetCompoundCS(java.lang.String name, SpatialReference horizcs, SpatialReference vertcs)
public int ImportFromWkt(java.lang.String wkt)
This method will wipe the existing SRS definition, and reassign it based on the contents of the passed WKT string. Only as much of the input string as needed to construct this SRS is consumed from the input string.
wkt
- WKT stringpublic int ImportFromProj4(java.lang.String proj4)
The OGRSpatialReference is initialized from the passed PROJ.4 style coordinate system string. In addition to many +proj formulations which have OGC equivalents, it is also possible to import "+init=epsg:n" style definitions. These are passed to importFromEPSG(). Other init strings (such as the state plane zones) are not currently supported.
Example: pszProj4 = "+proj=utm +zone=11 +datum=WGS84"
Some parameters, such as grids, recognized by PROJ.4 may not be well understood and translated into the OGRSpatialReference model. It is possible to add the +wktext parameter which is a special keyword that OGR recognizes as meaning "embed the entire PROJ.4 string in the WKT and use it literally when converting back to PROJ.4 format".
For example: "+proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=intl +units=m +nadgrids=nzgd2kgrid0005.gsb +wktext"
will be translated as :
PROJCS["unnamed", GEOGCS["International 1909 (Hayford)", DATUM["unknown", SPHEROID["intl",6378388,297]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433]], PROJECTION["New_Zealand_Map_Grid"], PARAMETER["latitude_of_origin",-41], PARAMETER["central_meridian",173], PARAMETER["false_easting",2510000], PARAMETER["false_northing",6023150], UNIT["Meter",1], EXTENSION["PROJ4","+proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=intl +units=m +nadgrids=nzgd2kgrid0005.gsb +wktext"]]
proj4
- the PROJ.4 style string.public int ImportFromUrl(java.lang.String url)
This method will download the spatial reference at a given URL and feed it into SetFromUserInput for you.
url
- text definition to try to deduce SRS from.public int ImportFromESRI(java.util.Vector ppszInput)
This function will read the text loaded from an ESRI .prj file, and translate it into an OGRSpatialReference definition. This should support many (but by no means all) old style (Arc/Info 7.x) .prj files, as well as the newer pseudo-OGC WKT .prj files. Note that new style .prj files are in OGC WKT format, but require some manipulation to correct datum names, and units on some projection parameters. This is addressed within importFromESRI() by an automatic call to morphFromESRI().
Currently only GEOGRAPHIC, UTM, STATEPLANE, GREATBRITIAN_GRID, ALBERS, EQUIDISTANT_CONIC, and TRANSVERSE (mercator) projections are supported from old style files.
At this time there is no equivalent exportToESRI() method. Writing old style .prj files is not supported by OGRSpatialReference. However the morphToESRI() and exportToWkt() methods can be used to generate output suitable to write to new style (Arc 8) .prj files.
ppszInput
- vector of strings containing the definition.public int ImportFromEPSG(int nCode)
This method will initialize the spatial reference based on the passed in EPSG GCS or PCS code. The coordinate system definitions are normally read from the EPSG derived support files such as pcs.csv, gcs.csv, pcs.override.csv, gcs.override.csv and falling back to search for a PROJ.4 epsg init file or a definition in epsg.wkt.
These support files are normally searched for in /usr/local/share/gdal or in the directory identified by the GDAL_DATA configuration option. See CPLFindFile() for details.
This method is relatively expensive, and generally involves quite a bit of text file scanning. Reasonable efforts should be made to avoid calling it many times for the same coordinate system.
This method is similar to importFromEPSGA() except that EPSG preferred axis ordering will *not* be applied for geographic coordinate systems. EPSG normally defines geographic coordinate systems to use lat/long contrary to typical GIS use).
nCode
- a GCS or PCS code from the horizontal coordinate system table.public int ImportFromEPSGA(int arg)
public int ImportFromPCI(java.lang.String proj, java.lang.String units, double[] prjParams)
PCI software uses 16-character string to specify coordinate system and datum/ellipsoid. You should supply at least this string to the importFromPCI() function.
proj
- string containing the definition. Looks
like "pppppppppppp Ennn" or "pppppppppppp Dnnn", where "pppppppppppp" is
a projection code, "Ennn" is an ellipsoid code, "Dnnn" --- a datum code.units
- Grid units code ("DEGREE" or "METRE"). If null, "METRE" will
be used.prjParams
- Array of 17 coordinate system parameters:
[0] Spheroid semi major axis [1] Spheroid semi minor axis [2] Reference Longitude [3] Reference Latitude [4] First Standard Parallel [5] Second Standard Parallel [6] False Easting [7] False Northing [8] Scale Factor [9] Height above sphere surface [10] Longitude of 1st point on center line [11] Latitude of 1st point on center line [12] Longitude of 2nd point on center line [13] Latitude of 2nd point on center line [14] Azimuth east of north for center line [15] Landsat satellite number [16] Landsat path numberParticular projection uses different parameters, unused ones may be set to zero. If null supplied instead of array pointer default values will be used (i.e., zeroes).
public int ImportFromPCI(java.lang.String proj, java.lang.String units)
Same as below with prjParams == null
ImportFromPCI(String proj, String units, double[] prjParams)
public int ImportFromPCI(java.lang.String proj)
Same as below with units == null and prjParams == null
ImportFromPCI(String proj, String units, double[] prjParams)
public int ImportFromUSGS(int iProjSys, int iZone, double[] padfPrjParams, int iDatum)
This method will import projection definition in style, used by USGS GCTP software. GCTP operates on angles in packed DMS format (see CPLDecToPackedDMS() function for details), so all angle values (latitudes, longitudes, azimuths, etc.) specified in the padfPrjParams array should be in the packed DMS format. Projection Transformation Package Projection Parameters:
---------------------------------------------------------------------------- | Array Element Code & Projection Id |--------------------------------------------------- | 0 | 1 | 2 | 3 | 4 | 5 |6 | 7 ---------------------------------------------------------------------------- 0 Geographic | | | | | | | | 1 U T M |Lon/Z |Lat/Z | | | | | | 2 State Plane | | | | | | | | 3 Albers Equal Area |SMajor|SMinor|STDPR1|STDPR2|CentMer|OriginLat|FE|FN 4 Lambert Conformal C |SMajor|SMinor|STDPR1|STDPR2|CentMer|OriginLat|FE|FN 5 Mercator |SMajor|SMinor| | |CentMer|TrueScale|FE|FN 6 Polar Stereographic |SMajor|SMinor| | |LongPol|TrueScale|FE|FN 7 Polyconic |SMajor|SMinor| | |CentMer|OriginLat|FE|FN 8 Equid. Conic A |SMajor|SMinor|STDPAR| |CentMer|OriginLat|FE|FN Equid. Conic B |SMajor|SMinor|STDPR1|STDPR2|CentMer|OriginLat|FE|FN 9 Transverse Mercator |SMajor|SMinor|Factor| |CentMer|OriginLat|FE|FN 10 Stereographic |Sphere| | | |CentLon|CenterLat|FE|FN 11 Lambert Azimuthal |Sphere| | | |CentLon|CenterLat|FE|FN 12 Azimuthal |Sphere| | | |CentLon|CenterLat|FE|FN 13 Gnomonic |Sphere| | | |CentLon|CenterLat|FE|FN 14 Orthographic |Sphere| | | |CentLon|CenterLat|FE|FN 15 Gen. Vert. Near Per |Sphere| |Height| |CentLon|CenterLat|FE|FN 16 Sinusoidal |Sphere| | | |CentMer| |FE|FN 17 Equirectangular |Sphere| | | |CentMer|TrueScale|FE|FN 18 Miller Cylindrical |Sphere| | | |CentMer| |FE|FN 19 Van der Grinten |Sphere| | | |CentMer|OriginLat|FE|FN 20 Hotin Oblique Merc A |SMajor|SMinor|Factor| | |OriginLat|FE|FN Hotin Oblique Merc B |SMajor|SMinor|Factor|AziAng|AzmthPt|OriginLat|FE|FN 21 Robinson |Sphere| | | |CentMer| |FE|FN 22 Space Oblique Merc A |SMajor|SMinor| |IncAng|AscLong| |FE|FN Space Oblique Merc B |SMajor|SMinor|Satnum|Path | | |FE|FN 23 Alaska Conformal |SMajor|SMinor| | | | |FE|FN 24 Interrupted Goode |Sphere| | | | | | | 25 Mollweide |Sphere| | | |CentMer| |FE|FN 26 Interrupt Mollweide |Sphere| | | | | | | 27 Hammer |Sphere| | | |CentMer| |FE|FN 28 Wagner IV |Sphere| | | |CentMer| |FE|FN 29 Wagner VII |Sphere| | | |CentMer| |FE|FN 30 Oblated Equal Area |Sphere| |Shapem|Shapen|CentLon|CenterLat|FE|FN ---------------------------------------------------------------------------- ---------------------------------------------------- | Array Element | Code & Projection Id |--------------------------- | 8 | 9 | 10 | 11 | 12 | ---------------------------------------------------- 0 Geographic | | | | | | 1 U T M | | | | | | 2 State Plane | | | | | | 3 Albers Equal Area | | | | | | 4 Lambert Conformal C | | | | | | 5 Mercator | | | | | | 6 Polar Stereographic | | | | | | 7 Polyconic | | | | | | 8 Equid. Conic A |zero | | | | | Equid. Conic B |one | | | | | 9 Transverse Mercator | | | | | | 10 Stereographic | | | | | | 11 Lambert Azimuthal | | | | | | 12 Azimuthal | | | | | | 13 Gnomonic | | | | | | 14 Orthographic | | | | | | 15 Gen. Vert. Near Per | | | | | | 16 Sinusoidal | | | | | | 17 Equirectangular | | | | | | 18 Miller Cylindrical | | | | | | 19 Van der Grinten | | | | | | 20 Hotin Oblique Merc A |Long1|Lat1|Long2|Lat2|zero| Hotin Oblique Merc B | | | | |one | 21 Robinson | | | | | | 22 Space Oblique Merc A |PSRev|LRat|PFlag| |zero| Space Oblique Merc B | | | | |one | 23 Alaska Conformal | | | | | | 24 Interrupted Goode | | | | | | 25 Mollweide | | | | | | 26 Interrupt Mollweide | | | | | | 27 Hammer | | | | | | 28 Wagner IV | | | | | | 29 Wagner VII | | | | | | 30 Oblated Equal Area |Angle| | | | | ---------------------------------------------------- where Lon/Z Longitude of any point in the UTM zone or zero. If zero, a zone code must be specified. Lat/Z Latitude of any point in the UTM zone or zero. If zero, a zone code must be specified. SMajor Semi-major axis of ellipsoid. If zero, Clarke 1866 in meters is assumed. SMinor Eccentricity squared of the ellipsoid if less than zero, if zero, a spherical form is assumed, or if greater than zero, the semi-minor axis of ellipsoid. Sphere Radius of reference sphere. If zero, 6370997 meters is used. STDPAR Latitude of the standard parallel STDPR1 Latitude of the first standard parallel STDPR2 Latitude of the second standard parallel CentMer Longitude of the central meridian OriginLat Latitude of the projection origin FE False easting in the same units as the semi-major axis FN False northing in the same units as the semi-major axis TrueScale Latitude of true scale LongPol Longitude down below pole of map Factor Scale factor at central meridian (Transverse Mercator) or center of projection (Hotine Oblique Mercator) CentLon Longitude of center of projection CenterLat Latitude of center of projection Height Height of perspective point Long1 Longitude of first point on center line (Hotine Oblique Mercator, format A) Long2 Longitude of second point on center line (Hotine Oblique Mercator, format A) Lat1 Latitude of first point on center line (Hotine Oblique Mercator, format A) Lat2 Latitude of second point on center line (Hotine Oblique Mercator, format A) AziAng Azimuth angle east of north of center line (Hotine Oblique Mercator, format B) AzmthPt Longitude of point on central meridian where azimuth occurs (Hotine Oblique Mercator, format B) IncAng Inclination of orbit at ascending node, counter-clockwise from equator (SOM, format A) AscLong Longitude of ascending orbit at equator (SOM, format A) PSRev Period of satellite revolution in minutes (SOM, format A) LRat Landsat ratio to compensate for confusion at northern end of orbit (SOM, format A -- use 0.5201613) PFlag End of path flag for Landsat: 0 = start of path, 1 = end of path (SOM, format A) Satnum Landsat Satellite Number (SOM, format B) Path Landsat Path Number (Use WRS-1 for Landsat 1, 2 and 3 and WRS-2 for Landsat 4, 5 and 6.) (SOM, format B) Shapem Oblated Equal Area oval shape parameter m Shapen Oblated Equal Area oval shape parameter n Angle Oblated Equal Area oval rotation angle Array elements 13 and 14 are set to zero. All array elements with blank fields are set to zero too.If the datum code is negative, the first two values in the parameter array (parm) are used to define the values as follows:
semiminor = sqrt(1.0 - ES) * semimajor
where
ES = eccentricity squared
0: Clarke 1866 (default) 1: Clarke 1880 2: Bessel 3: International 1967 4: International 1909 5: WGS 72 6: Everest 7: WGS 66 8: GRS 1980/WGS 84 9: Airy 10: Modified Everest 11: Modified Airy 12: Walbeck 13: Southeast Asia 14: Australian National 15: Krassovsky 16: Hough 17: Mercury 1960 18: Modified Mercury 1968 19: Sphere of Radius 6370997 meters
iProjSys
- Input projection system code, used in GCTP.iZone
- Input zone for UTM and State Plane projection systems. For
Southern Hemisphere UTM use a negative zone code. iZone ignored for all
other projections.padfPrjParams
- Array of 15 coordinate system parameters. These
parameters differs for different projections.iDatum
- Input spheroid.public int ImportFromUSGS(int iProjSys, int iZone, double[] padfPrjParams)
Same as below with iDatum == 0
ImportFromUSGS(int iProjSys, int iZone, double[] padfPrjParams, int iDatum)
public int ImportFromUSGS(int iProjSys, int iZone)
Same as below with padfPrjParams == null and iDatum == 0
ImportFromUSGS(int iProjSys, int iZone, double[] padfPrjParams, int iDatum)
public int ImportFromUSGS(int iProjSys)
Same as below with iZone == 0, padfPrjParams == null and iDatum == 0
ImportFromUSGS(int iProjSys, int iZone, double[] padfPrjParams, int iDatum)
public int ImportFromXML(java.lang.String xmlString)
xmlString
- XML string to importpublic int ImportFromERM(java.lang.String proj, java.lang.String datum, java.lang.String units)
public int ImportFromMICoordSys(java.lang.String coord_sys)
The SpatialReference is initialized from the passed Mapinfo style CoordSys definition string.
coord_sys
- Mapinfo style CoordSys definition string.public int ImportFromOzi(java.util.Vector papszLines)
public int ExportToWkt(java.lang.String[] argout, java.util.Vector options)
public int ExportToWkt(java.lang.String[] argout)
argout
- an already allocated array of 1 string to receive the outputpublic int ExportToPrettyWkt(java.lang.String[] argout, int simplify)
argout
- an already allocated array of 1 string to receive the outputsimplify
- 1 if the AXIS, AUTHORITY and EXTENSION nodes should be stripped offpublic int ExportToPrettyWkt(java.lang.String[] argout)
Same as below with simplify == 0.
ExportToPrettyWkt(String[] argout, int simplify)
public int ExportToPROJJSON(java.lang.String[] argout, java.util.Vector options)
public int ExportToPROJJSON(java.lang.String[] argout)
public int ExportToProj4(java.lang.String[] argout)
Converts the loaded coordinate reference system into PROJ.4 format to the extent possible.
LOCAL_CS coordinate systems are not translatable. An empty string will be returned along with 0.
argout
- an already allocated array of 1 string to receive the PROJ.4 definitionpublic int ExportToPCI(java.lang.String[] proj, java.lang.String[] units, double[] parms)
Converts the loaded coordinate reference system into PCI projection definition to the extent possible.
LOCAL_CS coordinate systems are not translatable. An empty string will be returned along with 0.
proj
- an already allocated array of 1 string to receive the PCI projection
definitionunits
- an already allocated array of 1 string to receive units definitionparms
- an already allocated array of 17 doubles to receive the 17
projection parameters will be assigned. See importFromPCI() for the list of parameters.public int ExportToUSGS(int[] projsys, int[] zone, double[] parms, int[] datum)
projsys
- an already allocated array of 1 integer to receive the projection system code.zone
- an already allocated array of 1 integer to receive the zone for UTM and State Plane
projection.parms
- n already allocated array of 15 doubles to receive
15 projection parameters. See importFromUSGS() for
the list of parameters.datum
- an already allocated array of 1 integer to receive the datum code.public int ExportToXML(java.lang.String[] argout, java.lang.String dialect)
Converts the loaded coordinate reference system into XML format to the extent possible.
LOCAL_CS coordinate systems are not translatable. An empty string will be returned along with 0.
argout
- an already allocated array of 1 string to receive the XML definition.dialect
- currently ignored. The dialect used is GML based.public int ExportToXML(java.lang.String[] argout)
ExportToXML(String[] argout, String dialect)
public int ExportToMICoordSys(java.lang.String[] argout)
argout
- an already allocated array of 1 string to receive the outputpublic SpatialReference CloneGeogCS()
public SpatialReference Clone()
public int Validate()
This method attempts to verify that the spatial reference system is well formed, and consists of known tokens. The validation is not comprehensive.
public int MorphToESRI()
The value nodes of this coordinate system are modified in various manners more closely map onto the ESRI concept of WKT format. This includes renaming a variety of projections and arguments, and stripping out nodes note recognised by ESRI (like AUTHORITY and AXIS).
public int MorphFromESRI()
The value notes of this coordinate system are modified in various manners to adhere more closely to the WKT standard. This mostly involves translating a variety of ESRI names for projections, arguments and datums to "standard" names, as defined by Adam Gawne-Cain's reference translation of EPSG to WKT for the CT specification.
public SpatialReference ConvertToOtherProjection(java.lang.String other_projection, java.util.Vector options)
public SpatialReference ConvertToOtherProjection(java.lang.String other_projection)
public int PromoteTo3D(java.lang.String name)
public int PromoteTo3D()
public int DemoteTo2D(java.lang.String name)
public int DemoteTo2D()