i’m not sure if this is the correct place to ask (or if i should be asking on the talk-us mailing list instead) but i’m trying to find some lat/long polygons that define the states of the USA and all the cities/towns, etc in the USA.
I know the the Cenus Bureau release the TIGER lines, etc. … and a lot of that data is available @ OSM … but i’m not sure how i can access this data
Can anyone either help me or direct me to some people/places for help?
This data is to be used to data mine some demographic data we have (eg. crime stats, marriages/deaths/births, etc).
If you want to get only the state boundaries then I guess the OSM XAPI seems the way to go. The Tiger page in the wiki can probably help you determine what parameters you need to feed to the XAPI.
Firstly, is this the correct forum to ask this question or should i be on one of hte mailing lists instead, asking the question
Secondly, i’ve looked at both those pages and i’m completely confused I can’t see anything that hints at parameters which i should be using, to find the boundaries for states and cities. I understand API’s and use them a lot … but i’m just can’t seem to pick out the relevant information on both pages
To try and show you that i’ve had a look and had a go at trying to understand things, I’m guessing i’m going to want to get a type of relation from Xapi but i need to provide the correct predicates, which is what i’m struggling to locate?
You may ofcourse use any available mediums to communicate with other users. Using the medium that you like the most is usually the best choice Having said that, the mailing lists are round much longer then the forum and many OSM oldtimers (who know a lot) prefer the mailinglists, so it is possible that the ml can help you better and faster then the forum. But on the other hand, the forum is more userfriendly to many people… so the choice is yours.
As border_type is a sub-tag of boundary and maybe others, it would be nice to be able to use both parameters in order to download only the administrative borders, but afaik the api can’t do that (e.g. [boundary=administrative][border_type=state]). But border_type alone will probably do the job just fine.
Ok, so i’m trying to understand the XApi interface to see what data exists, etc. based on your suggestions above.
Questions:
I need to use tag predicates so I’m assuming these can be refrenced here ?
Can i use multiple predicates → like [border_type=state][key=value] ?
can i use the tag predicate place to get the shapes that define the provided key? eg. continent or suburb? Or are these predicates just a single point (node) with some text to list on a map … and not a list of points that form the shape?
Do i have to provide a bounding box or can i provide some type of country predicate? What happens if i provide a box for the USA and it includes some area of Canada inside? Can i make sure i don’t include any canadian results?
Yes, but that list is not complete. You can safely assume it lists the most used and important tags, but there are many more.
Unfortunately, no. If you really need this then I suggest using Osmosis and filter the information from the planet database dump. This is the advanced stuff
Yes I think so, using the e.g. way[place=state] argument. But I wonder how much information is available like that. Maybe you just need to try…
No and No For such complex stuff you need post processing or start using Osmosis.
thanks for the continued help I’ve got a few more q’s, still
I’m assuming that the data (states, counties, cities and neighbourhoods) exists in the planet data dump. i just need to query it correctly, using something like Osmosis?
If i don’t want to use the java prog Osmosis then i’ll need to download my own data and create my own import code (such as a .NET winform) into sql2008?
If i need to download the my own data for my own import program, then is there a location where i could download the data by country (eg. USA, UK, Canada and Australia as a start)?
If there are country specific data dumps available, then this will include all the data, which i’ll end up importing but probably never use if i’m after certain tag predicates (eg. boundaries only)?
You can’t assume that, they are not complete at all. Openstreetmap doesn’t really aim to have everything complete, we only get that when people want that completeness and make it complete on their own. So all help you can offer is greatly appriciated. E.g. Sweden doesn’t have a complete border. You should look around in Potlatch on the borders you want to have to see if it’s complete.
You want to use Osmosis, it is the the Suisse Army knife of OSM. And it takes ~10-20min to set up, including installation of Java.
How are these extracts constructed? someone is really nice and figures out the complex bounding polygon-box for a particular country and then generates it for the community?
They use Osmosis and a Polygon/bounding box, these are not exact borders of countries. I think you might find the polygons used for export at some of those sites.