I am trying to get the longitude/latitude points for the admin boundary for the entire US coast. Can I get this data from your site? If so, how? asked 22 Sep '11, 17:11 ljd |
My answer is valid for all countries: First, you have to find the entity representing the admin boundary. Usually, country borders are identified by an OSM relation of type boundary=administrative with admin_level=2. One method to find it is to use an OSM editor and download an area where you know that the boundary is present and seek the relation id. Next, you have different ways to retrieve the relation 148838 and all its members, the collection of ways and nodes representing the admin boundary. The problem is the size of this relation. It is normally possible to retrieve all information in one request to the OSM server but this will fail for such big relations. I know a python script which downloads all relation members one by one. But you can also use the editor JOSM and the command "Download object..." where you specify the Object type "node" and Object ID "424317935" with the option "Download referrers". Then, save the content with the menu "File" -> "Save As...". You have now an XML file containing all ways and nodes with their lat/lon coordinates. If you need a shapefile, you will have to use a script converting OSM data to this format. Be aware that many countries have more than one relation identifying the boundary (e.g. with and without the territorial waters). answered 22 Sep '11, 20:04 Pieren |