[postgis-users] Transformations to RT90 2.5 gon W have a ~200 merror

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Thu Mar 31 05:03:08 PST 2005


Hi Lars,

(cut)

> The green diamonds are the same points as the ones in the 
> RT90 column, but projected from WGS84 using another method - 
> and they are correct. They line up with the raster layer to 
> within 15 meters (which is an acceptable error because they 
> are captured with simple handheld GPS devices). The pink 
> diamonds are the points from the RT90 columns, transformed by 
> PostGIS, and all of them are about 200 meters SW of the "real" points.
> 
> I have tried both the coordinate systems with SRID 2400 (RT90 
> 2.5 gon W) and SRID 3021 (RT90 2.5 gon V), they seem to give 
> identical results.
> 
> The green diamonds are projected using command line proj and 
> a set of parameters that someone gave to me, saying that it 
> was an approximation of RT90 with an error of a few meters 
> within Sweden. The command line is
> this:
> 
> proj +proj=tmerc +ellps=GRS80 +lon_0="15d48\'22.624306E"
> +x_0=1500064.274 +y_0=-667.711 +k=1.00000561024 -r

Right so this is the PROJ.4 string being used to reproject your green
points.

> Are the RT90 2.5 gon W systems in the spatial_ref_sys table 
> incorrect, or am I using them incorrectly?

Well they are certainly different to the definitions in the spatial_ref_sys
table... The proj4text field is simply the PROJ.4 string used to project
your points:


postgis=# select proj4text from spatial_ref_sys where srid = 2400;
                                                   proj4text

----------------------------------------------------------------------------
------------------------------------
 +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1.000000 +x_0=1500000
+y_0=0 +ellps=bessel +units=m +no_defs
(1 row)

postgis=# select proj4text from spatial_ref_sys where srid = 3021;
                                                   proj4text

----------------------------------------------------------------------------
------------------------------------
 +proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1.000000 +x_0=1500000
+y_0=0 +ellps=bessel +units=m +no_defs
(1 row)


The parameters +x_0 and +y_0 relate to your false easting and false northing
- in your original PROJ.4 string used for your green diamonds these values
are different, hence why the pink diamonds appear shifted lower and to the
left of your green diamonds.

Now whether the PostGIS spatial_ref_sys entry is incorrect or not, I am not
sure....

> Is there any way to insert my approximation into 
> spatial_ref_sys and use that instead? I suppose it would have 
> to be changed so it projects long lat to X Y instead, and I 
> would need some sort of srtext. I really don't know much 
> about proj or the srtext format though.

Sure. You can do something like:

1. Create your own entry in the spatial_ref_table with a new SRID and a
proj4text the similar to that used by your green diamonds: +proj=tmerc
+ellps=GRS80 +lon_0="15d48'22.624306E" +x_0=1500064.274 +y_0=-667.711
+k=1.00000561024

2. Drop the SRID constraint on your geometry table

3. Set the SRIDs on your geometries in your point table to your new value
using an SQL UPDATE.

4. Alter your trigger to use the new SRID.



Hope this helps,

Mark.

------------------------
WebBased Ltd
South West Technology Centre
Tamar Science Park
Plymouth
PL6 8BT 

T: +44 (0)1752 791021
F: +44 (0)1752 791023
W: http://www.webbased.co.uk





More information about the postgis-users mailing list