2

I've got a POINTS PostGIS table in the 23030 (ED50 UTM 30N) SRID.

I'm having a lot of problems trying to reproject those points from ED50 UTM coordinate system to ETRS89 Geographic (lat/long) coordinate system. The aim is to convert the points for Google Maps.

I take an example point for my tests:

x: 499462.1
y: 4799340.56 

1.- If i just transform the point from UTM (23030) to Geographic lat/long (4230) using the ST_TRANSFORM("GEOMETRY",4230) PostGIS function. I get the following coordinates:

long: -3.00663639334493
lat: 43.3461345057409

You can see in the picture where it is located in Google Maps. It has sense to be located in a different place to the original point, because although being in Geographic projection system it is not in ETRS89/WGS84.

2.- So I reproject the original point first to ETRS89 (nearly the same as Google's WGS84) using ST_TRANSFORM("GEOMETRY",25830) and I get the following point:

x=499462.124763252
y=4799253.63249274

Ok, if I load that point in a GIS, I can see there is a difference between the previous point which is ok as I have changed the SRID.

3.-I thought that if I reprojected the ETRS89 UTM point to ETRS89 lat/long it would be enough for getting the coords valid for Google Maps. The surprise came when I got the same point of the step1!!! (just doing the 4230 transformation)

I used a ST_TRANSFORM(ST_TRANSFORM("GEOMETRY",25830),4258) UPDATE query applied to the original point.

https://www.dropbox.com/s/6r82qtimboxnf9z/ejemplo_foros.png I don't really know how to solve this mess, I'm really confused.

2
  • 1
    From what you described, this looks to be the usual error one expects when converting from one projection system to another, possibly coupled with the minor inaccuracies of Google Maps. What are the points you're trying to plot? Which of the points in your picture is the true point of interest?
    – Richard D
    Nov 12, 2013 at 6:18
  • What i am trying to plot are house numbers. The point i am trying to plot on google maps is the one in the middle of the picture.
    – Egidi
    Nov 12, 2013 at 7:47

1 Answer 1

3

EPSG:4230 is ED50 lat/long. The proj definition string is:

+proj=longlat +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +no_defs

which means that the ED50 ellipsoid is around 100m offset in all three earth-centered directions.

The "true" ETRS89 lat/long EPSG:4258 definition is:

+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs

which is almost the same as WGS84 definition (see that +towgs84 vaues are all zero).

On Google Maps, you have to enter lat/long always in WGS84. That is why your first points coordinates are misplaced if you enter ED50 values where WGS84 is expected.

I advice you to use a real GIS software like QGIS to view the differences. You can add a Google satellite background with the openlayers plugin.

3
  • Where are the proj definition strings stored? In a PostGIS table?
    – Richard D
    Nov 13, 2013 at 1:04
  • Yes, table spatial_ref_sys. You can look it up with pgAdminIII. Or use www.spatialreference.org, but some entries there are outdated.
    – AndreJ
    Nov 13, 2013 at 5:07
  • 1
    Thanks Andre, this finally helped me. I din't notice that in my spatial_ref_sys table i din't have the +towgs84=-87,-98,-121,0,0,0,0 paremeter in the 4230 SRID definiton string. After addin git i just did: st_x(st_transform(st_transform("GEOMETRY", 4230),4326)) AS long_wgs84_4326, st_y(st_transform(st_transform("GEOMETRY", 4230),4326)) AS lat_wgs84_4326, to obtain the new wgs84 geographic coords.
    – Egidi
    Nov 13, 2013 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.