aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Desruisseaux <martin.desruisseaux@geomatys.fr>2011-08-27 20:30:36 +0000
committerMartin Desruisseaux <martin.desruisseaux@geomatys.fr>2011-08-27 20:30:36 +0000
commitbcada9c0400f2c18c999b2e1e5bda824942e89f2 (patch)
tree28e6faeac4913ee68cf1697b750a372cc66c735b
parentb3c870ee6c48e1443292820999e7e658a805f10d (diff)
downloadPROJ-bcada9c0400f2c18c999b2e1e5bda824942e89f2.tar.gz
PROJ-bcada9c0400f2c18c999b2e1e5bda824942e89f2.zip
Documentation updates and first configuration changes:
- Added @deprecated tags to the old bindings, with test pointing to their replacement. - Added a note in the header of the new bindings suggesting to keep the classes synchronized with GeoAPI (if possible). - Edited the README file for the new bindings, but did not yet edited the example. - Added the new files to the list of files declared in Makefile.in, and ran automake to regenerate Makefile.am. - Edited build.xml to generate the header file of PJ.h instead than Projections.h. git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2092 4e78687f-474d-0410-85f9-8d5e500ac6b2
-rw-r--r--jniwrap/README71
-rw-r--r--jniwrap/build.xml24
-rw-r--r--jniwrap/org/proj4/LatLong.java42
-rw-r--r--jniwrap/org/proj4/Makefile.am3
-rw-r--r--jniwrap/org/proj4/Makefile.in3
-rw-r--r--jniwrap/org/proj4/Others.java44
-rw-r--r--jniwrap/org/proj4/PJ.java6
-rw-r--r--jniwrap/org/proj4/PJException.java6
-rw-r--r--jniwrap/org/proj4/Proj4.java70
-rw-r--r--jniwrap/org/proj4/Proj4Factory.java56
-rw-r--r--jniwrap/org/proj4/ProjectionData.java46
-rw-r--r--jniwrap/org/proj4/Projections.java115
-rw-r--r--jniwrap/org/proj4/package-info.java6
13 files changed, 290 insertions, 202 deletions
diff --git a/jniwrap/README b/jniwrap/README
index ce0c212e..0c5818e8 100644
--- a/jniwrap/README
+++ b/jniwrap/README
@@ -1,81 +1,92 @@
-------------------- J P R O J . 4 --------------------
-This is the first release of a JNI wrap of the main proj4 functions.
+This is the second release of JNI wrappers for the main proj4 functions.
PLEASE read the following information.
-For more information regarding JPROJ4 please contact me through the
-web page at:
+The first release of JNI wrappers were created by:
- http://www.hydrologis.com
+ http://www.hydrologis.com
+
+For more information regarding the current release please see the web page at:
+
+ http://www.geoapi.org/geoapi-proj4/
---------------------------------------------------
-What is JPROJ4:
+What is "Proj.4 wrapper":
-------------
-JPROJ is a small library of java classes that wrap a few proj functions by
-using the java native interface.
+"Proj.4 wrapper" is a small library of Java classes that wrap a few Proj.4 functions by
+using the Java Native Interface (JNI).
Compilation:
-------------
-To complile the native part, configure has to be run like this:
-CFLAGS=-Iinclude2 ./configure --with-jni=include1
+To compile the native part, configure has to be run in the proj directory like this:
+
+ CFLAGS=-Iinclude2 ./configure --with-jni=include1
+
where
-include1 = folder in which the header file jni.h resides (usually $JAVA_HOME/include)
-include2 = folder in which the header file jni_md.h resides (usually $JAVA_HOME/include/linux or whatever)
+
+ include1 = folder in which the header file jni.h resides (usually $JAVA_HOME/include)
+ include2 = folder in which the header file jni_md.h resides (usually $JAVA_HOME/include/linux or whatever)
+
+On MacOS, those two folders are /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/include/
-The java part is compiled by running ant inside the "jniwrap" folder.
+The java part is compiled by running ant inside the "jniwrap" folder.
This will compile the classes and archive them in a jar library.
-It applies to Linux, Macos and Windows (and virtually to every system
+It applies to Linux, Macos and Windows (and virtually to every system
supporting java).
Requirements:
-------------
-Beyond the ones already put by proj, you need:
-- j2sdk, the java standard development kit
-- ant, to run the build
-- doxygen for the documentation generation
+Beyond the ones already put by Proj.4, you need:
+- JSE 1.5+, the Java standard development kit version 1.5 or above
+- Ant, to run the build
+- Doxygen for the documentation generation
Documentation:
--------------
The documentation is held inside the code and can be retrieved by running
-doxygen inside the folder jniwrap. This will create the html format
+doxygen inside the folder jniwrap. This will create the HTML format
documentation inside of jniwrap/docs
-The standard way to achive this is to use an ant target:
-ant do_make_help
+The standard way to achive this is to use an Ant target:
+
+ ant do_make_help
License:
--------
-GPL
+GPL for the first release
+Proj.4 license for the second release.
Authors:
--------
Andrea Antonello (andrea.antonello@hydrologis.com)
+Martin Desruisseaux (martin.desruisseaux@geomatys.fr)
Usage & a fast example:
-----------------------
The jproj.jar is all is needed to implement proj support in java applications.
-The whole job is done by the proj4, so there are just a couple of functions that
+The whole job is done by the proj4, so there are just a couple of functions that
be used.
The best way is to see everything through an example.
-In the following example we read projection informations and data from a file
+In the following example we read projection informations and data from a file
and then transform the data and query the information.
________________________________________________________________________________
@@ -87,13 +98,13 @@ rows: 1
46 11 194.0
-This contains info about a source and destination projection, the number of data
+This contains info about a source and destination projection, the number of data
triplets and then the data (in this case just one point)
________________________________________________________________________________
Step two:
-create a test code. Simply copy the following into a file called Main.java. The
+create a test code. Simply copy the following into a file called Main.java. The
code is commented to see what we are doing:
@@ -145,10 +156,10 @@ public class Main
}
}
// with what you see above, the header was read
-
+
// now I can define the number of rows of data triplets
int rows = new Integer((String) mapHeader.get("rows")).intValue();
-
+
double[][] testCoord = new double[rows][2];
double[] testValues = new double[rows];
System.out.println("Source coordinates and values:");
@@ -182,7 +193,7 @@ public class Main
Proj4 testProjection = new Proj4((String) mapHeader.get("srcProj"),
(String) mapHeader.get("destProj"));
- // the instantiation of the proj4 object instantiated also the projection
+ // the instantiation of the proj4 object instantiated also the projection
// objects for source and destination projection
// therefore we can already print the projection infos:
testProjection.printSrcProjInfo();
@@ -190,10 +201,10 @@ public class Main
// and transform, passing as parameter the created dataset:
testProjection.transform(dataTP, 1, 1);
-
+
// if we need the parameters as Hashmap for a later use:
LinkedHashMap testMap = testProjection.getSrcProjInfo();
-
+
// and let us print them to screen to see them
System.out.println();
System.out.println("Proj as a Hashmap");
diff --git a/jniwrap/build.xml b/jniwrap/build.xml
index 8f181dd8..3032a52f 100644
--- a/jniwrap/build.xml
+++ b/jniwrap/build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<project name="jproj" default="compile" basedir=".">
-
+
<!-- ******************************************* -->
<!-- set the variables -->
<!-- ******************************************* -->
@@ -14,7 +14,7 @@
<target name="compile" depends="start, do_javac, jar_it">
<echo>Compilation finished...</echo>
</target>
-
+
<!-- ******************************************* -->
<!-- create some begin stuff -->
<!-- ******************************************* -->
@@ -25,7 +25,7 @@
<mkdir dir="${build}"/>
<mkdir dir="${libs}"/>
</target>
-
+
<!-- ******************************************* -->
<!-- execute javac compilation -->
<!-- ******************************************* -->
@@ -34,21 +34,21 @@
<javac srcdir="${src}" destdir="${build}" debug="on">
</javac>
</target>
-
-
+
+
<!-- ******************************************* -->
<!-- execute javah for JNI headers -->
<!-- ******************************************* -->
- <!-- needed if something if new native methods are added -->
- <!-- ******************************************* -->
+ <!-- needed if new native methods are added -->
+ <!-- ******************************************* -->
<target name="do_javah" depends="do_javac">
<echo>Creating jni headers...</echo>
<exec dir="${build}" executable="javah" os="Linux">
- <arg line="-jni -d ../native org.proj4.Projections"/>
+ <arg line="-jni -d ../native org.proj4.PJ"/>
</exec>
</target>
-
+
<!-- ******************************************* -->
<!-- do the C part compilation through make -->
<!-- ******************************************* -->
@@ -58,11 +58,11 @@
<arg line=""/>
</exec>
</target>
-
+
<!-- ******************************************* -->
<!-- create binary package distribution with ant -->
<!-- ******************************************* -->
-
+
<!-- this is not working properly by now -->
<target name="jar_it">
<delete file="${libs}/jproj.jar"/>
@@ -73,7 +73,7 @@
</jar>
<delete dir="${build}"/>
</target>
-
+
<!-- ****************************************************** -->
<!-- execute doxygen help file and source file creation -->
<!-- ****************************************************** -->
diff --git a/jniwrap/org/proj4/LatLong.java b/jniwrap/org/proj4/LatLong.java
index 221a986f..94093837 100644
--- a/jniwrap/org/proj4/LatLong.java
+++ b/jniwrap/org/proj4/LatLong.java
@@ -14,33 +14,39 @@
REVISION: ---
=====================================================================================*/
-/*
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
+/*
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
*/
package org.proj4;
/**
* class representing a latitude longitude projection
+ *
+ * @deprecated Replaced by {@link PJ}, which doesn't need special subclass for this case.
+ * The conversion of angular values, if needed, is performed directly in the {@link PJ}
+ * native code, because the native code can more easily exploit the information provided
+ * by Proj.4 about the CRS type.
*/
+@Deprecated
public class LatLong extends Projections
{
diff --git a/jniwrap/org/proj4/Makefile.am b/jniwrap/org/proj4/Makefile.am
index 67ed8779..71429aef 100644
--- a/jniwrap/org/proj4/Makefile.am
+++ b/jniwrap/org/proj4/Makefile.am
@@ -1,4 +1,5 @@
-EXTRA_DIST = LatLong.java Others.java Proj4Factory.java Proj4.java \
+EXTRA_DIST = PJ.java PJException.java package-info.java \
+ LatLong.java Others.java Proj4Factory.java Proj4.java \
ProjectionData.java Projections.java
diff --git a/jniwrap/org/proj4/Makefile.in b/jniwrap/org/proj4/Makefile.in
index a59b9980..08214d60 100644
--- a/jniwrap/org/proj4/Makefile.in
+++ b/jniwrap/org/proj4/Makefile.in
@@ -162,7 +162,8 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-EXTRA_DIST = LatLong.java Others.java Proj4Factory.java Proj4.java \
+EXTRA_DIST = PJ.java PJException.java package-info.java \
+ LatLong.java Others.java Proj4Factory.java Proj4.java \
ProjectionData.java Projections.java
all: all-am
diff --git a/jniwrap/org/proj4/Others.java b/jniwrap/org/proj4/Others.java
index fe9d841a..d87a9ab1 100644
--- a/jniwrap/org/proj4/Others.java
+++ b/jniwrap/org/proj4/Others.java
@@ -14,34 +14,40 @@
REVISION: ---
=====================================================================================*/
-/*
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
+/*
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
*/
package org.proj4;
/**
- * class representing a generic projection, i.e. with no particular
+ * class representing a generic projection, i.e. with no particular
* preprocessing needs.
+ *
+ * @deprecated Replaced by {@link PJ}, which doesn't need special subclass for this case.
+ * The conversion of angular values, if needed, is performed directly in the {@link PJ}
+ * native code, because the native code can more easily exploit the information provided
+ * by Proj.4 about the CRS type.
*/
+@Deprecated
public class Others extends Projections
{
diff --git a/jniwrap/org/proj4/PJ.java b/jniwrap/org/proj4/PJ.java
index 21bf7a5a..b1b30c20 100644
--- a/jniwrap/org/proj4/PJ.java
+++ b/jniwrap/org/proj4/PJ.java
@@ -25,7 +25,11 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
+ *****************************************************************************
+ * This file is a copy of a file developed in the GeoAPI "Proj.4 binding"
+ * module (http://www.geoapi.org/geoapi-proj4/index.html). If this file is
+ * modified, please consider synchronizing the changes with GeoAPI.
+ */
package org.proj4;
diff --git a/jniwrap/org/proj4/PJException.java b/jniwrap/org/proj4/PJException.java
index 68897703..ed0dba98 100644
--- a/jniwrap/org/proj4/PJException.java
+++ b/jniwrap/org/proj4/PJException.java
@@ -25,7 +25,11 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
+ *****************************************************************************
+ * This file is a copy of a file developed in the GeoAPI "Proj.4 binding"
+ * module (http://www.geoapi.org/geoapi-proj4/index.html). If this file is
+ * modified, please consider synchronizing the changes with GeoAPI.
+ */
package org.proj4;
diff --git a/jniwrap/org/proj4/Proj4.java b/jniwrap/org/proj4/Proj4.java
index 5873c661..d2fe8b72 100644
--- a/jniwrap/org/proj4/Proj4.java
+++ b/jniwrap/org/proj4/Proj4.java
@@ -2,7 +2,7 @@
FILE: Proj4.java
- DESCRIPTION:
+ DESCRIPTION:
NOTES: ---
AUTHOR: Antonello Andrea
@@ -14,34 +14,34 @@
REVISION: ---
=====================================================================================*/
-/*
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+/*
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
*/
package org.proj4;
import java.util.LinkedHashMap;
/**
- * This is the public
+ * This is the public
* test class to try the jproj api. Reads data from file.
* The input file has three lines of header:<BR>
* 1) source projection code or option <BR>
@@ -58,18 +58,20 @@ import java.util.LinkedHashMap;
* destProj: +init=epsg:32632
* rows: 2
* ...datatriplets
- *
+ *
+ * @deprecated Replaced by {@link PJ}. See package description for usage example.
*/
+@Deprecated
public class Proj4 implements Proj4Factory
{
Projections srcProjection = null;
Projections destProjection = null;
Projections projection = null;
-
+
/**
* constructor used to instatiate a single projection. This is used
* if the goal is to simply get information about a projection definition
- *
+ *
* @param proj the projection definition
*/
public Proj4(String proj)
@@ -83,12 +85,12 @@ public class Proj4 implements Proj4Factory
projection = new Others(proj);
}
}
-
+
/**
* constructor used to instantiate the object for a further reproiection.
- * From the definitions the source and destination projection are
+ * From the definitions the source and destination projection are
* created.
- *
+ *
* @param srcProj
* @param destProj
*/
@@ -115,7 +117,7 @@ public class Proj4 implements Proj4Factory
/**
* method to reproject a dataset from the source projection to the destination
* projection as defined in the constructor
- *
+ *
* @param dataTP the data set to reproject
* @param point_count
* @param point_offset
@@ -134,7 +136,7 @@ public class Proj4 implements Proj4Factory
+ dataTP.z[i]);
}
}
-
+
/**
* @return the projection info as a hashmap
*/
@@ -150,7 +152,7 @@ public class Proj4 implements Proj4Factory
{
return srcProjection.mapProjInfo();
}
-
+
/**
* @return the destination projection info as a hashmap
*/
@@ -158,7 +160,7 @@ public class Proj4 implements Proj4Factory
{
return destProjection.mapProjInfo();
}
-
+
/**
* print the projection info to standard output
@@ -167,7 +169,7 @@ public class Proj4 implements Proj4Factory
{
projection.printProjInfo();
}
-
+
/**
* print the source projection info to standard output
*/
diff --git a/jniwrap/org/proj4/Proj4Factory.java b/jniwrap/org/proj4/Proj4Factory.java
index b480a97f..e9998a7b 100644
--- a/jniwrap/org/proj4/Proj4Factory.java
+++ b/jniwrap/org/proj4/Proj4Factory.java
@@ -2,7 +2,7 @@
FILE: Proj4Factory.java
- DESCRIPTION:
+ DESCRIPTION:
NOTES: ---
AUTHOR: Antonello Andrea
@@ -14,28 +14,28 @@
REVISION: ---
=====================================================================================*/
-/*
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-*/
+/*
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+*/
package org.proj4;
@@ -43,23 +43,27 @@ import java.util.LinkedHashMap;
+/**
+ * @deprecated Replaced by {@link PJ}. See package description for usage example.
+ */
+@Deprecated
public interface Proj4Factory
{
/**
* method to reproject a dataset from the source projection to the destination
* projection as defined in the constructor
- *
+ *
* @param dataTP the data set to reproject
* @param point_count
* @param point_offset
*/
public void transform(ProjectionData dataTP, long point_count, int point_offset);
-
+
/**
* @return the projection info as a hashmap
*/
public LinkedHashMap getProjInfo();
-
+
/**
* @return the source projection info as a hashmap
*/
diff --git a/jniwrap/org/proj4/ProjectionData.java b/jniwrap/org/proj4/ProjectionData.java
index 95356d09..8ee72772 100644
--- a/jniwrap/org/proj4/ProjectionData.java
+++ b/jniwrap/org/proj4/ProjectionData.java
@@ -14,33 +14,39 @@
REVISION: ---
=====================================================================================*/
-/*
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
+/*
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
*/
package org.proj4;
/**
* class representing the dataset to be reprojected
+ *
+ * @deprecated The new {@link PJ} class uses a different layout for coordinate values.
+ * The new layout is the same than the one used by {@link java.awt.geom.AffineTransform}
+ * in Java2D: tuples of (<var>x</var>,<var>y</var>,&lt;<var>y</var>&gt;) coordinates in
+ * a single flat array.
*/
+@Deprecated
public class ProjectionData
{
@@ -52,7 +58,7 @@ public class ProjectionData
public int rows = 0;
/**
- * object to hold the data to be transformed. This will be passed from
+ * object to hold the data to be transformed. This will be passed from
* the starting projection object to the destinantion projection passing through
* the transformation.
*/
@@ -61,7 +67,7 @@ public class ProjectionData
rows = _coord.length;
x = new double[rows];
y = new double[rows];
-
+
for (int i = 0; i < rows; i++)
{
x[i] = _coord[i][0];
diff --git a/jniwrap/org/proj4/Projections.java b/jniwrap/org/proj4/Projections.java
index 289da281..61892074 100644
--- a/jniwrap/org/proj4/Projections.java
+++ b/jniwrap/org/proj4/Projections.java
@@ -2,7 +2,7 @@
FILE: Projections.java
- DESCRIPTION:
+ DESCRIPTION:
NOTES: ---
AUTHOR: Antonello Andrea
@@ -14,27 +14,27 @@
REVISION: ---
=====================================================================================*/
-/*
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
+/*
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
*/
package org.proj4;
@@ -42,7 +42,10 @@ import java.util.LinkedHashMap;
/**
* superclass of all the projections the main proj methods are held here
+ *
+ * @deprecated Replaced by {@link PJ}.
*/
+@Deprecated
public abstract class Projections
{
@@ -88,45 +91,58 @@ public abstract class Projections
}
/**
- * get all the projection informations needed from the
+ * get all the projection informations needed from the
* projection code (reproduces pj_get_def() of the proj api)
- *
+ *
* @param the proj code or options
* @return the info String
+ *
+ * @deprecated Replaced by {@link PJ#getDefinition()}.
*/
+ @Deprecated
protected native String getProjInfo(String proj);
/**
- * get the ellipsoid parameters from the
+ * get the ellipsoid parameters from the
* projection code
- *
+ *
* @param the proj code or options
* @return the info String
+ *
+ * @deprecated Replaced by {@link PJ#getSemiMajorAxis()}, {@link PJ#getSemiMinorAxis()},
+ * {@link PJ#getEccentricitySquared()} and {@link PJ#getDefinition()}.
*/
+ @Deprecated
protected native String getEllipsInfo(String proj);
/**
* native call to the reprojections routines of proj
- *
+ *
* @param firstCoord array of x
* @param secondCoord array of y
* @param values array of z
* @param srcCodeString source projection code or option
* @param destCodeString destination projection code or option
- * @param pointcount
+ * @param pointcount
* @param pointoffset
+ *
+ * @deprecated Replaced by {@link PJ#transform(PJ, int, double[], int, int)}.
*/
+ @Deprecated
protected native void transform(double[] firstCoord, double[] secondCoord,
double[] values, String srcCodeString, String destCodeString,
long pointcount, int pointoffset);
/**
* public method to call the native getProjInfo
- *
- * @return quoting the proj api:"Returns the PROJ.4 command string that
- * would produce this definition expanded as much as possible. For
+ *
+ * @return quoting the proj api:"Returns the PROJ.4 command string that
+ * would produce this definition expanded as much as possible. For
* instance, +init= calls and +datum= defintions would be expanded"
+ *
+ * @deprecated Replaced by {@link PJ#getDefinition()}.
*/
+ @Deprecated
public String getProjInfo()
{
return getProjInfo(proj);
@@ -134,9 +150,13 @@ public abstract class Projections
/**
* public method to call the native getEllispdInfo
- *
+ *
* @return the list of ellipsoid parameters
+ *
+ * @deprecated Replaced by {@link PJ#getSemiMajorAxis()}, {@link PJ#getSemiMinorAxis()},
+ * {@link PJ#getEccentricitySquared()} and {@link PJ#getDefinition()}.
*/
+ @Deprecated
public String getEllipseInfo()
{
return getEllipsInfo(proj);
@@ -144,7 +164,10 @@ public abstract class Projections
/**
* print to standard output the proj info in a nice format
+ *
+ * @deprecated Replaced by {@link PJ#toString()}.
*/
+ @Deprecated
public void printProjInfo()
{
String projinfo = getProjInfo();
@@ -215,18 +238,22 @@ public abstract class Projections
* if there is some operation to perform on the input data, this is
* the right moment (ex. latlong from degree to radiant)
* -> i.e. do whatever is needed
- *
+ *
* @param dataTP
+ *
+ * @deprecated The conversion from degrees to radians is now performed directly by
+ * {@link PJ#transform(PJ, int, double[], int, int)}.
*/
+ @Deprecated
public abstract void prepareData(ProjectionData dataTP);
/**
- * do the transform. The srcProjection is passed to the destination proj and
+ * do the transform. The srcProjection is passed to the destination proj and
* the transformation takes place. Then the resulting transformed data
- * are passed to the destProj, so that the destProj in case can take care of
- * final transformation of data (ex. if the destProj is latlong, the values
+ * are passed to the destProj, so that the destProj in case can take care of
+ * final transformation of data (ex. if the destProj is latlong, the values
* have to be set beck to degrees
- *
+ *
* @param srcProj object holding the source projection
* @param dataTP the data set
* @param point_count
@@ -241,18 +268,26 @@ public abstract class Projections
/**
* this takes care that the reprojected data are in the correct format
- * (ex. latlong has to be transformed back to radiant)
- *
+ * (ex. latlong has to be transformed back to radiant)
+ *
* @param dataTP the data set
+ *
+ * @deprecated The conversion from radians to degrees is now performed directly by
+ * {@link PJ#transform(PJ, int, double[], int, int)}.
*/
+ @Deprecated
public abstract void prepareTransformedData(ProjectionData dataTP);
/**
* transform latitude and longitude from degree to radiant format
- *
+ *
* @param la
* @param lo
+ *
+ * @deprecated The conversion from degrees to radians is now performed directly by
+ * {@link PJ#transform(PJ, int, double[], int, int)}.
*/
+ @Deprecated
protected void degreeToRadiant(double[] la, double[] lo)
{
for (int i = 0; i < la.length; i++)
@@ -264,10 +299,14 @@ public abstract class Projections
/**
* transform latitude and longitude from radiant to degree format
- *
+ *
* @param la
* @param lo
+ *
+ * @deprecated The conversion from radians to degrees is now performed directly by
+ * {@link PJ#transform(PJ, int, double[], int, int)}.
*/
+ @Deprecated
protected void radiantToDegree(double[] la, double[] lo)
{
for (int i = 0; i < la.length; i++)
diff --git a/jniwrap/org/proj4/package-info.java b/jniwrap/org/proj4/package-info.java
index 17a5767c..30e8ffe7 100644
--- a/jniwrap/org/proj4/package-info.java
+++ b/jniwrap/org/proj4/package-info.java
@@ -25,7 +25,11 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
+ *****************************************************************************
+ * This file is a copy of a file developed in the GeoAPI "Proj.4 binding"
+ * module (http://www.geoapi.org/geoapi-proj4/index.html). If this file is
+ * modified, please consider synchronizing the changes with GeoAPI.
+ */
/**
* Wrappers for the <a href="http://proj.osgeo.org/">Proj4</a> library. The {@link org.proj4.PJ}