public class

Projection

extends Object
java.lang.Object
   ↳ com.carto.projections.Projection
Known Direct Subclasses

Class Overview

An abstract base class for all projections.

Summary

Public Methods
synchronized void delete()
boolean equals(Object obj)
Checks if this object is equal to the specified object.
MapPos fromLatLong(double lat, double lng)
Transforms a position given using latitutde-longitude coordinates from the WGS84 coordinate system to the coordinate system of this projection.
MapPos fromWgs84(MapPos pos)
Transforms a position from the WGS84 coordinate system to the coordinate system of this projection.
MapBounds getBounds()
Returns the bounds of this projection.
String getName()
Return name of this projection in Well-Known format.
int hashCode()
Returns the hash value of this object.
MapPos toLatLong(double x, double y)
Transforms a position from the coordinate system of this projection to the WGS84 coordinate system latitude-longitute coordinates.
MapPos toWgs84(MapPos pos)
Transforms a position from the coordinate system of this projection to the WGS84 coordinate system.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public MapPos fromLatLong (double lat, double lng)

Transforms a position given using latitutde-longitude coordinates from the WGS84 coordinate system to the coordinate system of this projection.

Parameters
lat The latitude in the WGS84 coordinate system. It should be in range -90..90.
lng The longitude in the WGS84 coordinate system. It should be in range -180..180.
Returns
  • The transformed position in the coordinate system of this projection.

public MapPos fromWgs84 (MapPos pos)

Transforms a position from the WGS84 coordinate system to the coordinate system of this projection.

Parameters
pos The position in the WGS84 coordinate system. It should be encoded as longitude-latitude.
Returns
  • The transformed position in the coordinate system of this projection.

public MapBounds getBounds ()

Returns the bounds of this projection.

Returns
  • The bounds of this projection.

public String getName ()

Return name of this projection in Well-Known format. For example, as "EPSG:3857"

Returns
  • The name of this projection.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public MapPos toLatLong (double x, double y)

Transforms a position from the coordinate system of this projection to the WGS84 coordinate system latitude-longitute coordinates.

Parameters
x The x position in the coordinate system of this projection.
y The y position in the coordinate system of this projection.
Returns
  • The transformed position in the WGS84 coordinate system given as latitude-longitude.

public MapPos toWgs84 (MapPos pos)

Transforms a position from the coordinate system of this projection to the WGS84 coordinate system.

Parameters
pos The position in the coordinate system of this projection.
Returns
  • The transformed position in the WGS84 coordinate system. It is given as longitude-latitude.