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

I've been downloading OSM unlabeled road image data through Mathematica and processing it so it only includes main roads.

For example, here's an image of Sao Paulo at zoom 13, pre and post segmentation. alt text alt text

The results are ok, but I want to know how can I skip this segmentation effort.

Is there a way to download only the road layer with Maperitive or other 3rd party application?

asked 23 Jul '15, 01:16

antonio_rt's gravatar image

accept rate: 0%


  1. Download OSM extract for region of interest. Import into osm2pgsql. Use Kosmtik or Tilemill (not Tilemill 2 aka Mapbox Studio) to develop a map style (in MapCSS) that shows only (main) highways. Render image, done.
  2. Download OSM extract for region of interest. Use osmosis with the --tag-filter option, or use osmfilter, to extract just the highways from the file. Then load and render in Maperitive.
permanent link

answered 23 Jul '15, 07:11

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

In short, yes. The better approach will vary based on what you are trying to do. Here's a quick Overpass Turbo query that extracts some of the major road vectors:

Perhaps the vector representation there is better suited to what you are doing than a rendering.

(The Overpass api can return the data in a variety or formats, see for more)

If you want to render a small to medium sized area, using something like Maperative with a country or regional extract would be a reasonable idea.

permanent link

answered 23 Jul '15, 03:41

maxerickson's gravatar image

accept rate: 32%

Thanks, that overpass query would be ok if it were without text labels and coloring. I want an output like the one shown in the binary mask

(23 Jul '15, 04:56) antonio_rt

The geojson from Overpass-Turbo can be processed anyway you like (or you can save GPX etc), e.g., with QGIS. Furthermore you can use MapCSS to style the data directly in Overpass-Turbo. It really depends what it is that you want to do.

(23 Jul '15, 09:38) SK53 ♦

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: 23 Jul '15, 01:16

question was seen: 3,801 times

last updated: 23 Jul '15, 09:38

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