|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.referencing.CRS
Simple utility class for making use of the CoordinateReferenceSystem
and associated Factory
implementations.
Other proposals:
Note: this utility class is made up of static final functions, this class is
not a Factory or a Builder. It makes use of the GeoAPI Factory interfaces
provided by FactoryFinder
in the most direct manner possible.
Nested Class Summary | |
static interface |
CRS.OperationVisitor
Implement this method to visit each available CoordinateOperationFactory
known to FactoryFinder . |
Constructor Summary | |
CRS()
|
Method Summary | |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
decode(java.lang.String code)
Locate for CoordinateReferenceSystem for specific code. |
static double |
distance(com.vividsolutions.jts.geom.Coordinate p1,
com.vividsolutions.jts.geom.Coordinate p2,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
ESTIMATE the distance between the two points. 1. transforms both points to lat/lon 2. find the distance between the two points NOTE: we're using ellipsoid calculations. |
static java.util.Set |
getSupportedCodes(java.lang.String AUTHORITY)
Get list of the codes that are supported by the authority. |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
parseWKT(java.lang.String wkt)
Parse WKT into a CRS object |
static org.opengis.referencing.operation.MathTransform |
transform(org.opengis.referencing.crs.CoordinateReferenceSystem from,
org.opengis.referencing.crs.CoordinateReferenceSystem to)
Grab transform between two CoordianteReference Systems. |
static org.opengis.referencing.operation.MathTransform |
transform(org.opengis.referencing.crs.CoordinateReferenceSystem from,
org.opengis.referencing.crs.CoordinateReferenceSystem to,
boolean lenientTransforms)
Grab transform between two CoordianteReference Systems. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CRS()
Method Detail |
public static org.opengis.referencing.operation.MathTransform transform(org.opengis.referencing.crs.CoordinateReferenceSystem from, org.opengis.referencing.crs.CoordinateReferenceSystem to, boolean lenientTransforms) throws org.opengis.referencing.FactoryException
Sample use:
MathTransform transform = CRS.transform( CRS.decode("EPSG:42102"), CRS.decode("EPSG:4326") );
from
- to
- lenientTransforms
- if true then the transforms created will not throw bursa wolf required exception during datum
shifts if the bursa wolf paramaters are not specified. Instead it will assume a no datum shift.
org.opengis.referencing.FactoryException
- only if MathTransform is unavailable due to errorpublic static org.opengis.referencing.operation.MathTransform transform(org.opengis.referencing.crs.CoordinateReferenceSystem from, org.opengis.referencing.crs.CoordinateReferenceSystem to) throws org.opengis.referencing.FactoryException
Sample use:
MathTransform transform = CRS.transform( CRS.decode("EPSG:42102"), CRS.decode("EPSG:4326") );
from
- to
-
org.opengis.referencing.FactoryException
- only if MathTransform is unavailable due to errorpublic static java.util.Set getSupportedCodes(java.lang.String AUTHORITY)
public static org.opengis.referencing.crs.CoordinateReferenceSystem parseWKT(java.lang.String wkt) throws org.opengis.referencing.FactoryException
org.opengis.referencing.FactoryException
public static org.opengis.referencing.crs.CoordinateReferenceSystem decode(java.lang.String code) throws org.opengis.referencing.NoSuchAuthorityCodeException
Note the code needs to mention the authority.
EPSG:1234
AUTO:42001, ..., ..., ...
code
-
org.opengis.referencing.NoSuchAuthorityCodeException
- If the code could not be understoodpublic static double distance(com.vividsolutions.jts.geom.Coordinate p1, com.vividsolutions.jts.geom.Coordinate p2, org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws java.lang.Exception
p1
- first pointp2
- second pointcrs
- reference system the two points are in
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |