[postgis-users] SQL Query to get the polygons that make up a country?

Torsten Mohr tmohr at s.netic.de
Fri Dec 3 10:54:31 PST 2010


Hi,

i just re-installed PostGIS and imported an OSM planet file.

I'd like to formulate a query that gives me the borders of a country in 
latitute / longitude.

I already got a query (with help from this list) to get all capitols:

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;

This query works quite fine.


Can anybody give me a hint what would be a valid query to get one (or more !) 
polygons that make up a country (if that country covers two or more areas or 
has holes in it)?


Thanks for any hints,
Torsten.




More information about the postgis-users mailing list