GeoServer re-projecting feature dosn't work with custom CS reprojection
-----------------------------------------------------------------------
Key: GEOS-4839
URL: https://jira.codehaus.org/browse/GEOS-4839
Project: GeoServer
Issue Type: Bug
Components: WFS
Affects Versions: 2.1.2
Environment: -
Reporter: Krunoslav Hrnjak
Assignee: Andrea Aime
Attachments: WGS84.zip
GeoServer re-projection don't work well with custom coordinate system. It seems that underlying GeoTools are using the same but wrong algorithm for re projection as PROJ4 does.
I have attached shape file with five points. Shape is using WGS84 CS, and it is published over WFS. Re-projection into custom coordinate system is producing wrong result.
To reproduce error do the following:
You can add following custom CS in epsg.properties:
2400000=PROJCS["ARM_PCS_3",GEOGCS["ARM_GCS",DATUM["ARM_D",SPHEROID["Krasovsky_1940",6378245,298.300000000038],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",45],PARAMETER["scale_factor",1],PARAMETER["false_easting",8500000],PARAMETER["false_northing",0],UNIT["METER",1]]
Definition is correct and it could be seen in GS under Demo->SRS List
Original shape file points are available with following WFS req. (host where shape is published must be changed since it is available only inside our LAN):
http://arpis-dev01-as01:8080/gs_arpis/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=arpis:WGS
those points are:
41.1 43.5 41.1 45.75 38.9 46.75 40.0 43.5 40.0 45.0 41.1 43.5
If You make a re projection request:
http://arpis-dev01-as01:8080/gs_arpis/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=arpis:WGS&srsName=EPSG:2400000
points are reprojected as:
8373984.019727264 4552841.052693648 8563007.246418444 4552027.647279177 8651816.99968695 4308932.2930188915 8371904.452686488 4430682.6452471465 8500000.0 4429604.706036308 8373984.019727264 4552841.052693648
Instead following result should be given:
8373984.065831696 4552843.731003787 8563007.22337102 4552030.32549453 8651816.94900331 4308934.934711369 8371904.49749204 4430685.307172269 8500000.0 4429607.367801045 8373984.065831696 4552843.731003787
There is also ticket open for PROJ4.
http://trac.osgeo.org/proj/ticket/127#comment:1
The same wrong result is returned by Open Layer when calculating re projection with PROJ4JS
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira