class Projection extends java.lang.Object
A Projection is a cartographic projection or coordinate reference system.
You can create a Projection with an EPSG Code:
Projection p = new Projection("EPSG:4326")
Or with WKT:
Projection p = new Projection("""GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]""")
Type | Name and description |
---|---|
CoordinateReferenceSystem |
crs The wrapped GeoTools CoordinateReferenceSystem |
Constructor and description |
---|
Projection
(CoordinateReferenceSystem crs) Create a new Projection wrapping a GeoTools CoordinateReferenceSystem |
Projection
(Projection p) Create a new Projection from an existing Projection |
Projection
(java.lang.String str) Create a new Projection from a String |
Type Params | Return Type | Name and description |
---|---|---|
|
boolean |
equals(java.lang.Object other) Does this Projection equal the other? |
|
Bounds |
getBounds() Get the extent for this Projection |
|
int |
getEpsg() Get the EPSG code |
|
Bounds |
getGeoBounds() Get the valid geographic area for this Projection |
|
java.lang.String |
getId() Get the Identifier. |
|
java.lang.String |
getSrs(boolean codeOnly) Get the SRS Code |
|
java.lang.String |
getWkt(java.lang.String citation, int indentation) Get the well known text |
|
int |
hashCode() Get the hashcode of this Projection |
|
static java.util.List<Projection> |
projections() Get a List of all supported Projections. |
|
double |
toMeters(double distance) Convert a distance in the Projection's native units to meters. |
|
java.lang.String |
toString() The string representation |
|
Geometry |
transform(Geometry geom, Projection dest) Transform the Geometry to another Projection |
|
Geometry |
transform(Geometry geom, java.lang.String prj) Transform the Geometry to another Projection |
|
static Geometry |
transform(Geometry geom, Projection src, Projection dest) Reproject the Geometry from the source Projection to the destination Projection |
|
static Geometry |
transform(Geometry geom, java.lang.String src, java.lang.String dest) Reproject the Geometry from the source Projection to the destination Projection |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The wrapped GeoTools CoordinateReferenceSystem
Create a new Projection wrapping a GeoTools CoordinateReferenceSystem
crs
- The GeoTools CoordinateReferenceSystemCreate a new Projection from an existing Projection
p
- An existing ProjectionCreate a new Projection from a String
str
- A EPSG ID or WTKDoes this Projection equal the other?
Get the extent for this Projection
Get the EPSG code
Get the valid geographic area for this Projection
Get the Identifier. This can be a very slow operation.
Get the SRS Code
codeOnly
- Whether to include the code only (defaults to false)Get the well known text
citation
- The citation (can be epsg, the default, or esri)indentation
- The number of spaces to indent (defaults to 2)Get the hashcode of this Projection
Get a List of all supported Projections. This is currently reallllllly slow...
Convert a distance in the Projection's native units to meters.
distance
- A distance in the Projection's native unitsThe string representation
Transform the Geometry to another Projection
geom
- The Geometrydest
- The destination ProjectionTransform the Geometry to another Projection
geom
- The Geometrydest
- The destination Projection stringReproject the Geometry from the source Projection to the destination Projection
geom
- The Geometrysrc
- The Projection source/fromdest
- The Projection destination/toReproject the Geometry from the source Projection to the destination Projection
geom
- The Geometrysrc
- The Projection String source/fromdest
- The Projection String destination/toGroovy Documentation