diff options
| author | Holger Jaekel <holger.jaekel@gmx.de> | 2019-11-21 22:37:39 +0100 |
|---|---|---|
| committer | Leo <thinkabit.ukim@gmail.com> | 2019-11-24 18:33:29 +0100 |
| commit | 7cc9caf0f2ae87b90a3caf4e247d1f833e6024d7 (patch) | |
| tree | 11a9d9819675ea2d7b3af92580971de4630e22b2 /community/proj/TestJni.java | |
| parent | c2da269432e9f3a48f77413d318c534fdc3ea975 (diff) | |
| download | aports-7cc9caf0f2ae87b90a3caf4e247d1f833e6024d7.tar.bz2 aports-7cc9caf0f2ae87b90a3caf4e247d1f833e6024d7.tar.xz | |
community/proj: move from testing
Diffstat (limited to 'community/proj/TestJni.java')
| -rw-r--r-- | community/proj/TestJni.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/community/proj/TestJni.java b/community/proj/TestJni.java new file mode 100644 index 0000000000..6a517849f6 --- /dev/null +++ b/community/proj/TestJni.java @@ -0,0 +1,20 @@ +import org.proj4.*; +import java.util.Arrays; + +/** + * Converts coordinates from EPSG:32632 (WGS 84 / UTM zone 32N) to WGS84, + * then prints the result to the standard output stream. + */ +public class TestJni { + public static void main(String[] args) throws PJException { + PJ sourcePJ = new PJ("+init=epsg:32632"); // (x,y) axis order + PJ targetPJ = new PJ("+proj=latlong +datum=WGS84"); // (λ,φ) axis order + double[] coordinates = { + 500000, 0, // First coordinate + 400000, 100000, // Second coordinate + 600000, -100000 // Third coordinate + }; + sourcePJ.transform(targetPJ, 2, coordinates, 0, 3); + System.out.println(Arrays.toString(coordinates)); + } +} |
