Class GeoSpheroid
- java.lang.Object
-
- com.supermap.data.GeoSpheroid
-
public class GeoSpheroid extends java.lang.Object
The GeoSpheroid class.The class in mainly used to describe the flattening and the major axis of the earth.
Generally, the spheroid or ellipsoid is used to describe the Earth's shape and magnitude. For easier to calculate, the Earth can be regard as a spheroid but most times it is regard as an ellipsoid. In general, the Earth's shape is supposing to be a spheroid when the map scale is less than 1:1,000,000. Because under this circumstance, the difference of spheroid and ellipsoid is very small. But for the big scale greater 1:1,000,000, it is necessary to use ellipsoid to approach the Earth. The ellipsoid is based on ellipse, so using two axes to express the magnitude of the Earth, that is the major axis (radius of the equator) and the minor axis (radius of the polar).
The proper spheroid parameters need to be chosen because the projection results may be far different when using the same projection method, the same data and the different spheroid parameters. The earth spheroid parameters may be different in different era, different countries and regions, China now mainly uses the Krasovsky spheroid parameters. The north america, Britain and France mainly use the Clarke spheroid parameters.
-
-
Constructor Summary
Constructors Constructor and Description GeoSpheroid()
Constructs a new GeoSpheroid object.GeoSpheroid(double axis, double flatten, java.lang.String name)
Creates a new GeoSpheroid object according to the specified arguments.GeoSpheroid(GeoSpheroid geoSpheroid)
Initializes a new instance identical to the given GeoSpheroidType object.GeoSpheroid(GeoSpheroidType type)
Creates a new GeoSpheroidType object according to the specified arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description GeoSpheroid
clone()
Perform clone for GeoSpheroidvoid
dispose()
Disposes the resources occupied by the object.boolean
fromXML(java.lang.String xml)
Retrieves the Geospheroid object with the introduced XML string.double
getAxis()
Returns the major axis of the earth spheroid.double
getFlatten()
Returns the flattening of spheroid, which can be set when the type of GeoSpheroid is the user defined.java.lang.String
getName()
Returns the name of the earth ellipsoid object, which can be set when the type of GeoSpheroid is the user defined.GeoSpheroidType
getType()
Returns the GeoSpheroidType object.void
setAxis(double value)
Sets the major axis of the earth spheroid.void
setFlatten(double value)
Sets the flattening of spheroid, which can be set when the type of GeoSpheroid is the user defined.void
setName(java.lang.String value)
Sets the name of the earth ellipsoid object, which can be set when the type of GeoSpheroid is the user defined.void
setType(GeoSpheroidType value)
Sets the GeoSpheroidType object.java.lang.String
toXML()
Exports the object of this GeoSpheroid class to an XML string.
-
-
-
Constructor Detail
-
GeoSpheroid
public GeoSpheroid()
Constructs a new GeoSpheroid object.
-
GeoSpheroid
public GeoSpheroid(GeoSpheroidType type)
Creates a new GeoSpheroidType object according to the specified arguments.- Parameters:
type
- the specified GeoSpheroidType object.
-
GeoSpheroid
public GeoSpheroid(double axis, double flatten, java.lang.String name)
Creates a new GeoSpheroid object according to the specified arguments.- Parameters:
axis
- The specified major radius of spheroid.flatten
- The specified flattening of spheroid.name
- The given name of spheroid.
-
GeoSpheroid
public GeoSpheroid(GeoSpheroid geoSpheroid)
Initializes a new instance identical to the given GeoSpheroidType object.- Parameters:
geoSpheroid
- the specified GeoSpheroidType object.
-
-
Method Detail
-
getAxis
public double getAxis()
Returns the major axis of the earth spheroid. It is also called the equatorial radius. Through the major axis and the flattening of the earth, it is able to calculate the polar radius, the first eccentricity, the second eccentricity, etc. The major axis can be set only when the type of the earth spheroid is custom.- Returns:
- The major axis of the earth spheroid.
- Default:
- The default value is 6378137.0.
-
setAxis
public void setAxis(double value)
Sets the major axis of the earth spheroid. It is also called the equatorial radius. Through the major axis and the flattening of the earth, it is able to calculate the polar radius, the first eccentricity, the second eccentricity, etc. The major axis can be set only when the type of the earth spheroid is custom.- Parameters:
value
- The major axis of the earth spheroid.
-
getFlatten
public double getFlatten()
Returns the flattening of spheroid, which can be set when the type of GeoSpheroid is the user defined.The flattening of spheroid reflects the flat degree which usually is the ratio between the difference of major and minor axes and the major axis.
- Returns:
- The flattening of the earth spheroid.
- Default:
- The default value is 0.0033528107.
-
setFlatten
public void setFlatten(double value)
Sets the flattening of spheroid, which can be set when the type of GeoSpheroid is the user defined.The flattening of spheroid reflects the flat degree which usually is the ratio between the difference of major and minor axes and the major axis.
- Parameters:
value
- The flattening of the earth spheroid.
-
getName
public java.lang.String getName()
Returns the name of the earth ellipsoid object, which can be set when the type of GeoSpheroid is the user defined.- Returns:
- The name of the earth spheroid object.
- Default:
- The default value is "WGS_1984".
-
setName
public void setName(java.lang.String value)
Sets the name of the earth ellipsoid object, which can be set when the type of GeoSpheroid is the user defined.- Parameters:
value
- The name of the earth spheroid object.
-
getType
public GeoSpheroidType getType()
Returns the GeoSpheroidType object. Users should specify the major axis and the flattening additionally when the type of the earth spheroid is custom. The other values are predefined by the SuperMap Objects Java system, users don't need to specify them. Please reference the GeoSpheroidType enumeration type of the earth spheroid.- Returns:
- The type of the earth spheroid.
- Default:
- The default value is
SPHEROID_WGS_1984
.
-
setType
public void setType(GeoSpheroidType value)
Sets the GeoSpheroidType object. Users should specify the major axis and the flattening additionally when the type of the earth spheroid is custom. The other values are predefined by the SuperMap Objects Java system, users don't need to specify them. Please reference the GeoSpheroidType enumeration type of the earth spheroid.- Parameters:
value
- The type of the Earth ellipsoid.
-
fromXML
public boolean fromXML(java.lang.String xml)
Retrieves the Geospheroid object with the introduced XML string.- Parameters:
xml
- The specified XML string.- Returns:
- Returns true, if successful; otherwise, false.
-
toXML
public java.lang.String toXML()
Exports the object of this GeoSpheroid class to an XML string.- Returns:
- a XML string represents the GeoSpheroid objects.
-
dispose
public void dispose()
Disposes the resources occupied by the object. After calling this method, this object will not be usable.
-
clone
public GeoSpheroid clone()
Perform clone for GeoSpheroid- Overrides:
clone
in classjava.lang.Object
- Returns:
- The clone object of GeoSpheroid
-
-