[OSM-talk] features of a given type within bounding box
I'm trying to determine whether the open Street map API can be used to extract lists of large high-level geographic features -- e.g. US states, counties, or postal codes -- within a given bounding box. As far as I can tell by looking here: http://wiki.openstreetmap.org/wiki/Map_Features http://wiki.openstreetmap.org/wiki/Map_Features#Places it seems like the OSM data contains information on all the types of entities I care about. On the other hand, the API described here: http://wiki.openstreetmap.org/wiki/API_v0.6 describes how to get data within a given bounding box.However, this seems to return _all_ points and ways within the bounding box, and as a result, the largest boxes I can use is much smaller than what I need. What I would like to do is to be able to limit the request to only return lists of features of a particular type, e.g. county, state or posal code -- and, consequently, be able to query much larger regions. Is the OSM api capable of this? If so, is there a place I can read about how to do it? If not, could someone point me to a project that might give this sort of capability? (I'm mostly interest in US data). Thanks! Dan ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
Hi Dan, You should have a look at XAPI: http://wiki.openstreetmap.org/wiki/XAPI --Ciprian On Mon, Apr 19, 2010 at 5:57 PM, Dan Yamins dyam...@gmail.com wrote: I'm trying to determine whether the open Street map API can be used to extract lists of large high-level geographic features -- e.g. US states, counties, or postal codes -- within a given bounding box. As far as I can tell by looking here: http://wiki.openstreetmap.org/wiki/Map_Features http://wiki.openstreetmap.org/wiki/Map_Features#Places it seems like the OSM data contains information on all the types of entities I care about. On the other hand, the API described here: http://wiki.openstreetmap.org/wiki/API_v0.6 describes how to get data within a given bounding box.However, this seems to return _all_ points and ways within the bounding box, and as a result, the largest boxes I can use is much smaller than what I need. What I would like to do is to be able to limit the request to only return lists of features of a particular type, e.g. county, state or posal code -- and, consequently, be able to query much larger regions. Is the OSM api capable of this? If so, is there a place I can read about how to do it? If not, could someone point me to a project that might give this sort of capability? (I'm mostly interest in US data). Thanks! Dan ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
Hi, Am Montag 19. April 2010 16:57:48 schrieb Dan Yamins: What I would like to do is to be able to limit the request to only return lists of features of a particular type, e.g. county, state or posal code -- and, consequently, be able to query much larger regions. have a look at the XAPI, http://wiki.openstreetmap.org/wiki/Xapi Greetings, Carsten -- Hier ist mein öffentlicher GPG-Schlüssel: http://daswaldhorn.piranho.de/gpg.php = www.stopptdievorratsdatenspeicherung.de signature.asc Description: This is a digitally signed message part. ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
Thanks Carsten and Ciprian for your quick responses. I really appreciate it. I'm assuming that you both are suggestion that I do something like: /node[place=county][bbox=W,S,E,N] This seems like it definitely works. Thank you for your help! Is there some way of doing this for US postal_codes as well? I guess what I'm asking is: is there an equivalent of /node[place=postal_code][bbox=W,S,E,N] ? Thanks, Dan On Mon, Apr 19, 2010 at 11:12 AM, Carsten Gerlach daswaldh...@gmx.dewrote: Hi, Am Montag 19. April 2010 16:57:48 schrieb Dan Yamins: What I would like to do is to be able to limit the request to only return lists of features of a particular type, e.g. county, state or posal code -- and, consequently, be able to query much larger regions. have a look at the XAPI, http://wiki.openstreetmap.org/wiki/Xapi Greetings, Carsten -- Hier ist mein öffentlicher GPG-Schlüssel: http://daswaldhorn.piranho.de/gpg.php = www.stopptdievorratsdatenspeicherung.de ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
On Mon, Apr 19, 2010 at 11:32 AM, Dan Yamins dyam...@gmail.com wrote: Thanks Carsten and Ciprian for your quick responses. I really appreciate it. I'm assuming that you both are suggestion that I do something like: /node[place=county][bbox=W,S,E,N] This seems like it definitely works. Thank you for your help! Is there some way of doing this for US postal_codes as well? I guess what I'm asking is: is there an equivalent of /node[place=postal_code][bbox=W,S,E,N] Try it. You should find that it works, but that zip code coverage is uneven. ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
[you sent direct, rather than to the list. I fix. ;-)] On Mon, Apr 19, 2010 at 12:54 PM, Dan Yamins dyam...@gmail.com wrote: /node[place=postal_code][bbox=W,S,E,N] Try it. You should find that it works, but that zip code coverage is uneven. Hm ... either it's not working, or zip code coverage is so uneven that there really aren't any in the Northeastern US ... ? For instance: /node[place=postal_code][bbox=-85,40,-72,47] yields no results. Am I doing something wrong? Or is US zip code coverage essentially nil? Try http://osmxapi.hypercube.telascience.org/api/0.6/node[addr:postcode][bbox=-85,40,-72,47] Works like a champ. zip codes got added to the Karlsruhe Schema for addressing data. http://wiki.openstreetmap.org/wiki/Karlsruhe_schema ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
Try http://osmxapi.hypercube.telascience.org/api/0.6/node[addr:postcode][bbox=-85,40,-72,47] Works like a champ. zip codes got added to the Karlsruhe Schema for addressing data. http://wiki.openstreetmap.org/wiki/Karlsruhe_schema I see -- that makes -- thank you! From looking at the results of those calls it seems like perhaps OSM is doing something quite different from what I'm looking for. I was hoping that, independently of the particular individual locations that people have posted to the system, the basic administrative units that apply to these regions would all already have been added. E.g. that in the US, all states, counties, and postal code boundary regions would have been integrated, and then available for bounding-box search. So for instance, let's say I wanted to have a list of all zip codes in a given bounding box, is there a way to achieve that? The call http://osmxapi.hypercube.telascience.org/api/0.6/node[addr:postcode][bbox=-74,40,-72,42] clearly does NOT produce the list of all zipcodes in new york city. Is it accurate to say that OSM does not provide an API call that is even intended to do this, and that OSM may not even have th relevant underlying data (e.g. the boundary files for all the basic adminstrative units in the US)? If os, does anyone know of an open source service that _does_ do this? Or even an entry-level commerical API service? Thanks, Dan http://wiki.openstreetmap.org/wiki/Karlsruhe_schema ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
Hi, Am Montag 19. April 2010 19:41:05 schrieb Dan Yamins: The call http://osmxapi.hypercube.telascience.org/api/0.6/node[addr:postcode][bbox=- 74,40,-72,42] clearly does NOT produce the list of all zipcodes in new york city. Well, you should try .../api/0.6/*[... (notice the *) to get also ways and relations, which contain the tag addr:postcode. Some users tag the address information to the buildings and those are ways... And second point is, -74.25,40.4,-73.7,40.9 is the bounding box for NYC, or? Have a look at http://www.openstreetmap.org/browse/relation/175905 Greetings, Carsten -- Hier ist mein öffentlicher GPG-Schlüssel: http://daswaldhorn.piranho.de/gpg.php = www.stopptdievorratsdatenspeicherung.de signature.asc Description: This is a digitally signed message part. ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
Well, you should try .../api/0.6/*[... (notice the *) to get also ways and relations, which contain the tag addr:postcode. http://osmxapi.hypercube.telascience.org/api/0.6/*[addr:postcode][bbox=-74,40,-72,42] Some users tag the address information to the buildings and those are ways... And second point is, -74.25,40.4,-73.7,40.9 is the bounding box for NYC, or? No, I was being liberal in my estimates.But I still think I'm not communicating my question properly. What I'm looking for is NOT a list of addresses. I'm looking for lists of administrative regions -- be the states, counties, postal code regions, etc..., and really any of the boundary files that define the various place levels as recognized by OSM. So, while http://osmxapi.hypercube.telascience.org/api/0.6/*[addr:postcode][bbox=-74,40,-72,42] returns locations that probably contain many of the zip codes in that bounding box, the results to do NOT contain all the zip codes in that region (e.g. '11021' is definitely within that box, but is not contained in any address that is currently in the OSM database. Even if all the zip codes _were_ in this list somewhere, since my goes to obtain that list of zip codes (or states, or whatever) and not speciific addresses, I'd have to do some serious parsing on the list, -- and anyway, the downloaded thing which be much larger than what I was looking for to start with, and therefore much less efficient. So let me restate my questions better: 1) Does OSM have or not have any facility to obtain as results of an API call a list of administrative units that intersect a given bounding box, backed -- presumbly -- by a set of adminstrative-region shapefiles that are basically comprehensive and complete for the US? 2) If it doesn't have that facility, can someone point me to a service that might? Thanks! Dan Have a look at http://www.openstreetmap.org/browse/relation/175905 Greetings, Carsten -- Hier ist mein öffentlicher GPG-Schlüssel: http://daswaldhorn.piranho.de/gpg.php = www.stopptdievorratsdatenspeicherung.de ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk
Re: [OSM-talk] features of a given type within bounding box
[set reply back to list] On Mon, Apr 19, 2010 at 3:19 PM, Dan Yamins dyam...@gmail.com wrote: On Mon, Apr 19, 2010 at 3:03 PM, Richard Weait rich...@weait.com wrote: [ trimmed ] You might check with talk-us to see if somebody is already working on zip codes. The first problem might be finding a source for the zipcode data that is license-compatible with OSM. Got it. I will ask, as you suggest. I should have added one more question in my list: 3) Given that OSM does have this capability (module which files are loaded), what API syntax do I use to access it generally? I think I understand how to capture lists of counties, states, etc... using the /[place=BLAH][bbox=BLAH] syntax. But what about zipcodes? For instance, http://osmxapi.hypercube.telascience.org/api/0.6/*[addr:postcode][bbox=-74,40,-72,42] yields lists of points. My question is therefore: is postal_code even going to considered one of the types of places, in the OSM project? Or the equivalent? Or is this a question I should ask to talk-us specifically as well? The last conversation I recall discussed the relative merits of post codes as nodes vs. post codes as areas. Clearly OSM would prefer one zip code schema for the planet, rather than one per country. For context, consider this awesome 3 minute video by Derek Sivers. The video is both informative and better than Cats! http://sivers.org/jaddr XAPI will certainly be one way to access the data by bounding box. You may choose to post-process the result, refine the query, or both. Your query will depend on the implementation decided by the community. As an alternative, you might consider setting up a local OSM spatial database so that you can grow your own interesting queries. ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk