[MetaCRS] Re: [OpenLayers-Dev] SRS transform problem EPSG:900913 -> EPSG:23030

Christopher Schmidt crschmidt at metacarta.com
Fri Feb 20 05:47:06 PST 2009


On Fri, Feb 20, 2009 at 11:50:09AM +0100, Patrick O'Brian wrote:
> Hi all,
> 
> we are using google map layer with WMS from GeoServer using EPSG:23030.
> We have detected a difference between geotools and OpenLayers srs
> conversions using EPSG:900913 -> EPSG:23030.
> Example:
> 900913 => (-754113.99,4563131.15)
> 23030_OpenLayers => (168035.13030878676,4199884.834826067)
> 23030_GeoTools2.5.3 => (168141.88493782945,4199937.868013817)
> 
> which is a huge difference:
> dx=106.75462904269 m
> dy=53.033187750 m
> 
> The WMS image fits with google layer, but the cursor track shows a diferent
> position than the database and the image with the geoserver preview.
> 
> Can anyone tell us which is the correct srs conversion?

Not I, but this is  one of two things:

 1. a proj4js bug in porting proj
 2. A disagreement in the meaning of the spatial reference.

Looking at http://www.spatialreference.org/ref/epsg/23030/ , this is one
of these ED50 projections I hear so much about: As I understand it, thre
are multiple interpretations of ED50 projections depending on where you
are. it seems that OpenLayers and GeoTools are making different default
assumptions.

I think the most likely solution here is that you will need to add a
+towgs84 parameter to the proj4js string. It looks like the default for
23030 in GeoTools is:

 TOWGS84[-157.89, -17.16, -78.41, 2.118, 2.697, -1.434, -1.1097046576093785], 

So, if you take:

  Proj4js.defs["EPSG:23030"] = "+proj=utm +zone=30 +ellps=intl +units=m
  +no_defs";

And add +towgs84:

Proj4js.defs["EPSG:23030"] = "+proj=utm +zone=30 +ellps=intl +units=m
+togs84=-157.89,-17.16,-78.41,2.118,2.697,-1.434,-1.1097046576093785
+no_defs"

The projection might work out better.

CCing metacrs so that someone can tell me if I'm wrong here.

Regards, 
-- 
Christopher Schmidt
MetaCarta


More information about the MetaCRS mailing list