I'm looking for a way to have a list of U.S. postal codes and the primary type of the area (=landuse?) For example: residential, commercial, military base, airport etc. asked 21 Jun '16, 10:05 Owen32 |
That's entirely possible. First you download OSM in the format you require. Then you decide what the possible "types" are. You query your data to group all things that are within such a type. Mind you: the same place might have different types (for example an airport has shops). So then you have to decide whether or not you want to prioritize (eg shops take a bite out of airports, airports hide underlying shops, or both count in their own way). You will also have to account for some features being mapped as both an area and a node (eg a shop in a commercial area). I solved this by giving shops an arbitrary area. Once you have everything in place, you do a spatial join of points and postal codes, and/or split polygons along the borders of your postal codes. Et voila, you can start counting. answered 21 Jun '16, 13:07 joost schouppe Can you explain by a specific example? What is the API call for specific lat_lon and get the landuse?
(21 Jun '16, 13:46)
Owen32
Do you want to do this on user demand on the fly for one area, or are you building a national dataset? If you want to do the second, you will not be using our API. You will need to download the data (e.g. from download.geofabrik.de ) and convert it to suit your needs (I often use pbf to sqlite, but more people use a postgis solution). Then you will need to study the OSM datamodel (use wiki.openstreetmap.org) enough for you to make decent choices. This all assuming you get decent polygons for your areas of interest (as I just read neuhausr's link)
(22 Jun '16, 07:28)
joost schouppe
How can I do it using the API? Determine the primary type of an area\zipcode?
(22 Jun '16, 09:32)
Owen32
2
The most userfriendly is overpass-turbo. See this example: http://overpass-turbo.eu/s/gV0 . You can export the data as well as the query. It is possible to have Overpass geocode an area in stead of using a bounding box. You can learn more about the Overpass API on the wiki and find many related questions on this forum.
(22 Jun '16, 09:55)
joost schouppe
|
cross-posted: https://stackoverflow.com/questions/37939161/zipcodes-and-area-type-landuse
also see this answer for limitations of US zip code polygons: https://help.openstreetmap.org/questions/46371/need-help-showing-zip-codes-on-map-and-their-boundaries