Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
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 '13 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 '13 at 7:47

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Where are the proj definition strings stored? In a PostGIS table? –  Richard D Nov 13 '13 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 '13 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 '13 at 11:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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