NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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's gravatar image

Owen32
11112
accept rate: 0%


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.

permanent link

answered 21 Jun '16, 13:07

joost%20schouppe's gravatar image

joost schouppe
3.4k245087
accept rate: 12%

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

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×290
×202
×103

question asked: 21 Jun '16, 10:05

question was seen: 2,668 times

last updated: 22 Jun '16, 09:55

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum