sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1802942 [2/3] - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ core/sis-referencing/src/main/java/org/apache/sis/internal/...
Date Tue, 25 Jul 2017 13:54:42 GMT
Copied: sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml~ (from r1802940, sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml%7E?p2=sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml%7E&p1=sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml&r1=1802940&r2=1802942&rev=1802942&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml~ Tue Jul 25 13:54:41 2017
@@ -129,7 +129,6 @@ 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}"/>
@@ -137,6 +136,7 @@ is divided into following sections:
                 <available file="${test.metadata.dir}"/>
                 <available file="${test.utility.dir}"/>
                 <available file="${test.fra-profile.dir}"/>
+                <available file="${test.gdal.dir}"/>
             </or>
         </condition>
         <condition property="have.sources">
@@ -149,8 +149,6 @@ 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}"/>
@@ -158,6 +156,8 @@ is divided into following sections:
                 <available file="${src.metadata.dir}"/>
                 <available file="${src.utility.dir}"/>
                 <available file="${src.fra-profile.dir}"/>
+                <available file="${src.gdal.dir}"/>
+                <available file="${src.c.gdal.dir}"/>
             </or>
         </condition>
         <condition property="netbeans.home+have.tests">
@@ -268,8 +268,6 @@ 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>
@@ -277,6 +275,8 @@ is divided into following sections:
         <fail unless="src.metadata.dir">Must set src.metadata.dir</fail>
         <fail unless="src.utility.dir">Must set src.utility.dir</fail>
         <fail unless="src.fra-profile.dir">Must set src.fra-profile.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="test.webapp.dir">Must set test.webapp.dir</fail>
         <fail unless="test.console.dir">Must set test.console.dir</fail>
         <fail unless="test.earth-obs.dir">Must set test.earth-obs.dir</fail>
@@ -284,7 +284,6 @@ 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>
@@ -292,6 +291,7 @@ is divided into following sections:
         <fail unless="test.metadata.dir">Must set test.metadata.dir</fail>
         <fail unless="test.utility.dir">Must set test.utility.dir</fail>
         <fail unless="test.fra-profile.dir">Must set test.fra-profile.dir</fail>
+        <fail unless="test.gdal.dir">Must set test.gdal.dir</fail>
         <fail unless="build.dir">Must set build.dir</fail>
         <fail unless="dist.dir">Must set dist.dir</fail>
         <fail unless="build.classes.dir">Must set build.classes.dir</fail>
@@ -312,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.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="${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}:${src.gdal.dir}:${src.c.gdal.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -353,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.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="${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}:${src.gdal.dir}:${src.c.gdal.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -386,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.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="${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}:${src.gdal.dir}:${src.c.gdal.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <sequential>
@@ -494,9 +494,6 @@ 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>
@@ -518,6 +515,9 @@ is divided into following sections:
                         <fileset dir="${test.fra-profile.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="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
                             <filename name="${test.binarytestincludes}"/>
                         </fileset>
@@ -568,9 +568,6 @@ 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>
@@ -592,6 +589,9 @@ is divided into following sections:
                     <fileset dir="${test.fra-profile.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>
                 </union>
                 <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
                 <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Apache_SIS_for_JDK7" testname="TestNG tests" workingDir="${work.dir}">
@@ -722,9 +722,6 @@ 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>
@@ -746,6 +743,9 @@ is divided into following sections:
                         <fileset dir="${test.fra-profile.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="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
                             <filename name="${test.binarytestincludes}"/>
                         </fileset>
@@ -1118,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.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}"/>
+        <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}:${src.gdal.dir}:${src.c.gdal.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}"/>
@@ -1131,8 +1131,6 @@ 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}"/>
@@ -1140,6 +1138,8 @@ is divided into following sections:
             <fileset dir="${src.metadata.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.utility.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.fra-profile.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}"/>
         </copy>
     </target>
     <target if="has.persistence.xml" name="-copy-persistence-xml">
@@ -1160,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.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}"/>
+        <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}:${src.gdal.dir}:${src.c.gdal.dir}"/>
     </target>
     <target name="-post-compile-single">
         <!-- Empty placeholder for easier customization. -->
@@ -1450,12 +1450,6 @@ 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>
@@ -1477,6 +1471,12 @@ is divided into following sections:
             <fileset dir="${src.fra-profile.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="${build.generated.sources.dir}" erroronmissingdir="false">
                 <include name="**/*.java"/>
                 <exclude name="*.java"/>
@@ -1508,12 +1508,6 @@ 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>
@@ -1535,6 +1529,12 @@ is divided into following sections:
             <fileset dir="${src.fra-profile.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="${build.generated.sources.dir}" erroronmissingdir="false">
                 <include name="**/doc-files/**"/>
             </fileset>
@@ -1557,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.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}"/>
+        <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}:${test.gdal.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.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}"/>
+        <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}:${test.gdal.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}"/>
@@ -1569,7 +1569,6 @@ 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}"/>
@@ -1577,6 +1576,7 @@ is divided into following sections:
             <fileset dir="${test.metadata.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.utility.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.fra-profile.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${test.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
         </copy>
     </target>
     <target name="-post-compile-test">
@@ -1591,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.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}"/>
+        <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}:${test.gdal.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}:${test.gdal.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}"/>
@@ -1600,7 +1600,6 @@ 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}"/>
@@ -1608,6 +1607,7 @@ is divided into following sections:
             <fileset dir="${test.metadata.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.utility.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.fra-profile.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${test.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
         </copy>
     </target>
     <target name="-post-compile-test-single">

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/genfiles.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/genfiles.properties?rev=1802942&r1=1802941&r2=1802942&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] Tue Jul 25 13:54:41 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=2d60067c
-nbproject/build-impl.xml.script.CRC32=723c782e
+nbproject/build-impl.xml.data.CRC32=e5519b85
+nbproject/build-impl.xml.script.CRC32=45c804f7
 nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml?rev=1802942&r1=1802941&r2=1802942&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml Tue Jul 25 13:54:41 2017
@@ -31,8 +31,6 @@
                 <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"/>
@@ -40,6 +38,8 @@
                 <root id="src.metadata.dir" name="Metadata"/>
                 <root id="src.utility.dir" name="Utility"/>
                 <root id="src.fra-profile.dir" name="French profile"/>
+                <root id="src.gdal.dir" name="GDAL/Proj4"/>
+                <root id="src.c.gdal.dir" name="GDAL/Proj4 JNI"/>
             </source-roots>
             <test-roots>
                 <root id="test.webapp.dir" name="Test web application"/>
@@ -49,7 +49,6 @@
                 <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"/>
@@ -57,6 +56,7 @@
                 <root id="test.metadata.dir" name="Test Metadata"/>
                 <root id="test.utility.dir" name="Test Utility"/>
                 <root id="test.fra-profile.dir" name="Test French profile"/>
+                <root id="test.gdal.dir" name="Test GDAL/Proj4"/>
             </test-roots>
         </data>
         <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c?rev=1802942&r1=1802941&r2=1802942&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c [UTF-8] Tue Jul 25 13:54:41 2017
@@ -16,7 +16,7 @@
  */
 #include <math.h>
 #include <string.h>
-#include <projects.h>
+#include <proj_api.h>
 #include "org_apache_sis_storage_gdal_PJ.h"
 
 
@@ -35,10 +35,10 @@
  * \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)
+projPJ 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;
+    return (id) ? (projPJ) (*env)->GetLongField(env, object, id) : NULL;
 }
 
 /*!
@@ -70,7 +70,7 @@ JNIEXPORT jlong JNICALL Java_org_apache_
 {
     const char *def_utf = (*env)->GetStringUTFChars(env, definition, NULL);
     if (!def_utf) return 0;             // OutOfMemoryError already thrown.
-    PJ *pj = pj_init_plus(def_utf);
+    projPJ pj = pj_init_plus(def_utf);
     (*env)->ReleaseStringUTFChars(env, definition, def_utf);
     return (jlong) pj;
 }
@@ -87,7 +87,7 @@ JNIEXPORT jlong JNICALL Java_org_apache_
 JNIEXPORT jlong JNICALL Java_org_apache_sis_storage_gdal_PJ_allocateGeoPJ
   (JNIEnv *env, jclass class, jobject projected)
 {
-    PJ *pj = getPJ(env, projected);
+    projPJ pj = getPJ(env, projected);
     return (pj) ? (jlong) pj_latlong_from_proj(pj) : 0;
 }
 
@@ -102,7 +102,7 @@ JNIEXPORT jlong JNICALL Java_org_apache_
 JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getCode
   (JNIEnv *env, jobject object)
 {
-    PJ *pj = getPJ(env, object);
+    projPJ pj = getPJ(env, object);
     if (pj) {
         const char *desc = pj_get_def(pj, 0);
         if (desc) {
@@ -116,27 +116,6 @@ JNIEXPORT jstring JNICALL Java_org_apach
 
 /*!
  * \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_getName
-  (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.
@@ -148,7 +127,7 @@ JNIEXPORT jstring JNICALL Java_org_apach
 JNIEXPORT jobject JNICALL Java_org_apache_sis_storage_gdal_PJ_getType
   (JNIEnv *env, jobject object)
 {
-    PJ *pj = getPJ(env, object);
+    projPJ pj = getPJ(env, object);
     if (pj) {
         const char *type;
         if (pj_is_latlong(pj)) {
@@ -171,76 +150,27 @@ JNIEXPORT jobject JNICALL Java_org_apach
 
 /*!
  * \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.
+ * Returns the semi-major axis length and eccentricity squared in an array of length 2.
  *
  * \param  env    - The JNI environment.
  * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
- * \return The axis directions.
+ * \return The semi-major axis length and eccentricity squared in an array of length 2.
  */
-JNIEXPORT jcharArray JNICALL Java_org_apache_sis_storage_gdal_PJ_getAxisDirections
+JNIEXPORT jdoubleArray JNICALL Java_org_apache_sis_storage_gdal_PJ_getEllipsoidDefinition
   (JNIEnv *env, jobject object)
 {
-    PJ *pj = getPJ(env, object);
+    projPJ pj = getPJ(env, object);
     if (pj) {
-        int length = strlen(pj->axis);
-        jcharArray array = (*env)->NewCharArray(env, length);
+        double major_axis;
+        double eccentricity_squared;
+        pj_get_spheroid_defn(pj, &major_axis, &eccentricity_squared);
+        jdoubleArray array = (*env)->NewDoubleArray(env, 2);
         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);
+            jdouble* def = (*env)->GetDoubleArrayElements(env, array, NULL);
+            if (def) {
+                def[0] = major_axis;
+                def[1] = eccentricity_squared;
+                (*env)->ReleaseDoubleArrayElements(env, array, def, 0);
             }
             return array;
         }
@@ -250,40 +180,6 @@ JNIEXPORT jcharArray JNICALL Java_org_ap
 
 /*!
  * \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.
  *
@@ -293,7 +189,7 @@ JNIEXPORT jdouble JNICALL Java_org_apach
  * \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) {
+void convertAngularOrdinates(projPJ pj, double* data, jint numPts, int dimension, double factor) {
     int dimToSkip;
     if (pj_is_latlong(pj)) {
         // Convert only the 2 first ordinates and skip all the other dimensions.
@@ -339,7 +235,7 @@ JNIEXPORT void JNICALL Java_org_apache_s
         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.
+    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;
@@ -349,8 +245,8 @@ JNIEXPORT void JNICALL Java_org_apache_s
         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);
+    projPJ src_pj = getPJ(env, object);
+    projPJ dst_pj = getPJ(env, target);
     if (src_pj && dst_pj) {
         // Using GetPrimitiveArrayCritical/ReleasePrimitiveArrayCritical rather than
         // GetDoubleArrayElements/ReleaseDoubleArrayElements increase the chances that
@@ -385,9 +281,9 @@ JNIEXPORT void JNICALL Java_org_apache_s
 JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getLastError
   (JNIEnv *env, jobject object)
 {
-    PJ *pj = getPJ(env, object);
+    projPJ pj = getPJ(env, object);
     if (pj) {
-        int err = pj_ctx_get_errno(pj->ctx);
+        int err = *pj_get_errno_ref();
         if (err) {
             return (*env)->NewStringUTF(env, pj_strerrno(err));
         }
@@ -412,7 +308,7 @@ JNIEXPORT void JNICALL Java_org_apache_s
 {
     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);
+        projPJ pj = (projPJ) (*env)->GetLongField(env, object, id);
         if (pj) {
             (*env)->SetLongField(env, object, id, (jlong) 0);
             pj_free(pj);

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h?rev=1802942&r1=1802941&r2=1802942&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h [UTF-8] Tue Jul 25 13:54:41 2017
@@ -7,8 +7,6 @@
 #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:    allocatePJ
@@ -43,14 +41,6 @@ JNIEXPORT jstring JNICALL Java_org_apach
 
 /*
  * Class:     org_apache_sis_storage_gdal_PJ
- * Method:    getName
- * Signature: ()Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getName
-  (JNIEnv *, jobject);
-
-/*
- * Class:     org_apache_sis_storage_gdal_PJ
  * Method:    getType
  * Signature: ()Lorg/apache/sis/storage/gdal/PJ/Type;
  */
@@ -59,54 +49,14 @@ JNIEXPORT jobject JNICALL Java_org_apach
 
 /*
  * 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:    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:    getGreenwichLongitude
- * Signature: ()D
+ * Method:    getEllipsoidDefinition
+ * Signature: ()[D
  */
-JNIEXPORT jdouble JNICALL Java_org_apache_sis_storage_gdal_PJ_getGreenwichLongitude
+JNIEXPORT jdoubleArray JNICALL Java_org_apache_sis_storage_gdal_PJ_getEllipsoidDefinition
   (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:    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
  */

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java?rev=1802942&r1=1802941&r2=1802942&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java [UTF-8] Tue Jul 25 13:54:41 2017
@@ -17,6 +17,9 @@
 package org.apache.sis.storage.gdal;
 
 import java.util.Objects;
+import java.io.Serializable;
+import java.io.ObjectStreamException;
+import java.io.InvalidObjectException;
 import org.opengis.metadata.Identifier;
 import org.opengis.util.FactoryException;
 import org.opengis.util.InternationalString;
@@ -29,9 +32,7 @@ import org.opengis.referencing.operation
 import org.apache.sis.referencing.factory.InvalidGeodeticParameterException;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.metadata.iso.citation.Citations;
-import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.util.resources.Errors;
-import org.apache.sis.util.CharSequences;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.system.OS;
 
@@ -51,13 +52,8 @@ import org.apache.sis.internal.system.OS
  * @since   0.8
  * @module
  */
-final class PJ implements Identifier {
-    /**
-     * The maximal number of dimension accepted by the {@link #transform(PJ, int, double[], int, int)} method.
-     * This upper limit is actually somewhat arbitrary. This limit exists mostly as a safety against potential misuse.
-     */
-    static final int DIMENSION_MAX = 100;
-
+@SuppressWarnings("serial")     // serialVersionUID not needed since writeReplace() gives another kind of object.
+final class PJ implements Identifier, Serializable {
     /**
      * Loads the {@literal Proj.4} library.
      * This static initializer may throw a {@link UnsatisfiedLinkError} if the static library can not be loaded.
@@ -69,8 +65,8 @@ final class PJ implements Identifier {
     }
 
     /**
-     * The pointer to {@code PJ} structure allocated in the C/C++ heap. This value has no
-     * meaning in Java code. <strong>Do not modify</strong>, since this value is used by Proj.4.
+     * The pointer to {@code PJ} structure allocated in the C/C++ heap. This value has no meaning in Java code,
+     * except 0 which means no native object. <strong>Do not modify</strong>, since this value is used by Proj.4.
      * Do not rename neither, unless you update accordingly the C code in JNI wrappers.
      */
     private final long ptr;
@@ -196,32 +192,11 @@ final class PJ implements Identifier {
 
     /**
      * Returns the string representation of the PJ structure.
-     * Note that the string returned by Proj.4 contains <cite>End Of Line</cite> characters.
-     *
-     * <div class="note"><b>Example:</b> "Lat/long (Geodetic alias)"</div>
-     */
-    native String getName();
-
-    /**
-     * Returns the string representation of the PJ structure.
      *
      * @return the string representation, or {@code null} if none.
      */
     @Override
     public InternationalString getDescription() {
-        String name = getName();
-        if (name != null) {
-            final StringBuilder buffer = new StringBuilder(name.length());
-            for (CharSequence line : CharSequences.splitOnEOL(getName())) {
-                line = CharSequences.trimWhitespaces(line);
-                if (buffer.length() != 0) buffer.append(' ');
-                buffer.append(line);
-            }
-            name = buffer.toString();
-            if (!name.isEmpty()) {
-               return new SimpleInternationalString(name);
-            }
-        }
         return null;
     }
 
@@ -263,69 +238,21 @@ final class PJ implements Identifier {
     }
 
     /**
-     * Returns the square of the ellipsoid eccentricity (ε²). The eccentricity is related to axis length
-     * by ε=√(1-(<var>b</var>/<var>a</var>)²). The eccentricity of a sphere is zero.
+     * Returns the semi-major axis length and the square of the ellipsoid eccentricity (ε²).
+     * The eccentricity is related to axis length by ε=√(1-(<var>b</var>/<var>a</var>)²).
+     * The eccentricity of a sphere is zero. Other related quantities are:
+     *
+     * <ul>
+     *   <li>semi-minor axis length: b = a × √(1 - ε²)</li>
+     *   <li>inverse flattening: invf = 1 / (1 - √(1 - ε²))</li>
+     * </ul>
      *
-     * @return the eccentricity.
+     * @return the semi-major axis length and the eccentricity squared in an array of length 2.
      *
      * @see Ellipsoid#isSphere()
      * @see Ellipsoid#getInverseFlattening()
      */
-    public native double getEccentricitySquared();
-
-    /**
-     * Returns the inverse flattening, computed from the eccentricity.
-     * The inverse flattening factor of a sphere is infinity.
-     */
-    public double getInverseFlattening() {
-        return 1 / (1 - Math.sqrt(1 - getEccentricitySquared()));
-    }
-
-    /**
-     * Returns the value stored in the {@code a_orig} PJ field.
-     *
-     * @return the axis length stored in {@code a_orig}.
-     *
-     * @see Ellipsoid#getSemiMajorAxis()
-     */
-    public native double getSemiMajorAxis();
-
-    /**
-     * Returns the value computed from PJ fields by {@code √((a_orig)² × (1 - es_orig))}.
-     *
-     * @return the axis length computed by {@code √((a_orig)² × (1 - es_orig))}.
-     *
-     * @see Ellipsoid#getSemiMinorAxis()
-     */
-    public native double getSemiMinorAxis();
-
-    /**
-     * Longitude of the prime meridian measured from the Greenwich meridian, positive eastward.
-     *
-     * @return the prime meridian longitude, in degrees.
-     *
-     * @see PrimeMeridian#getGreenwichLongitude()
-     */
-    public native double getGreenwichLongitude();
-
-    /**
-     * Returns an array of character indicating the direction of each axis. Directions are
-     * characters like {@code 'e'} for East, {@code 'n'} for North and {@code 'u'} for Up.
-     *
-     * @return the axis directions.
-     *
-     * @see org.opengis.referencing.cs.CoordinateSystemAxis#getDirection()
-     */
-    public native char[] getAxisDirections();
-
-    /**
-     * Returns the conversion factor from the linear units to metres.
-     *
-     * @param  vertical {@code false} for the conversion factor of horizontal axes,
-     *         or {@code true} for the conversion factor of the vertical axis.
-     * @return the conversion factor to metres for the given axis.
-     */
-    public native double getLinearUnitToMetre(boolean vertical);
+    public native double[] getEllipsoidDefinition();
 
     /**
      * Transforms in-place the coordinates in the given array.
@@ -340,7 +267,7 @@ final class PJ implements Identifier {
      * </ul>
      *
      * @param  target       the target CRS.
-     * @param  dimension    the dimension of each coordinate value. Must be in the [2-{@value #DIMENSION_MAX}] range.
+     * @param  dimension    the dimension of each coordinate value. Typically 2, 3 or 4.
      * @param  coordinates  the coordinates to transform, as a sequence of (<var>x</var>,<var>y</var>,&lt;<var>z</var>&gt;,…) tuples.
      * @param  offset       offset of the first coordinate in the given array.
      * @param  numPts       number of points to transform.
@@ -395,4 +322,52 @@ final class PJ implements Identifier {
     @Override
     @SuppressWarnings("FinalizeDeclaration")
     protected final native void finalize();
+
+    /**
+     * The object serialized in place of {@literal Proj.4} wrappers.
+     * Deserialization checks for the presence of Proj.4 native library.
+     *
+     * @author  Martin Desruisseaux (Geomatys)
+     * @version 0.8
+     * @since   0.8
+     * @module
+     */
+    private static final class Serialized implements Serializable {
+        /**
+         * For cross-version compatibility.
+         */
+        private static final long serialVersionUID = -5705027681492462823L;
+
+        /**
+         * The {@literal Proj.4} definition string.
+         */
+        private final String definition;
+
+        /**
+         * Creates a new proxy for the given {@literal Proj.4} definition.
+         */
+        Serialized(final String definition) {
+            this.definition = definition;
+        }
+
+        /**
+         * Automatically invoked on deserialization for reconstructing the wrapper
+         * from the {@literal Proj.4} definition string.
+         */
+        protected final Object readResolve() throws ObjectStreamException {
+            try {
+                return new PJ(definition);
+            } catch (UnsatisfiedLinkError | NoClassDefFoundError | InvalidGeodeticParameterException e) {
+                throw (InvalidObjectException) new InvalidObjectException(Proj4.unavailable(e)).initCause(e);
+            }
+        }
+    }
+
+    /**
+     * Invoked automatically on serialization.
+     * Replaces this {@literal Proj.4} wrapper by a proxy without native resource.
+     */
+    protected final Object writeReplace() throws ObjectStreamException {
+        return new Serialized(getCode());
+    }
 }

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java?rev=1802942&r1=1802941&r2=1802942&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java [UTF-8] Tue Jul 25 13:54:41 2017
@@ -18,15 +18,18 @@ package org.apache.sis.storage.gdal;
 
 import javax.measure.Unit;
 import javax.measure.quantity.Angle;
+import javax.measure.format.ParserException;
 import org.opengis.metadata.Identifier;
 import org.opengis.util.FactoryException;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.GeneralParameterValue;
+import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.crs.GeodeticCRS;
 import org.opengis.referencing.crs.ProjectedCRS;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CartesianCS;
@@ -36,8 +39,11 @@ import org.opengis.referencing.datum.Geo
 import org.opengis.referencing.datum.PrimeMeridian;
 import org.opengis.referencing.operation.Projection;
 import org.opengis.referencing.operation.CoordinateOperation;
+import org.apache.sis.referencing.operation.AbstractCoordinateOperation;
 import org.apache.sis.referencing.factory.UnavailableFactoryException;
+import org.apache.sis.referencing.factory.InvalidGeodeticParameterException;
 import org.apache.sis.referencing.IdentifiedObjects;
+import org.apache.sis.referencing.CRS;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.internal.metadata.AxisDirections;
 import org.apache.sis.internal.system.Modules;
@@ -46,6 +52,7 @@ import org.apache.sis.util.logging.Loggi
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Static;
+import org.apache.sis.util.iso.Types;
 import org.apache.sis.measure.Units;
 
 
@@ -55,7 +62,7 @@ import org.apache.sis.measure.Units;
  *
  * <ul>
  *   <li>{@linkplain #createCRS Create a Coordinate Reference System instance from a Proj.4 definition string}.</li>
- *   <li>Conversely, {@link #definition get a Proj.4 definition string from a Coordinate Reference System}.</li>
+ *   <li>Conversely, {@linkplain #definition get a Proj.4 definition string from a Coordinate Reference System}.</li>
  *   <li>{@linkplain #createOperation Create a coordinate operation backed by Proj.4 between two arbitrary CRS}.</li>
  * </ul>
  *
@@ -80,7 +87,7 @@ public final class Proj4 extends Static
      *
      * <div class="note"><b>Example:</b> Rel. 4.9.3, 15 August 2016</div>
      *
-     * @return the Proj.4 release string, or {@code null} if no installation has been found.
+     * @return the Proj.4 release string, or {@code null} if the native library has been found.
      */
     public static String version() {
         try {
@@ -98,6 +105,7 @@ public final class Proj4 extends Static
     /**
      * Infers a {@literal Proj.4} definition from the given projected, geographic or geocentric coordinate reference system.
      * This method does not need the Proj.4 native library; it can be used in a pure Java application.
+     * However the returned definition string may differ depending on whether the Proj.4 library is available or not.
      *
      * @param  crs  the coordinate reference system for which to create a Proj.4 definition.
      * @return the definition of the given CRS in a Proj.4 format.
@@ -154,21 +162,40 @@ public final class Proj4 extends Static
          * Append the map projection parameters. Those parameters may include axis lengths (a and b),
          * but not necessarily. If axis lengths are specified, then we will ignore the Ellipsoid instance
          * associated to the CRS.
+         *
+         * The "+over" option is for disabling the default wrapping of output longitudes in the -180 to 180 range.
+         * We do that for having the same behavior between Proj.4 and Apache SIS. No wrapping reduce discontinuity
+         * problems with geometries that cross the anti-meridian.
+         *
+         * The "+no_defs" option is for ensuring that no defaults are read from "/usr/share/proj/proj_def.dat" file.
+         * That file contains default values for various map projections, for example "+lat_1=29.5" and "+lat_2=45.5"
+         * for the "aea" projection. Those defaults are assuming that users want Conterminous U.S. map.
+         * This may cause surprising behavior for users outside USA.
          */
         final StringBuilder definition = new StringBuilder(100);
-        definition.append("+proj=").append(method);
+        definition.append(Proj4Factory.PROJ_PARAM).append(method);
         boolean hasSemiMajor = false;
         boolean hasSemiMinor = false;
         if (parameters != null) {
+            definition.append(" +over +no_defs");                                       // See above comment
             for (final GeneralParameterValue parameter : parameters.values()) {
-                if (parameter instanceof ParameterValue) {
-                    final Object value = ((ParameterValue) parameter).getValue();
-                    if (value != null) {
-                        final String pn = name(parameter.getDescriptor());
-                        if (pn.equals("+a")) hasSemiMajor = true;
-                        if (pn.equals("+b")) hasSemiMinor = true;
-                        definition.append(' ').append(pn).append('=').append(value);
+                if (parameter instanceof ParameterValue<?>) {
+                    final ParameterValue<?> pv = (ParameterValue<?>) parameter;
+                    final Object value;
+                    Unit<?> unit = pv.getUnit();
+                    if (unit != null) {
+                        unit = Units.isAngular(unit) ? Units.DEGREE : unit.getSystemUnit();
+                        value = pv.doubleValue(unit);       // Always in metres or degrees.
+                    } else {
+                        value = pv.getValue();
+                        if (value == null) {
+                            continue;
+                        }
                     }
+                    final String pn = name(parameter.getDescriptor());
+                    hasSemiMajor |= pn.equals("+a");
+                    hasSemiMinor |= pn.equals("+b");
+                    definition.append(' ').append(pn).append('=').append(value);
                 }
             }
         }
@@ -190,24 +217,59 @@ public final class Proj4 extends Static
         /*
          * Appends axis directions. This method always format a vertical direction (up or down)
          * even if the coordinate system is two-dimensional, because Proj.4 seems to require it.
+         * Also extract axis units in the process.
          */
+        final Unit<?>[] units = new Unit<?>[2];     // Horizontal at index 0, vertical at index 1.
+        boolean validCS = true;
         definition.append(' ').append(Proj4Factory.AXIS_ORDER_PARAM);
         final int dimension = Math.min(cs.getDimension(), 3);
         boolean hasVertical = false;
         for (int i=0; i<dimension; i++) {
-            final AxisDirection dir = cs.getAxis(i).getDirection();
+            final CoordinateSystemAxis axis = cs.getAxis(i);
+            final AxisDirection dir = axis.getDirection();
+            int unitIndex = 0;
             if (!AxisDirections.isCardinal(dir)) {
                 if (!AxisDirections.isVertical(dir)) {
                     throw new FactoryException(Errors.format(Errors.Keys.UnsupportedAxisDirection_1, dir));
                 }
                 hasVertical = true;
+                unitIndex = 1;
             }
+            final Unit<?> old  = units[unitIndex];
+            units[unitIndex]   = axis.getUnit();
+            validCS &= (old == null || old.equals(units[unitIndex]));
             definition.appendCodePoint(Character.toLowerCase(dir.name().codePointAt(0)));
         }
         if (!hasVertical && dimension < 3) {
             definition.append('u');                    // Add a UP direction if not already present.
         }
-        return definition.toString();
+        /*
+         * Append units of measurement, then verify the coordinate system validity.
+         */
+        for (int i=0; i<units.length; i++) {
+            final Unit<?> unit = units[i];
+            if (unit != null && !unit.equals(Units.DEGREE) && !unit.equals(Units.METRE)) {
+                validCS &= Units.isLinear(unit);
+                definition.append(" +");
+                if (i == 1) definition.append('v');     // "+vto_meter" parameter.
+                definition.append("to_meter=").append(Units.toStandardUnit(unit));
+            }
+        }
+        if (validCS) {
+            return definition.toString();
+        }
+        /*
+         * If we reach this point, we detected a coordinate system that we can not format as a
+         * Proj.4 definition string. Format an error message with axis directions and units.
+         */
+        definition.setLength(0);
+        definition.append('(');
+        for (int i=0; i<units.length; i++) {
+            final CoordinateSystemAxis axis = cs.getAxis(i);
+            if (i != 0) definition.append(", ");
+            definition.append(axis.getUnit()).append(' ').append(Types.getCodeName(axis.getDirection()));
+        }
+        throw new FactoryException(Errors.format(Errors.Keys.IllegalCoordinateSystem_1, definition.append(')')));
     }
 
     /**
@@ -224,49 +286,105 @@ public final class Proj4 extends Static
 
     /**
      * Creates a new CRS from the given {@literal Proj.4} definition string.
+     * Some examples of definition strings are:
+     * <ul>
+     *   <li>{@code "+init=epsg:3395"} (see warning below)</li>
+     *   <li>{@code "+proj=latlong +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"}</li>
+     *   <li>{@code "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +ellps=WGS84 +towgs84=0,0,0"}</li>
+     * </ul>
+     *
+     * <b>Warning:</b> despite the {@code "epsg"} word, coordinate reference systems created by {@code "+init=epsg:"}
+     * syntax are not necessarily compliant with EPSG definitions. In particular, the axis order is often different.
+     * Units of measurement may also differ.
      *
      * @param  definition  the Proj.4 definition string.
      * @param  dimension   the number of dimension of the CRS to create (2 or 3).
      * @return a CRS created from the given definition string and number of dimensions.
      * @throws NullPointerException if the definition string is {@code null}.
-     * @throws FactoryException if one of the given argument has an invalid value.
+     * @throws IllegalArgumentException if the definition string is empty or the dimension argument is out of range.
+     * @throws UnavailableFactoryException if the Proj.4 native library is not available.
+     * @throws FactoryException if the CRS creation failed for another reason.
      *
      * @see Proj4Factory#createCoordinateReferenceSystem(String)
      */
     public static CoordinateReferenceSystem createCRS(String definition, final int dimension) throws FactoryException {
-        definition = definition.trim();
-        ArgumentChecks.ensureNonEmpty(definition, definition);
+        ArgumentChecks.ensureNonEmpty("definition", definition);
         ArgumentChecks.ensureBetween("dimension", 2, 3, dimension);
+        definition = definition.trim();
         try {
             return Proj4Factory.INSTANCE.createCRS(definition, dimension >= 3);
+        } catch (IllegalArgumentException | ParserException e) {
+            throw new InvalidGeodeticParameterException(canNotParse(definition), e);
         } catch (UnsatisfiedLinkError | NoClassDefFoundError e) {
-            throw new UnavailableFactoryException(Errors.format(Errors.Keys.NativeInterfacesNotFound_2, OS.uname(), "libproj"), e);
+            throw new UnavailableFactoryException(unavailable(e), e);
         }
     }
 
     /**
      * Creates an operation for conversion or transformation between two coordinate reference systems.
-     * This implementation always uses Proj.4 for performing the coordinate operations, regardless if
-     * the given CRS were created from a Proj.4 definition string or not. This method fails if it can
-     * not map the given CRS to Proj.4 structures.
-     *
-     * @param  sourceCRS   the source coordinate reference system.
-     * @param  targetCRS   the target coordinate reference system.
-     * @return a coordinate operation for transforming coordinates from the given source CRS to the given target CRS.
-     * @throws FactoryException if an error occurred while creating the coordinate operation.
+     * The given CRSs should be instances created by this package. If not, then there is a choice:
+     *
+     * <ul>
+     *   <li>If {@code force} is {@code false}, then this method returns {@code null}.</li>
+     *   <li>Otherwise this method always uses Proj.4 for performing the coordinate operations,
+     *       regardless if the given CRS were created from Proj.4 definition strings or not.
+     *       This method fails if it can not map the given CRS to Proj.4 data structures.</li>
+     * </ul>
      *
-     * @see Proj4Factory#createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem)
+     * <p><b>Recommended alternative</b></p>
+     * Provided that an <a href="http://sis.apache.org/epsg.html">EPSG database is available</a>,
+     * Apache SIS {@link CRS#findOperation CRS.findOperation(…)} method produces results that are closer
+     * to the authoritative definitions of coordinate operations (technically, Apache SIS referencing
+     * engine is a <cite>late-binding</cite> implementation while Proj.4 is an <cite>early-binding</cite>
+     * implementation — see EPSG guidance notes for a definition of late versus early-binding approaches).
+     * Apache SIS also attaches metadata about
+     * {@linkplain AbstractCoordinateOperation#getCoordinateOperationAccuracy() coordinate operation accuracy} and
+     * {@linkplain AbstractCoordinateOperation#getDomainOfValidity() domain of validity}, have extended support of
+     * multi-dimensional CRS and provides transform derivatives. This {@code Proj4.createOperation(…)} method should
+     * be reserved to situations where an application needs to reproduce the same numerical results than Proj.4.
+     *
+     * @param  sourceCRS  the source coordinate reference system.
+     * @param  targetCRS  the target coordinate reference system.
+     * @param  force      whether to force the creation of a Proj.4 transform
+     *                    even if the given CRS are not wrappers around Proj.4 data structures.
+     * @return a coordinate operation for transforming coordinates from the given source CRS to the given target CRS, or
+     *         {@code null} if the given CRS are not wrappers around Proj.4 data structures and {@code force} is false.
+     * @throws UnavailableFactoryException if {@code force} is {@code true} and the Proj.4 native library is not available.
+     * @throws FactoryException if {@code force} is {@code true} and this method can not create Proj.4 transform
+     *         for the given pair of coordinate reference systems for another reason.
+     *
+     * @see Proj4Factory#createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem, boolean)
+     * @see CRS#findOperation(CoordinateReferenceSystem, CoordinateReferenceSystem, GeographicBoundingBox)
      */
     public static CoordinateOperation createOperation(final CoordinateReferenceSystem sourceCRS,
-                                                      final CoordinateReferenceSystem targetCRS)
+                                                      final CoordinateReferenceSystem targetCRS,
+                                                      final boolean force)
             throws FactoryException
     {
         ArgumentChecks.ensureNonNull("sourceCRS", sourceCRS);
         ArgumentChecks.ensureNonNull("targetCRS", targetCRS);
         try {
-            return Proj4Factory.INSTANCE.createOperation(sourceCRS, targetCRS);
+            return Proj4Factory.INSTANCE.createOperation(sourceCRS, targetCRS, force);
         } catch (UnsatisfiedLinkError | NoClassDefFoundError e) {
-            throw new UnavailableFactoryException(Errors.format(Errors.Keys.NativeInterfacesNotFound_2, OS.uname(), "libproj"), e);
+            throw new UnavailableFactoryException(unavailable(e), e);
         }
     }
+
+    /**
+     * Returns the error message for a {@literal Proj.4} not found.
+     */
+    static String unavailable(final Throwable e) {
+        String message = e.getLocalizedMessage();
+        if (message == null || message.indexOf(' ') < 0) {      // Keep existing message if it is a sentence.
+            message = Errors.format(Errors.Keys.NativeInterfacesNotFound_2, OS.uname(), "libproj");
+        }
+        return message;
+    }
+
+    /**
+     * Returns the error message for a {@literal Proj.4} string that can not be parsed.
+     */
+    static String canNotParse(final String code) {
+        return Errors.format(Errors.Keys.CanNotParse_1, code);
+    }
 }



Mime
View raw message