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

Hi all,

I'm working to evaluate the transportation condition of an arbitrary site, but these sites do not usually fall into a rectangular space, so that using a bounding box to export data from OpenStreetMap won't give a precise geometry. Is there any option that I can export data with polygon selection, or do it offline in a clean way?

Thanks in advance for your help, Jiachen

asked 16 Aug '21, 05:00

JiachenLu's gravatar image

accept rate: 0%

My favorite tool for extracting data from osm.pbf is OSMIUM And next question is where to get the polygons with boundaries? of course!

permanent link

answered 16 Aug '21, 13:10

az09's gravatar image

accept rate: 0%

Thanks a lot! It worked like a charm

(17 Aug '21, 13:49) JiachenLu

For relatively small scale usage I would use overpass or overpass-turbo, you can describe a bounding polygon as a series of co-ordinate pairs, so probably most useful if you are using the same poly again & again or it has a relatively small number of nodes. If the area is already defined in OSM then this can be used directly in overpass queries (see the documentation for examples).

I normally don't recommend Osmium directly because on some platforms there is quite a long dependency chain for compilation, and therefore it's not necessarily the tool to fix a little problem if not already in use. Most OSM ETL-style tools (osmconvert, osmosis, osmium-tool) will take a polygon file and allow you to clip a larger dataset by that polygon file. Both QGIS & JOSM allow the creation of OSM style polygon files directly. Persnally I find osmconvert satisfactory for this type of task.

permanent link

answered 18 Aug '21, 13:04

SK53's gravatar image

SK53 ♦
accept rate: 22%

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 16 Aug '21, 05:00

question was seen: 1,330 times

last updated: 18 Aug '21, 13:04

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