Class PrjCoordSys
- java.lang.Object
-
- com.supermap.data.PrjCoordSys
-
public class PrjCoordSys extends java.lang.ObjectThe projected coordinate system class.
The projected coordinate system consists of the map projection type, the projection parameter, the coordinate unit and the geographic coordinate system. SuperMap iMobile for Android provides many predefined projection systems that the users can use directly. Besides, the users can also define the projection system by themselves.
The projected coordinate system is defined on a two dimensional surface. Unlike geographic coordinate system using Lon/Lat to identify the location, the projected coordinate system is identified by x, y coordinate on a grid.
-
-
Constructor Summary
Constructors Constructor and Description PrjCoordSys()Constructs a new PrjCoordSys object.PrjCoordSys(GeoCoordSys geoCoordSys, Projection projection, PrjParameter prjParameter, java.lang.String name)Creates a new PrjCoordSys object according to the specified arguments.PrjCoordSys(PrjCoordSys prjCoordSys)Constructs a new object identical to the given PrjCoordSys object.PrjCoordSys(PrjCoordSysType type)Creates a new PrjCoordSys object according to the specified arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description PrjCoordSysclone()Clone for PrjCoordSys.voiddispose()Release the resource occupy by this object.booleanfromFile(java.lang.String filePath, PrjFileType type)Builds the attribute of the {PrjCoordSys} object according to the type of xml file and projection file.booleanfromXML(java.lang.String xml)Creates aPrjCoordSysobject with the specified XML string.UnitgetCoordUnit()Returns the coordinate unit of the projected system.UnitgetDistanceUnit()Returns the distance unit.GeoCoordSysgetGeoCoordSys()Returns the GeoCoordSys object of the PrjCoordSys object.java.lang.StringgetName()Returns the name of the object projected coordinate system.PrjParametergetPrjParameter()Returns the projection parameter of the projected coordinate system.ProjectiongetProjection()Returns the projection type of the coordinate system, for example, Conformal Conic Projections and Azimuthal Equidistant Projections etc.PrjCoordSysTypegetType()Returns the PrjCoordSys type.booleanisSame(PrjCoordSys prjCoordSys)Whether the left sides are the samevoidsetCoordUnit(Unit value)Sets the coordinate unit of the projected system.voidsetDistanceUnit(Unit value)Sets the distance units.voidsetGeoCoordSys(GeoCoordSys value)Set the GeoCoordSys object of the PrjCoordSys object.voidsetName(java.lang.String value)Sets the name of the projected coordinate system.voidsetPrjParameter(PrjParameter value)Sets the projection parameters.voidsetProjection(Projection value)Sets the projection type of the coordinate system, for example, Conformal Conic Projections, Azimuthal Equidistant Projections, and etc.voidsetType(PrjCoordSysType value)Sets the projected coordinate system type.booleantoFile(java.lang.String filePath, PrjFileVersion version)Exports thePrjCoordSysobject to a projection file according to the specified version.java.lang.StringtoXML()Exports the XML string represents the PrjCoordSys object.
-
-
-
Constructor Detail
-
PrjCoordSys
public PrjCoordSys()
Constructs a new PrjCoordSys object.
-
PrjCoordSys
public PrjCoordSys(PrjCoordSysType type)
Creates a new PrjCoordSys object according to the specified arguments.- Parameters:
type- The type of the projected coordinate system.
-
PrjCoordSys
public PrjCoordSys(GeoCoordSys geoCoordSys, Projection projection, PrjParameter prjParameter, java.lang.String name)
Creates a new PrjCoordSys object according to the specified arguments.- Parameters:
geoCoordSys- The geographic coordinate system on which the projected coordinate system based.projection- The projection type of the coordinate system, for example, Conformal Conic Projections and Azimuthal Equidistant Projections etc.prjParameter- The projection parameters.name- The name of the projected coordinate system.
-
PrjCoordSys
public PrjCoordSys(PrjCoordSys prjCoordSys)
Constructs a new object identical to the given PrjCoordSys object.- Parameters:
prjCoordSys- The specified PrjCoordSys object.
-
-
Method Detail
-
isSame
public boolean isSame(PrjCoordSys prjCoordSys)
Whether the left sides are the same- Parameters:
prjCoordSys- the projection coordinate system- Returns:
- boolean
-
getName
public java.lang.String getName()
Returns the name of the object projected coordinate system.- Returns:
- The name of the object projected coordinate system.
- Default:
- the default value is "User Define".
-
setName
public void setName(java.lang.String value)
Sets the name of the projected coordinate system. Valid only if the coordinate system is of the projected or geographic type.- Parameters:
value- The name of the object projected coordinate system.
-
getType
public PrjCoordSysType getType()
Returns the PrjCoordSys type.When the projected coordinate system is defined by user, it is required to specify geographic coordinate system, projection method, coordinate units and projection parameters; other values are predefined by SuperMap Objects Java .
- Returns:
- The type of the projected coordinate system.
- Default:
- The default value is
PrjCoordSysType.PCS_USER_DEFINED.
-
setType
public void setType(PrjCoordSysType value)
Sets the projected coordinate system type.When the projected coordinate system is defined by user, it is required to specify geographic coordinate system, projection method, coordinate units and projection parameters; other values are predefined by SuperMap Objects Java .
- Parameters:
value- The type of the projected coordinate system.
-
getGeoCoordSys
public GeoCoordSys getGeoCoordSys()
Returns the GeoCoordSys object of the PrjCoordSys object.- Returns:
- The geographic coordinate system object of the projected coordinate system.
- Default:
- The default value is an empty
GeoCoordSysobject.
-
setGeoCoordSys
public void setGeoCoordSys(GeoCoordSys value)
Set the GeoCoordSys object of the PrjCoordSys object. This method is available only when the coordinate system is projected coordinate system and geographic coordinate system.- Parameters:
value- The geographic coordinate system object of the projected coordinate system.
-
getProjection
public Projection getProjection()
Returns the projection type of the coordinate system, for example, Conformal Conic Projections and Azimuthal Equidistant Projections etc.- Returns:
- The projection type of the projected coordinate system.
- Default:
- The default value is an empty
Projectionobject.
-
setProjection
public void setProjection(Projection value)
Sets the projection type of the coordinate system, for example, Conformal Conic Projections, Azimuthal Equidistant Projections, and etc. Valid only if the coordinate system is of the projected type.- Parameters:
value- The projection type of the projected coordinate system.
-
getPrjParameter
public PrjParameter getPrjParameter()
Returns the projection parameter of the projected coordinate system.- Returns:
- The projection parameter of the projected coordinate system.
- Default:
- The default value is null
PrjParameter.
-
setPrjParameter
public void setPrjParameter(PrjParameter value)
Sets the projection parameters. Valid only if the coordinate system is of the projected type.- Parameters:
value- The projection parameter of the projected coordinate system.
-
getCoordUnit
public Unit getCoordUnit()
Returns the coordinate unit of the projected system.The units of coordinates and distance may be different in projected coordinate system, for example, the units of coordinates is decimal degree in Lat/Lon, the one of distance can be meter, kilometer etc. Even for planar coordinate systems, the two units can be different.
- Returns:
- The coordinate unit of the projected system.
- Default:
- The default value is
METER.
-
setCoordUnit
public void setCoordUnit(Unit value)
Sets the coordinate unit of the projected system.The units of coordinates and distance may be different in projected coordinate system, for example, the units of coordinates is decimal degree in Lat/Lon, the one of distance can be meter, kilometer etc. Even for planar coordinate systems, the two units can be different.
- Parameters:
value- The coordinate unit of the projected system.
-
getDistanceUnit
public Unit getDistanceUnit()
Returns the distance unit.- Returns:
- The distance unit.
- Default:
- The default value is
METER.
-
setDistanceUnit
public void setDistanceUnit(Unit value)
Sets the distance units. Valid only if the coordinate system is of the projected or geographic type.- Parameters:
value- The distance unit.
-
fromXML
public boolean fromXML(java.lang.String xml)
Creates aPrjCoordSysobject with the specified XML string. Returns true if successful.- Parameters:
xml- The specified XML string.- Returns:
- Returns true, if successful; otherwise, false.
-
toXML
public java.lang.String toXML()
Exports the XML string represents the PrjCoordSys object.- Returns:
- the XML string represents the PrjCoordSys object.
-
fromFile
public boolean fromFile(java.lang.String filePath, PrjFileType type)Builds the attribute of the {PrjCoordSys} object according to the type of xml file and projection file.- Parameters:
filePath- the XML file path.type- The type of projection file.- Returns:
- Returns true, if successful; otherwise, false.
-
toFile
public boolean toFile(java.lang.String filePath, PrjFileVersion version)Exports thePrjCoordSysobject to a projection file according to the specified version.- Parameters:
filePath- the XML file path.version- The type of projection file.- Returns:
- Returns true if successful, otherwise false.
-
dispose
public void dispose()
Release the resource occupy by this object.
-
clone
public PrjCoordSys clone()
Clone for PrjCoordSys.- Overrides:
clonein classjava.lang.Object- Returns:
- The clone object of PrjCoordSys.
-
-