diff options
author | Holger Jaekel <holger.jaekel@gmx.de> | 2019-06-16 14:04:47 +0200 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2019-06-18 10:02:38 -0300 |
commit | 809f32f81f14456ac3dcced8de78dbd8fad20b6a (patch) | |
tree | 0dbb232de370cbb46afca2084f1d3a1068985298 /testing/proj/TestJni.java | |
parent | cf21fb6ee118ddaeda9e8b7c9c22338f053edbef (diff) | |
download | aports-809f32f81f14456ac3dcced8de78dbd8fad20b6a.tar.bz2 aports-809f32f81f14456ac3dcced8de78dbd8fad20b6a.tar.xz |
testing/proj4: rename proj4 to proj
Diffstat (limited to 'testing/proj/TestJni.java')
-rw-r--r-- | testing/proj/TestJni.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/proj/TestJni.java b/testing/proj/TestJni.java new file mode 100644 index 0000000000..6a517849f6 --- /dev/null +++ b/testing/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)); + } +} |