[postgis-users] Query using ST_transform fails

Torsten Mohr tmohr at s.netic.de
Tue Nov 2 14:09:45 PDT 2010


Hello,

(i accidentially posted this on the openstreetmap mailing list, but it
belongs here:)


I once got a hint on this mailing list to use a query like this to get the 
lat/lon of the world capitals:

A)
select st_X(wayLL), st_Y(wayLL), name from (select 
ST_AsText(ST_Transform(way,4326)) as wayLL, name from planet_osm_point where 
capital='yes') as foo limit 5;

B)
Based on that hint i used this query:
select st_X(st_transform(way,4326)), st_Y(st_transform(way,4326)), name from 
planet_osm_point where place='city' and capital='yes';

That query worked fine and i did not change my system since then (that somehow
can't be true).  I now get errors for both queries:

FEHLER:  transform: couldn't project point (653103 6.63036e+06 0): failed to 
load NAD27-83 correction file (-38)
TIP:  PostGIS was unable to transform the point because either no grid shift 
files were found, or the point does not lie within the range for which the 
grid shift is defined. Refer to the ST_Transform() section of the PostGIS 
manual for details on how to configure PostGIS to alter this behaviour.


Could it be that due to an RPM update of PostgreSQL some scripts need to be 
reinstalled?  I can still generate maps using mapnik.


What do i need to do to make those queries work again?


In a second step i'd like to extract the polygons that make up the borders
of a country as lat/lon values.  I wonder if this is possible by just applying
the SQL query above to the way of a polygon?  Or is there another way to
get the data i want?


Thanks for any hints,
Torsten.



More information about the postgis-users mailing list