Package dev.avelar.mapnik
Class CoordinateTransform
java.lang.Object
dev.avelar.mapnik.CoordinateTransform
- All Implemented Interfaces:
AutoCloseable
Converts points and boxes from a source projection to a destination projection, and back. *
Safe to share between threads: calls on one object take turns. (For speed, give each thread its
own, which takes microseconds to make.)
-
Method Summary
Modifier and TypeMethodDescriptionbackward(double x, double y) A point from the destination projection back to the source projection.A box from the destination back to the source projection.static CoordinateTransformbetween(Projection source, Projection dest) A transform between two projections.static CoordinateTransformA transform between two projections given asepsg:<code>or PROJ strings.voidclose()forward(double x, double y) A point from the source projection to the destination projection.A box from the source to the destination projection: the bounds of its four transformed corners.Likeforward(Box2d), but also samplespointsPerEdgepoints along each edge, so the result covers edges that bulge when projected.booleanTrue if source and destination are the same, so coordinates do not change.
-
Method Details
-
between
A transform between two projections. It copies them, so you may close yours afterwards. -
between
A transform between two projections given asepsg:<code>or PROJ strings. -
isIdentity
public boolean isIdentity()True if source and destination are the same, so coordinates do not change. -
forward
A point from the source projection to the destination projection. -
forward
-
backward
A point from the destination projection back to the source projection. -
backward
-
forward
A box from the source to the destination projection: the bounds of its four transformed corners. -
forward
Likeforward(Box2d), but also samplespointsPerEdgepoints along each edge, so the result covers edges that bulge when projected. Use it for large boxes. -
backward
A box from the destination back to the source projection. -
backward
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-