sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1801463 [1/3] - in /sis/branches/JDK8: ide-project/NetBeans/nbproject/ storage/ storage/sis-gdal/ storage/sis-gdal/src/ storage/sis-gdal/src/main/ storage/sis-gdal/src/main/c/ storage/sis-gdal/src/main/java/ storage/sis-gdal/src/main/java/...
Date Mon, 10 Jul 2017 12:51:33 GMT
Author: desruisseaux
Date: Mon Jul 10 12:51:33 2017
New Revision: 1801463

URL: http://svn.apache.org/viewvc?rev=1801463&view=rev
Log:
Initial draft of a JNI bindings for Proj.4. The bindings were initially developped in GeoAPI, and updated by Jean-Loup Amiot.
The Java classes are adapted from geoapi-proj4 module (was in public domain, adaptation done by original author).

Added:
    sis/branches/JDK8/storage/sis-gdal/
    sis/branches/JDK8/storage/sis-gdal/pom.xml
    sis/branches/JDK8/storage/sis-gdal/src/
    sis/branches/JDK8/storage/sis-gdal/src/main/
    sis/branches/JDK8/storage/sis-gdal/src/main/Makefile
    sis/branches/JDK8/storage/sis-gdal/src/main/c/
    sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/c/sharedLibraryAccess.h   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Axis.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRS.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRSFactory.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Operation.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/OperationFactory.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJDatum.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJObject.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Parameter.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/ParameterGroup.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/ResourcesLoader.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/TransformFactory.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/package-info.java   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/org/
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/org/apache/
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/org/apache/sis/
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/org/apache/sis/storage/
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/org/apache/sis/storage/gdal/
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/org/apache/sis/storage/gdal/axis-orientations.txt   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/org/apache/sis/storage/gdal/parameter-names.txt   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/main/resources/org/apache/sis/storage/gdal/projection-names.txt   (with props)
    sis/branches/JDK8/storage/sis-gdal/src/test/
    sis/branches/JDK8/storage/sis-gdal/src/test/java/
    sis/branches/JDK8/storage/sis-gdal/src/test/java/org/
    sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/
    sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/
    sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/
    sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/
    sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/PJTest.java   (with props)
Modified:
    sis/branches/JDK8/ide-project/NetBeans/nbproject/build-impl.xml
    sis/branches/JDK8/ide-project/NetBeans/nbproject/genfiles.properties
    sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties
    sis/branches/JDK8/ide-project/NetBeans/nbproject/project.xml
    sis/branches/JDK8/storage/pom.xml

Modified: sis/branches/JDK8/ide-project/NetBeans/nbproject/build-impl.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/ide-project/NetBeans/nbproject/build-impl.xml?rev=1801463&r1=1801462&r2=1801463&view=diff
==============================================================================
--- sis/branches/JDK8/ide-project/NetBeans/nbproject/build-impl.xml (original)
+++ sis/branches/JDK8/ide-project/NetBeans/nbproject/build-impl.xml Mon Jul 10 12:51:33 2017
@@ -129,6 +129,7 @@ is divided into following sections:
                 <available file="${test.netcdf.dir}"/>
                 <available file="${test.shapefile.dir}"/>
                 <available file="${test.xmlstore.dir}"/>
+                <available file="${test.gdal.dir}"/>
                 <available file="${test.storage.dir}"/>
                 <available file="${test.feature.dir}"/>
                 <available file="${test.referencing.dir}"/>
@@ -148,6 +149,8 @@ is divided into following sections:
                 <available file="${src.netcdf.dir}"/>
                 <available file="${src.shapefile.dir}"/>
                 <available file="${src.xmlstore.dir}"/>
+                <available file="${src.gdal.dir}"/>
+                <available file="${src.c.gdal.dir}"/>
                 <available file="${src.storage.dir}"/>
                 <available file="${src.feature.dir}"/>
                 <available file="${src.referencing.dir}"/>
@@ -265,6 +268,8 @@ is divided into following sections:
         <fail unless="src.netcdf.dir">Must set src.netcdf.dir</fail>
         <fail unless="src.shapefile.dir">Must set src.shapefile.dir</fail>
         <fail unless="src.xmlstore.dir">Must set src.xmlstore.dir</fail>
+        <fail unless="src.gdal.dir">Must set src.gdal.dir</fail>
+        <fail unless="src.c.gdal.dir">Must set src.c.gdal.dir</fail>
         <fail unless="src.storage.dir">Must set src.storage.dir</fail>
         <fail unless="src.feature.dir">Must set src.feature.dir</fail>
         <fail unless="src.referencing.dir">Must set src.referencing.dir</fail>
@@ -279,6 +284,7 @@ is divided into following sections:
         <fail unless="test.netcdf.dir">Must set test.netcdf.dir</fail>
         <fail unless="test.shapefile.dir">Must set test.shapefile.dir</fail>
         <fail unless="test.xmlstore.dir">Must set test.xmlstore.dir</fail>
+        <fail unless="test.gdal.dir">Must set test.gdal.dir</fail>
         <fail unless="test.storage.dir">Must set test.storage.dir</fail>
         <fail unless="test.feature.dir">Must set test.feature.dir</fail>
         <fail unless="test.referencing.dir">Must set test.referencing.dir</fail>
@@ -306,7 +312,7 @@ is divided into following sections:
     </target>
     <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
+            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -347,7 +353,7 @@ is divided into following sections:
     </target>
     <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
+            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -380,7 +386,7 @@ is divided into following sections:
     </target>
     <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
         <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
+            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <sequential>
@@ -488,6 +494,9 @@ is divided into following sections:
                         <fileset dir="${test.xmlstore.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
                         </fileset>
+                        <fileset dir="${test.gdal.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
                         <fileset dir="${test.storage.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
                         </fileset>
@@ -559,6 +568,9 @@ is divided into following sections:
                     <fileset dir="${test.xmlstore.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
                         <filename name="@{testincludes}"/>
                     </fileset>
+                    <fileset dir="${test.gdal.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
+                        <filename name="@{testincludes}"/>
+                    </fileset>
                     <fileset dir="${test.storage.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
                         <filename name="@{testincludes}"/>
                     </fileset>
@@ -710,6 +722,9 @@ is divided into following sections:
                         <fileset dir="${test.xmlstore.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
                         </fileset>
+                        <fileset dir="${test.gdal.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
                         <fileset dir="${test.storage.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
                         </fileset>
@@ -1103,7 +1118,7 @@ is divided into following sections:
                 <include name="*"/>
             </dirset>
         </pathconvert>
-        <j2seproject3:depend srcdir="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}:${build.generated.subdirs}"/>
+        <j2seproject3:depend srcdir="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}:${build.generated.subdirs}"/>
     </target>
     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
         <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
@@ -1116,6 +1131,8 @@ is divided into following sections:
             <fileset dir="${src.netcdf.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.shapefile.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.xmlstore.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.c.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.storage.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.feature.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.referencing.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -1143,7 +1160,7 @@ is divided into following sections:
     <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
         <j2seproject3:force-recompile/>
-        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}"/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}"/>
     </target>
     <target name="-post-compile-single">
         <!-- Empty placeholder for easier customization. -->
@@ -1433,6 +1450,12 @@ is divided into following sections:
             <fileset dir="${src.xmlstore.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
+            <fileset dir="${src.gdal.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.c.gdal.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
             <fileset dir="${src.storage.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
@@ -1485,6 +1508,12 @@ is divided into following sections:
             <fileset dir="${src.xmlstore.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
+            <fileset dir="${src.gdal.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.c.gdal.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
             <fileset dir="${src.storage.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
@@ -1528,10 +1557,10 @@ is divided into following sections:
         <!-- You can override this target in the ../build.xml file. -->
     </target>
     <target if="do.depend.true" name="-compile-test-depend">
-        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.gdal.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
     </target>
     <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
-        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.gdal.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
         <copy todir="${build.test.classes.dir}">
             <fileset dir="${test.webapp.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.console.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -1540,6 +1569,7 @@ is divided into following sections:
             <fileset dir="${test.netcdf.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.shapefile.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.xmlstore.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${test.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.storage.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.feature.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.referencing.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -1561,7 +1591,7 @@ is divided into following sections:
     <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
         <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
-        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.gdal.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.gdal.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
         <copy todir="${build.test.classes.dir}">
             <fileset dir="${test.webapp.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.console.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -1570,6 +1600,7 @@ is divided into following sections:
             <fileset dir="${test.netcdf.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.shapefile.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.xmlstore.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${test.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.storage.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.feature.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.referencing.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>

Modified: sis/branches/JDK8/ide-project/NetBeans/nbproject/genfiles.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/ide-project/NetBeans/nbproject/genfiles.properties?rev=1801463&r1=1801462&r2=1801463&view=diff
==============================================================================
--- sis/branches/JDK8/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] Mon Jul 10 12:51:33 2017
@@ -3,6 +3,6 @@
 build.xml.data.CRC32=58e6b21c
 build.xml.script.CRC32=462eaba0
 build.xml.stylesheet.CRC32=28e38971@1.53.1.46
-nbproject/build-impl.xml.data.CRC32=f7767470
-nbproject/build-impl.xml.script.CRC32=254cb1ce
+nbproject/build-impl.xml.data.CRC32=2845adb3
+nbproject/build-impl.xml.script.CRC32=e0d2517f
 nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48

Modified: sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties?rev=1801463&r1=1801462&r2=1801463&view=diff
==============================================================================
--- sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Mon Jul 10 12:51:33 2017
@@ -61,6 +61,9 @@ src.shapefile.dir    = ${project.root}/s
 test.shapefile.dir   = ${project.root}/storage/sis-shapefile/src/test/java
 src.xmlstore.dir     = ${project.root}/storage/sis-xmlstore/src/main/java
 test.xmlstore.dir    = ${project.root}/storage/sis-xmlstore/src/test/java
+src.gdal.dir         = ${project.root}/storage/sis-gdal/src/main/java
+src.c.gdal.dir       = ${project.root}/storage/sis-gdal/src/main/c
+test.gdal.dir        = ${project.root}/storage/sis-gdal/src/test/java
 src.storage.dir      = ${project.root}/storage/sis-storage/src/main/java
 test.storage.dir     = ${project.root}/storage/sis-storage/src/test/java
 src.feature.dir      = ${project.root}/core/sis-feature/src/main/java

Modified: sis/branches/JDK8/ide-project/NetBeans/nbproject/project.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/ide-project/NetBeans/nbproject/project.xml?rev=1801463&r1=1801462&r2=1801463&view=diff
==============================================================================
--- sis/branches/JDK8/ide-project/NetBeans/nbproject/project.xml (original)
+++ sis/branches/JDK8/ide-project/NetBeans/nbproject/project.xml Mon Jul 10 12:51:33 2017
@@ -31,6 +31,8 @@
                 <root id="src.netcdf.dir" name="NetCDF"/>
                 <root id="src.shapefile.dir" name="Shapefile"/>
                 <root id="src.xmlstore.dir" name="XMLStore"/>
+                <root id="src.gdal.dir" name="GDAL/Proj4"/>
+                <root id="src.c.gdal.dir" name="GDAL/Proj4 JNI"/>
                 <root id="src.storage.dir" name="Storage"/>
                 <root id="src.feature.dir" name="Feature"/>
                 <root id="src.referencing.dir" name="Referencing"/>
@@ -47,6 +49,7 @@
                 <root id="test.netcdf.dir" name="Test NetCDF"/>
                 <root id="test.shapefile.dir" name="Test Shapefile"/>
                 <root id="test.xmlstore.dir" name="Test XMLStore"/>
+                <root id="test.gdal.dir" name="Test GDAL/Proj4"/>
                 <root id="test.storage.dir" name="Test Storage"/>
                 <root id="test.feature.dir" name="Test Feature"/>
                 <root id="test.referencing.dir" name="Test Referencing"/>

Modified: sis/branches/JDK8/storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/pom.xml?rev=1801463&r1=1801462&r2=1801463&view=diff
==============================================================================
--- sis/branches/JDK8/storage/pom.xml (original)
+++ sis/branches/JDK8/storage/pom.xml Mon Jul 10 12:51:33 2017
@@ -164,6 +164,7 @@
     <module>sis-geotiff</module>
     <module>sis-xmlstore</module>
     <module>sis-earth-observation</module>
+    <module>sis-gdal</module>
   </modules>
 
 </project>

Added: sis/branches/JDK8/storage/sis-gdal/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/pom.xml?rev=1801463&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/pom.xml (added)
+++ sis/branches/JDK8/storage/sis-gdal/pom.xml Mon Jul 10 12:51:33 2017
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns              = "http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi          = "http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0
+                               http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.sis</groupId>
+    <artifactId>storage</artifactId>
+    <version>0.8-jdk8-SNAPSHOT</version>
+  </parent>
+
+
+  <!-- ===========================================================
+           Module Description
+       =========================================================== -->
+  <groupId>org.apache.sis.storage</groupId>
+  <artifactId>sis-gdal</artifactId>
+  <packaging>bundle</packaging>
+  <name>Apache SIS bindings for Proj4</name>
+  <description>
+  <!-- Left alignment because this description will be copied in META-INF/MANIFEST.MF
+       The leading space after the first line is necessary for proper formatting. -->
+Referencing services from Proj4 through GeoAPI interfaces.
+  </description>
+
+
+  <!-- ===========================================================
+           Developers and Contributors
+       =========================================================== -->
+  <developers>
+    <developer>
+      <name>Martin Desruisseaux</name>
+      <id>desruisseaux</id>
+      <email>desruisseaux@apache.org</email>
+      <organization>Geomatys</organization>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
+      <timezone>+1</timezone>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </developer>
+    <developer>
+      <name>Jean-Loup Amiot</name>
+      <organization>Geomatys</organization>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
+      <timezone>+1</timezone>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </developer>
+  </developers>
+
+
+  <!-- ===========================================================
+           Build configuration
+       =========================================================== -->
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Bundle-SymbolicName>org.apache.sis.storage.gdal</Bundle-SymbolicName>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+
+  <!-- ===========================================================
+           Dependencies
+       =========================================================== -->
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.sis.core</groupId>
+      <artifactId>sis-referencing</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>

Added: sis/branches/JDK8/storage/sis-gdal/src/main/Makefile
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/main/Makefile?rev=1801463&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/main/Makefile (added)
+++ sis/branches/JDK8/storage/sis-gdal/src/main/Makefile Mon Jul 10 12:51:33 2017
@@ -0,0 +1,10 @@
+FLAG=-shared -fPIC
+INCLUDE_DIR=-I$(JAVA_HOME)include -I$(JAVA_HOME)include/linux -I/home/amiotj/Documents/geomatys/proj.4/src
+LIB=-lm -ldl
+
+OUT=libproj-binding.so
+
+
+all:
+    gcc $(FLAG) -o $(OUT) c/jniproj.c $(INCLUDE_DIR) $(LIB)
+    mv $(OUT) resources/

Added: sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c?rev=1801463&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c (added)
+++ sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c [UTF-8] Mon Jul 10 12:51:33 2017
@@ -0,0 +1,474 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <proj_config.h>
+
+#include <math.h>
+#include <string.h>
+#include <projects.h>
+#include <stdbool.h>
+#include <jni.h>
+
+#include "sharedLibraryAccess.h"
+#include "org_apache_sis_storage_gdal_PJ.h"
+
+
+#define PJ_FIELD_NAME "ptr"
+#define PJ_FIELD_TYPE "J"
+
+
+
+void throw_exception(JNIEnv* env, const char* message) {
+    (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/RuntimeException"), NULL);
+}
+
+bool isInit = false;
+
+const char* (*pj_get_release_ptr)();
+projPJ      (*pj_init_plus_ptr)(const char* definition);
+projPJ      (*pj_latlong_from_proj_ptr)(projPJ pj_in);
+char*       (*pj_get_def_ptr)(projPJ pj, int options);
+void        (*pj_dalloc_ptr)(void* ptr);
+int         (*pj_is_latlong_ptr)(projPJ pj);
+int         (*pj_is_geocent_ptr)(projPJ pj);
+int         (*pj_transform_ptr)(projPJ srcdefn, projPJ dstdefn, long point_count, int point_offset, double* x, double* y, double *z);
+char*       (*pj_strerrno_ptr)(int);
+int         (*pj_ctx_get_errno_ptr)(projCtx ctx);
+void        (*pj_free_ptr)(projPJ pj);
+
+void Java_org_apache_sis_storage_gdal_PJ_init(JNIEnv* env, jclass class) {
+    void* handle = dlopen("libproj.so", RTLD_LAZY);
+    if (!handle) {
+        throw_exception(env, "Can't open .so");
+        return;
+    }
+    dlerror();
+
+    pj_get_release_ptr =       dlsym(handle, "pj_get_release");
+    pj_init_plus_ptr =         dlsym(handle, "pj_init_plus");
+    pj_latlong_from_proj_ptr = dlsym(handle, "pj_latlong_from_proj");
+    pj_get_def_ptr =           dlsym(handle, "pj_get_def");
+    pj_dalloc_ptr =            dlsym(handle, "pj_dalloc");
+    pj_is_latlong_ptr =        dlsym(handle, "pj_is_latlong");
+    pj_is_geocent_ptr =        dlsym(handle, "pj_is_geocent");
+    pj_transform_ptr =         dlsym(handle, "pj_transform");
+    pj_strerrno_ptr =          dlsym(handle, "pj_strerrno");
+    pj_ctx_get_errno_ptr =     dlsym(handle, "pj_ctx_get_errno");
+    pj_free_ptr =              dlsym(handle, "pj_free");
+
+    char* error = dlerror();
+    if (error) {
+        throw_exception(env, error);
+        return;
+    }
+    isInit = true;
+}
+
+/*!
+ * \brief
+ * Internal method returning the address of the PJ structure wrapped by the given Java object.
+ * This function looks for a field named "ptr" and of type "long" (Java signature "J") in the
+ * given object.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The address of the PJ structure, or NULL if the operation fails (for example
+ *         because the "ptr" field was not found).
+ */
+PJ *getPJ(JNIEnv *env, jobject object)
+{
+    jfieldID id = (*env)->GetFieldID(env, (*env)->GetObjectClass(env, object), PJ_FIELD_NAME, PJ_FIELD_TYPE);
+    return (id) ? (PJ*) (*env)->GetLongField(env, object, id) : NULL;
+}
+
+/*!
+ * \brief
+ * Returns the Proj4 release number.
+ *
+ * \param  env   - The JNI environment.
+ * \param  class - The class from which this method has been invoked.
+ * \return The Proj4 release number, or NULL.
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getVersion
+  (JNIEnv *env, jclass class)
+{
+    const char *desc = pj_get_release_ptr();
+    return (desc) ? (*env)->NewStringUTF(env, desc) : NULL;
+}
+
+/*!
+ * \brief
+ * Allocates a new PJ structure from a definition string.
+ *
+ * \param  env        - The JNI environment.
+ * \param  class      - The class from which this method has been invoked.
+ * \param  definition - The string definition to be given to Proj4.
+ * \return The address of the new PJ structure, or 0 in case of failure.
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_sis_storage_gdal_PJ_allocatePJ
+  (JNIEnv *env, jclass class, jstring definition)
+{
+    const char *def_utf = (*env)->GetStringUTFChars(env, definition, NULL);
+    if (!def_utf) return 0;             // OutOfMemoryError already thrown.
+    PJ *pj = pj_init_plus_ptr(def_utf);
+    (*env)->ReleaseStringUTFChars(env, definition, def_utf);
+    return (jlong) pj;
+}
+
+/*!
+ * \brief
+ * Allocates a new geographic PJ structure from an existing one.
+ *
+ * \param  env       - The JNI environment.
+ * \param  class     - The class from which this method has been invoked.
+ * \param  projected - The PJ object from which to derive a new one.
+ * \return The address of the new PJ structure, or 0 in case of failure.
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_sis_storage_gdal_PJ_allocateGeoPJ
+  (JNIEnv *env, jclass class, jobject projected)
+{
+    PJ *pj = getPJ(env, projected);
+    return (pj) ? (jlong) pj_latlong_from_proj_ptr(pj) : 0;
+}
+
+/*!
+ * \brief
+ * Returns the definition string.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The definition string.
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getDefinition
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    if (pj) {
+        const char *desc = pj_get_def_ptr(pj, 0);
+        if (desc) {
+            jstring str = (*env)->NewStringUTF(env, desc);
+            pj_dalloc_ptr(desc);
+            return str;
+        }
+    }
+    return NULL;
+}
+
+/*!
+ * \brief
+ * Returns the description associated to the PJ structure.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The description associated to the PJ structure.
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_toString
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    if (pj) {
+        const char *desc = pj->descr;
+        if (desc) {
+            return (*env)->NewStringUTF(env, desc);
+        }
+    }
+    return NULL;
+}
+
+/*!
+ * \brief
+ * Returns the CRS type as one of the PJ.Type enum: GEOGRAPHIC, GEOCENTRIC or PROJECTED.
+ * This function should never return NULL, unless class or fields have been renamed in
+ * such a way that we can not find anymore the expected enum values.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The CRS type as one of the PJ.Type enum.
+ */
+JNIEXPORT jobject JNICALL Java_org_apache_sis_storage_gdal_PJ_getType
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    if (pj) {
+        const char *type;
+        if (pj_is_latlong_ptr(pj)) {
+            type = "GEOGRAPHIC";
+        } else if (pj_is_geocent_ptr(pj)) {
+            type = "GEOCENTRIC";
+        } else {
+            type = "PROJECTED";
+        }
+        jclass c = (*env)->FindClass(env, "org/apache/sis/storage/gdal/PJ$Type");
+        if (c) {
+            jfieldID id = (*env)->GetStaticFieldID(env, c, type, "Lorg/apache/sis/storage/gdal/PJ$Type;");
+            if (id) {
+                return (*env)->GetStaticObjectField(env, c, id);
+            }
+        }
+    }
+    return NULL;
+}
+
+/*!
+ * \brief
+ * Returns the semi-major axis length.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The semi-major axis length.
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getSemiMajorAxis
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    return pj ? pj->a_orig : NAN;
+}
+
+/*!
+ * \brief
+ * Computes the semi-minor axis length from the semi-major axis length and the eccentricity
+ * squared.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The semi-minor axis length.
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getSemiMinorAxis
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    if (!pj) return NAN;
+    double a = pj->a_orig;
+    return sqrt(a*a * (1.0 - pj->es_orig));
+}
+
+/*!
+ * \brief
+ * Returns the eccentricity squared.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The eccentricity.
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getEccentricitySquared
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    return pj ? pj->es_orig : NAN;
+}
+
+/*!
+ * \brief
+ * Returns an array of character indicating the direction of each axis.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The axis directions.
+ */
+JNIEXPORT jcharArray JNICALL Java_org_apache_sis_storage_gdal_PJ_getAxisDirections
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    if (pj) {
+        int length = strlen(pj->axis);
+        jcharArray array = (*env)->NewCharArray(env, length);
+        if (array) {
+            jchar* axis = (*env)->GetCharArrayElements(env, array, NULL);
+            if (axis) {
+                // Don't use memcp because the type may not be the same.
+                int i;
+                for (i=0; i<length; i++) {
+                    axis[i] = pj->axis[i];
+                }
+                (*env)->ReleaseCharArrayElements(env, array, axis, 0);
+            }
+            return array;
+        }
+    }
+    return NULL;
+}
+
+/*!
+ * \brief
+ * Longitude of the prime meridian measured from the Greenwich meridian, positive eastward.
+ *
+ * \param env    - The JNI environment.
+ * \param object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The prime meridian longitude, in degrees.
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getGreenwichLongitude
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    return (pj) ? (pj->from_greenwich)*(180/M_PI) : NAN;
+}
+
+/*!
+ * \brief
+ * Returns the conversion factor from linear units to metres.
+ *
+ * \param env      - The JNI environment.
+ * \param object   - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \param vertical - JNI_FALSE for horizontal axes, or JNI_TRUE for the vertical axis.
+ * \return The conversion factor to metres.
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getLinearUnitToMetre
+  (JNIEnv *env, jobject object, jboolean vertical)
+{
+    PJ *pj = getPJ(env, object);
+    if (pj) {
+        return (vertical) ? pj->vto_meter : pj->to_meter;
+    }
+    return NAN;
+}
+
+/*!
+ * \brief
+ * Converts input values from degrees to radians before coordinate operation, or the output
+ * values from radians to degrees after the coordinate operation.
+ *
+ * \param pj        - The Proj.4 PJ structure.
+ * \param data      - The coordinate array to transform.
+ * \param numPts    - Number of points to transform.
+ * \param dimension - Dimension of points in the coordinate array.
+ * \param factor    - The scale factor to apply: M_PI/180 for inputs or 180/M_PI for outputs.
+ */
+void convertAngularOrdinates(PJ *pj, double* data, jint numPts, int dimension, double factor) {
+    int dimToSkip;
+    if (pj_is_latlong_ptr(pj)) {
+        // Convert only the 2 first ordinates and skip all the other dimensions.
+        dimToSkip = dimension - 2;
+    } else if (pj_is_geocent_ptr(pj)) {
+        // Convert only the 3 first ordinates and skip all the other dimensions.
+        dimToSkip = dimension - 3;
+    } else {
+        // Not a geographic or geocentric CRS: nothing to convert.
+        return;
+    }
+    double *stop = data + dimension*numPts;
+    if (dimToSkip > 0) {
+        while (data != stop) {
+            (*data++) *= factor;
+            (*data++) *= factor;
+            data += dimToSkip;
+        }
+    } else {
+        while (data != stop) {
+            (*data++) *= factor;
+        }
+    }
+}
+
+/*!
+ * \brief
+ * Transforms in-place the coordinates in the given array.
+ *
+ * \param env         - The JNI environment.
+ * \param object      - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \param target      - The target CRS.
+ * \param dimension   - The dimension of each coordinate value. Must be equals or greater than 2.
+ * \param coordinates - The coordinates to transform, as a sequence of (x,y,<z>,...) tuples.
+ * \param offset      - Offset of the first coordinate in the given array.
+ * \param numPts      - Number of points to transform.
+ */
+JNIEXPORT void JNICALL Java_org_apache_sis_storage_gdal_PJ_transform
+  (JNIEnv *env, jobject object, jobject target, jint dimension, jdoubleArray coordinates, jint offset, jint numPts)
+{
+    if (!target || !coordinates) {
+        jclass c = (*env)->FindClass(env, "java/lang/NullPointerException");
+        if (c) (*env)->ThrowNew(env, c, "The target CRS and the coordinates array can not be null.");
+        return;
+    }
+    if (dimension < 2 || dimension > 100) { // Arbitrary upper value for catching potential misuse.
+        jclass c = (*env)->FindClass(env, "java/lang/IllegalArgumentException");
+        if (c) (*env)->ThrowNew(env, c, "Illegal dimension. Must be in the [2-100] range.");
+        return;
+    }
+    if ((offset < 0) || (numPts < 0) || (offset + dimension*numPts) > (*env)->GetArrayLength(env, coordinates)) {
+        jclass c = (*env)->FindClass(env, "java/lang/ArrayIndexOutOfBoundsException");
+        if (c) (*env)->ThrowNew(env, c, "Illegal offset or illegal number of points.");
+        return;
+    }
+    PJ *src_pj = getPJ(env, object);
+    PJ *dst_pj = getPJ(env, target);
+    if (src_pj && dst_pj) {
+        // Using GetPrimitiveArrayCritical/ReleasePrimitiveArrayCritical rather than
+        // GetDoubleArrayElements/ReleaseDoubleArrayElements increase the chances that
+        // the JVM returns direct reference to its internal array without copying data.
+        // However we must promise to run the "critical" code fast, to not make any
+        // system call that may wait for the JVM and to not invoke any other JNI method.
+        double *data = (*env)->GetPrimitiveArrayCritical(env, coordinates, NULL);
+        if (data) {
+            double *x = data + offset;
+            double *y = x + 1;
+            double *z = (dimension >= 3) ? y+1 : NULL;
+            convertAngularOrdinates(src_pj, x, numPts, dimension, M_PI/180);
+            int err = pj_transform_ptr(src_pj, dst_pj, numPts, dimension, x, y, z);
+            convertAngularOrdinates(dst_pj, x, numPts, dimension, 180/M_PI);
+            (*env)->ReleasePrimitiveArrayCritical(env, coordinates, data, 0);
+            if (err) {
+                jclass c = (*env)->FindClass(env, "org/opengis/referencing/operation/TransformException");
+                if (c) (*env)->ThrowNew(env, c, pj_strerrno_ptr(err));
+            }
+        }
+    }
+}
+
+/*!
+ * \brief
+ * Returns a description of the last error that occurred, or NULL if none.
+ *
+ * \param  env    - The JNI environment.
+ * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ * \return The last error, or NULL.
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getLastError
+  (JNIEnv *env, jobject object)
+{
+    PJ *pj = getPJ(env, object);
+    if (pj) {
+        int err = pj_ctx_get_errno_ptr(pj->ctx);
+        if (err) {
+            return (*env)->NewStringUTF(env, pj_strerrno_ptr(err));
+        }
+    }
+    return NULL;
+}
+
+/*!
+ * \brief
+ * Deallocate the PJ structure. This method is invoked by the garbage collector exactly once.
+ * This method will also set the Java "ptr" final field to 0 as a safety. In theory we are not
+ * supposed to change the value of a final field. But no Java code should use this field, and
+ * the PJ object is being garbage collected anyway. We set the field to 0 as a safety in case
+ * some user invoked the finalize() method explicitely despite our warning in the Javadoc to
+ * never do such thing.
+ *
+ * \param env    - The JNI environment.
+ * \param object - The Java object wrapping the PJ structure (not allowed to be NULL).
+ */
+JNIEXPORT void JNICALL Java_org_apache_sis_storage_gdal_PJ_finalize
+  (JNIEnv *env, jobject object)
+{
+    jfieldID id = (*env)->GetFieldID(env, (*env)->GetObjectClass(env, object), PJ_FIELD_NAME, PJ_FIELD_TYPE);
+    if (id) {
+        PJ *pj = (PJ*) (*env)->GetLongField(env, object, id);
+        if (pj) {
+            (*env)->SetLongField(env, object, id, (jlong) 0);
+            pj_free_ptr(pj);
+        }
+    }
+}

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h?rev=1801463&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h (added)
+++ sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h [UTF-8] Mon Jul 10 12:51:33 2017
@@ -0,0 +1,143 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_apache_sis_storage_gdal_PJ */
+
+#ifndef _Included_org_apache_sis_storage_gdal_PJ
+#define _Included_org_apache_sis_storage_gdal_PJ
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef org_apache_sis_storage_gdal_PJ_DIMENSION_MAX
+#define org_apache_sis_storage_gdal_PJ_DIMENSION_MAX 100L
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_apache_sis_storage_gdal_PJ_init
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    allocatePJ
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_sis_storage_gdal_PJ_allocatePJ
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    allocateGeoPJ
+ * Signature: (Lorg/apache/sis/storage/gdal/PJ;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_apache_sis_storage_gdal_PJ_allocateGeoPJ
+  (JNIEnv *, jclass, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getVersion
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getVersion
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getDefinition
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getDefinition
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getType
+ * Signature: ()Lorg/apache/sis/storage/gdal/PJ/Type;
+ */
+JNIEXPORT jobject JNICALL Java_org_apache_sis_storage_gdal_PJ_getType
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getSemiMajorAxis
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getSemiMajorAxis
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getSemiMinorAxis
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getSemiMinorAxis
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getEccentricitySquared
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getEccentricitySquared
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getAxisDirections
+ * Signature: ()[C
+ */
+JNIEXPORT jcharArray JNICALL Java_org_apache_sis_storage_gdal_PJ_getAxisDirections
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getGreenwichLongitude
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getGreenwichLongitude
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getLinearUnitToMetre
+ * Signature: (Z)D
+ */
+JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getLinearUnitToMetre
+  (JNIEnv *, jobject, jboolean);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    transform
+ * Signature: (Lorg/apache/sis/storage/gdal/PJ;I[DII)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_sis_storage_gdal_PJ_transform
+  (JNIEnv *, jobject, jobject, jint, jdoubleArray, jint, jint);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getLastError
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getLastError
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    toString
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_toString
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    finalize
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_apache_sis_storage_gdal_PJ_finalize
+  (JNIEnv *, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/storage/sis-gdal/src/main/c/sharedLibraryAccess.h
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/main/c/sharedLibraryAccess.h?rev=1801463&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/main/c/sharedLibraryAccess.h (added)
+++ sis/branches/JDK8/storage/sis-gdal/src/main/c/sharedLibraryAccess.h [UTF-8] Mon Jul 10 12:51:33 2017
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#if defined(_WIN32)
+#include <Windows.h>
+#elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
+#include <dlfcn.h>
+#else
+#error Unsupported platform.
+#endif
+
+
+/*
+ * Handler or pointer to a function of the shared library.
+ */
+#if defined(_WIN32)
+    #define DL_HANDLER HMODULE
+#else
+    #define DL_HANDLER void*
+#endif
+
+
+/*
+ * Opens a library of shared objects and prepares it for use.
+ * The PATH parameter is a 'const char*'  to the library name.
+ * The return value is an opaque 'DL_HANDLER' to the library.
+ */
+#if defined (_WIN32)
+    #define DL_OPEN(PATH) LoadLibrary(PATH);
+#else
+    #define DL_OPEN(PATH) dlopen(PATH, RTLD_LAZY);
+#endif
+
+
+/*
+ * Returns a pointer to the function of the given name.
+ * The HANDLE parameter is the value returned by DL_OPEN
+ * and the NAME parameter is a 'const char*' to the library name.
+ * The return value is a 'void*'.
+ */
+#if defined(_WIN32)
+    #define DL_FUNCTION(HANDLE, NAME) GetProcAddress(HANDLE, NAME);
+#else
+    #define DL_FUNCTION(HANDLE, NAME) dlsym(HANDLE, NAME);
+#endif
+
+
+/*
+ * Closes a library after use.
+ * The HANDLE parameter is the value returned by DL_OPEN.
+ */
+#if defined(_WIN32)
+    #define DL_CLOSE(HANDLE) FreeLibrary(HANDLE)
+#else
+    #define DL_CLOSE(HANDLE) dlclose(HANDLE)
+#endif

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/c/sharedLibraryAccess.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/c/sharedLibraryAccess.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Axis.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Axis.java?rev=1801463&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Axis.java (added)
+++ sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Axis.java [UTF-8] Mon Jul 10 12:51:33 2017
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.gdal;
+
+import javax.measure.Unit;
+import org.opengis.metadata.Identifier;
+import org.opengis.referencing.cs.RangeMeaning;
+import org.opengis.referencing.cs.AxisDirection;
+import org.opengis.referencing.cs.CoordinateSystemAxis;
+import org.apache.sis.internal.simple.SimpleIdentifier;
+import org.apache.sis.measure.Units;
+
+
+/**
+ * An axis of a {@link CRS} object.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.8
+ * @since   0.8
+ * @module
+ */
+final class Axis extends PJObject implements CoordinateSystemAxis {
+    /**
+     * The direction, as a 'e', 'w', 'n', 's', 'u' or 'd' letter.
+     */
+    private final char direction;
+
+    /**
+     * The axis unit. If angular, then the CRS is presumed geographic or geocentric
+     * and the units is fixed to {@link Units#DEGREE} (no other angular unit is permitted).
+     * Otherwise the CRS is presumed projected with arbitrary linear unit.
+     */
+    private final Unit<?> unit;
+
+    /**
+     * Creates a new axis.
+     */
+    Axis(final char direction, final Unit<?> unit) {
+        super(getName(direction, unit));
+        this.direction = direction;
+        this.unit = unit;
+    }
+
+    /**
+     * Work around for RFE #4093999 in Sun's bug database
+     * ("Relax constraint on placement of this()/super() call in constructors").
+     */
+    private static Identifier getName(final char direction, final Unit<?> unit) {
+        final String name;
+        if (Units.isAngular(unit)) {
+            switch (direction) {
+                case 'e':
+                case 'w': name = "Geodetic longitude"; break;
+                case 'n':
+                case 's': name = "Geodetic latitude"; break;
+                case 'u': name = "Height"; break;
+                case 'd': name = "Depth"; break;
+                default: return null;
+            }
+        } else {
+            switch (direction) {
+                case 'e': name = "Easting"; break;
+                case 'w': name = "Westing"; break;
+                case 'n': name = "Northing"; break;
+                case 's': name = "Southing"; break;
+                case 'u': name = "Height"; break;
+                case 'd': name = "Depth"; break;
+                default: return null;
+            }
+        }
+        return new SimpleIdentifier(null, name, false);
+    }
+
+    /**
+     * Returns the abbreviation, which is inferred from the unit and direction.
+     */
+    @Override
+    public String getAbbreviation() {
+        if (Units.isAngular(unit)) {
+            switch (direction) {
+                case 'e':
+                case 'w': return "λ";
+                case 'n':
+                case 's': return "φ";
+            }
+        } else {
+            switch (direction) {
+                case 'e':
+                case 'w': return "x";
+                case 'n':
+                case 's': return "y";
+            }
+        }
+        switch (direction) {
+            case 'u': return "h";
+            case 'd': return "d";
+            default:  return null;
+        }
+    }
+
+    /**
+     * Returns the direction.
+     */
+    @Override
+    public AxisDirection getDirection() {
+        final AxisDirection dir;
+        switch (direction) {
+            case 'e': dir = AxisDirection.EAST;  break;
+            case 'w': dir = AxisDirection.WEST;  break;
+            case 'n': dir = AxisDirection.NORTH; break;
+            case 's': dir = AxisDirection.SOUTH; break;
+            case 'u': dir = AxisDirection.UP;    break;
+            case 'd': dir = AxisDirection.DOWN;  break;
+            default:  dir = null; break;
+        }
+        return dir;
+    }
+
+    /**
+     * Returns the minimal value permitted by this axis.
+     */
+    @Override
+    public double getMinimumValue() {
+        return -getMaximumValue();
+    }
+
+    /**
+     * Returns the minimal value permitted by this axis.
+     */
+    @Override
+    public double getMaximumValue() {
+        if (Units.isAngular(unit)) {
+            switch (direction) {
+                case 'e':
+                case 'w': return 180;
+                case 'n':
+                case 's': return 90;
+            }
+        }
+        return Double.POSITIVE_INFINITY;
+    }
+
+    /**
+     * Returns the range meaning.
+     */
+    @Override
+    public RangeMeaning getRangeMeaning() {
+        if (Units.isAngular(unit)) {
+            switch (direction) {
+                case 'e':
+                case 'w': return RangeMeaning.WRAPAROUND;
+                case 'n':
+                case 's': return RangeMeaning.EXACT;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the units given at construction time.
+     */
+    @Override
+    public Unit<?> getUnit() {
+        return unit;
+    }
+}

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Axis.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Axis.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRS.java?rev=1801463&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRS.java (added)
+++ sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRS.java [UTF-8] Mon Jul 10 12:51:33 2017
@@ -0,0 +1,252 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.gdal;
+
+import javax.measure.Unit;
+import org.opengis.metadata.Identifier;
+import org.opengis.referencing.cs.CartesianCS;
+import org.opengis.referencing.cs.EllipsoidalCS;
+import org.opengis.referencing.cs.CoordinateSystem;
+import org.opengis.referencing.cs.CoordinateSystemAxis;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.crs.GeographicCRS;
+import org.opengis.referencing.crs.GeocentricCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
+import org.opengis.referencing.datum.GeodeticDatum;
+import org.opengis.referencing.operation.Projection;
+
+import org.apache.sis.measure.Units;
+
+
+/**
+ * Base class of all CRS defined in the Proj4 package. The Proj.4 library does not make distinction between
+ * Coordinate System and Coordinate Reference System, so we implement the two interfaces by the same class.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.8
+ * @since   0.8
+ * @module
+ */
+class CRS extends PJObject implements CoordinateReferenceSystem, CoordinateSystem {
+    /**
+     * The geodetic datum, which is also the object to use for performing call to Proj4 functions.
+     */
+    final PJDatum pj;
+
+    /**
+     * The coordinate system axes. The length of this array is the dimension,
+     * which must be greater than or equals to 2.
+     */
+    final CoordinateSystemAxis[] axes;
+
+    /**
+     * Creates a new CRS using the given identifier, Proj4 peer and number of dimensions.
+     *
+     * @param identifier  the name of the new CRS, or {@code null} if none.
+     * @param datum       the geodetic datum, which is also the wrapper for Proj.4 native methods.
+     * @param dimension   the number of dimensions of the new CRS. Must be at least 2.
+     * @param unit        the horizontal axes unit.
+     */
+    CRS(final Identifier identifier, final PJDatum datum, final int dimension, final Unit<?> unit) {
+        super(identifier);
+        pj = datum;
+        axes = new CoordinateSystemAxis[dimension];
+        final char[] dir = datum.getAxisDirections();
+        for (int i=0; i<dimension; i++) {
+            final char d = (i < dir.length) ? Character.toLowerCase(dir[i]) : ' ';
+            axes[i] = new Axis(d, (d == 'u' || d == 'd') ? datum.getLinearUnit(true) : unit);
+        }
+    }
+
+    /**
+     * Returns a string representation of this object, mostly for debugging purpose.
+     * This string representation may change in any future version.
+     */
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + '[' + pj.getDefinition() + ']';
+    }
+
+    /**
+     * Returns the geodetic datum.
+     */
+    public final GeodeticDatum getDatum() {
+        return pj;
+    }
+
+    /**
+     * Returns the coordinate system, which is this object since Proj4 does not distinguish CS and CRS.
+     */
+    @Override
+    public CoordinateSystem getCoordinateSystem() {
+        return this;
+    }
+
+    /**
+     * Returns the coordinate axis at the given dimension.
+     */
+    @Override
+    public final CoordinateSystemAxis getAxis(final int dimension) throws IndexOutOfBoundsException {
+        return axes[dimension];
+    }
+
+    /**
+     * Returns the number of dimension given at construction time.
+     */
+    @Override
+    public final int getDimension() {
+        return axes.length;
+    }
+
+    /**
+     * The geocentric specialization of {@link CRS}.
+     */
+    static final class Geocentric extends CRS implements GeocentricCRS {
+        Geocentric(final Identifier identifier, final PJDatum datum, final int dimension) {
+            super(identifier, datum, dimension, Units.DEGREE);
+        }
+    }
+
+    /**
+     * The geographic specialization of {@link CRS}.
+     */
+    static final class Geographic extends CRS implements GeographicCRS, EllipsoidalCS {
+        Geographic(final Identifier identifier, final PJDatum datum, final int dimension) {
+            super(identifier, datum, dimension, Units.DEGREE);
+        }
+
+        @Override
+        public EllipsoidalCS getCoordinateSystem() {
+            return this;
+        }
+    }
+
+    /**
+     * The projected specialization of {@link CRS}.
+     */
+    static final class Projected extends CRS implements ProjectedCRS, CartesianCS {
+        /**
+         * The axis orientation of this CRS, as a comma-separated list of Proj.4 declarations.
+         * The first element (typically {@code "enu"} is for the projected CRS itself - not
+         * really used since it should already be contained in the {@link #pj} object. The
+         * second element (typically {@code "neu"}) is for the base CRS.
+         *
+         * <p>This field may be {@code null} if this information was unspecified.</p>
+         */
+        private final String axisOrientations;
+
+        /**
+         * The value returned by {@link #getBaseCRS()}, created when first needed.
+         */
+        transient Geographic baseCRS;
+
+        /**
+         * The value returned by {@link #getConversionFromBase()}, created when first needed.
+         */
+        private transient Projection conversion;
+
+        /**
+         * Creates a new projected CRS.
+         */
+        Projected(final Identifier identifier, final PJDatum datum, final int dimension,
+                final String axisOrientations)
+        {
+            super(identifier, datum, dimension, datum.getLinearUnit(false));
+            this.axisOrientations = axisOrientations;
+        }
+
+        /**
+         * Returns the coordinate system, which is {@code this} object.
+         */
+        @Override
+        public CartesianCS getCoordinateSystem() {
+            return this;
+        }
+
+        /**
+         * Adds the vertical axis to the given Proj4 orientations code, if the vertical axis
+         * is missing. If this method is unsure about the given axis orientations, then it
+         * conservatively does nothing. This may cause Proj.4 to reject the axis orientations.
+         */
+        static String ensure3D(String orientations) {
+            if (orientations.length() == 2 && orientations.indexOf('u') < 0 & orientations.indexOf('d') < 0) {
+                orientations += 'u';
+            }
+            return orientations;
+        }
+
+        /**
+         * Returns the end index of the word beginning at the given index.
+         * Only ASCII characters are considered.
+         */
+        static int findWordEnd(final CharSequence definition, int startAt) {
+            final int length = definition.length();
+            while (startAt < length) {
+                final char c = definition.charAt(startAt);
+                if ((c<'a' || c>'z') && (c<'A' || c>'Z')) {
+                    break;
+                }
+                startAt++;
+            }
+            return startAt;
+        }
+
+        /**
+         * Returns the base CRS, which is inferred by the Proj4 library.
+         * This method may need to change the axis order compared to the one used by Proj.4.
+         */
+        @Override
+        public synchronized Geographic getBaseCRS() {
+            if (baseCRS == null) {
+                int dimension = axes.length;
+                PJDatum base = new PJDatum(pj);
+                if (axisOrientations != null) {
+                    final int s = axisOrientations.indexOf(Proj4.AXIS_ORDER_SEPARATOR);
+                    if (s >= 0) {
+                        String orientation = axisOrientations.substring(s+1);
+                        dimension = orientation.length();
+                        orientation = ensure3D(orientation);
+                        if (!String.valueOf(base.getAxisDirections()).equals(orientation)) {
+                            final StringBuilder definition = new StringBuilder(base.getDefinition());
+                            int ap = definition.indexOf(Proj4.AXIS_ORDER_PARAM);
+                            if (ap < 0) {
+                                ap = definition.append(' ').length();
+                                definition.append(Proj4.AXIS_ORDER_PARAM);
+                            }
+                            ap += Proj4.AXIS_ORDER_PARAM.length();
+                            definition.replace(ap, findWordEnd(definition, ap), orientation);
+                            base = new PJDatum(base.getName(), definition.toString());
+                        }
+                    }
+                }
+                baseCRS = new Geographic(name, base, dimension);
+            }
+            return baseCRS;
+        }
+
+        /**
+         * Returns the conversion from the projected CRS to the base CRS.
+         */
+        @Override
+        public synchronized Projection getConversionFromBase() {
+            if (conversion == null) {
+                conversion = new Operation.Projection(name, baseCRS, this);
+            }
+            return conversion;
+        }
+    }
+}

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRS.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8



Mime
View raw message