Issue Type: Bug Bug
Affects Versions: 8.7, 9.0, 8.2
Assignee: Andrea Aime
Components: referencing
Created: 11/Apr/13 10:17 AM
Description:

Hi everybody !

I'm afraid I may have found a bug in the geotools projection library. I'm trying to re-project some data from EPSG:27572 to EPSG:4326. In order to achieve what I want to do, I need to reproject data themselves on the server side and to reproject the boundary box of the data on the client side - the client does only know that the targeted projection is available and the couple bounding box/original projection. That's for the context...

To achieve my goals, I retrieve the original projection by two different ways. First, I use the prj file of my original shape to build the CRS (on the server side). In the code, that gives something like :

InputStream i = new FileInputStream(file);
BufferedReader r = new BufferedReader(new InputStreamReader(stream));
StringBuilder b = new StringBuilder();
while (r.ready())

{ b.append(r.readLine()); }

return CRS.parseWKT(b.toString());

Basically, I read my file and create my CRS with it.

On the client side, I just know the EPSG code and the bounding box, so I do
something like that :

CoordinateReferenceSystem inputCRS = CRS.decode(originalSrs);

Quite simpler, so originalSrs is my EPSG code as a string (i.e. EPSG:27572)

Comparing the two generated CoordinateReferenceSystem instances... it seems that they are :

  • associated to the same EPSG code
  • different.

I'm not a geodesy specialist, but I find that these two points happening at the same time is strange... For the client's code point of view, this problem means that I'm not able to retrieve my data as I'm not searching at the good place.

The difference seems to be that the datum associated to the CRS are different. For what I've understood (I may be wrong here), Greenwich takes the place of Paris in the first case while Paris seems to be at the good position on the second case.

Bug reproduced on geotools 8.2, 8.7, 9.0.

In the shapefile's prj, we have :

PROJCS["NTF (Paris) / Lambert zone II",
GEOGCS["NTF (Paris)",
DATUM["Nouvelle Triangulation Francaise (Paris)",
SPHEROID["Clarke 1880 (IGN)",6378249.2,293.4660212936269,
AUTHORITY["EPSG","7011"]],
AUTHORITY["EPSG","6807"]],
PRIMEM["Paris", 2.5969213,
AUTHORITY["EPSG","8903"]],
UNIT["grade", 0.015707963267948967],
AXIS["Geodetic longitude", EAST],
AXIS["Geodetic latitude", NORTH],
AUTHORITY["EPSG","4807"]],
PROJECTION["Lambert_Conformal_Conic_1SP",
AUTHORITY["EPSG","9801"]],
PARAMETER["central_meridian", 0.0],
PARAMETER["latitude_of_origin", 52.0],
PARAMETER["scale_factor", 0.99987742],
PARAMETER["false_easting", 600000.0],
PARAMETER["false_northing", 2200000.0],
UNIT["m", 1.0],
AXIS["Easting", EAST],
AXIS["Northing", NORTH],
AUTHORITY["EPSG","27572"]]

Environment: java version "1.7.0_17"
openSUSE 12.3 x86_64
Project: GeoTools
Priority: Major Major
Reporter: Guéganno Alexis
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to