diff options
| author | Holger Jaekel <holger.jaekel@gmx.de> | 2019-05-31 21:54:00 +0200 |
|---|---|---|
| committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-06-10 11:01:00 +0000 |
| commit | 67dd4f6b150820c30abf4e38516587df5c38b0be (patch) | |
| tree | bdc072dbb80480e44a66f961f5e60765d5a67d5c /testing/proj4/TestJni.java | |
| parent | dcb8c95d3893d02fa5b2752b68f1a7919e4d5179 (diff) | |
| download | aports-67dd4f6b150820c30abf4e38516587df5c38b0be.tar.bz2 aports-67dd4f6b150820c30abf4e38516587df5c38b0be.tar.xz | |
testing/proj4: add java-proj4 subpackage
add subpackage for java bindings
add check()
remove cd "$builddir"
remove empty variables
remove || return 1
Diffstat (limited to 'testing/proj4/TestJni.java')
| -rw-r--r-- | testing/proj4/TestJni.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/proj4/TestJni.java b/testing/proj4/TestJni.java new file mode 100644 index 0000000000..6a517849f6 --- /dev/null +++ b/testing/proj4/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)); + } +} |
