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

0
1

Hi to everybody! I am trying to extract a portion of Europe map (say Belgium, France, Germany, The Netherlands and UK) from the europe-latest.osm.pbf using Windows commands prompt. I succed to install the osmosis "package" in my machine (well, it is not enough powerful to manage the entire Europe map), but I can't arrive to write down the right code to perform a boundary box extrection. I'm sure that is a trivial (not to much) issue of path in order to make working Osmium commands with the target file, but really I don't know how to begin the command. All the command hints and suggestions seem to start from a basic starting point/platform that I don't know/can't find. Could someone, please, give me some hints or at least show me any link that can allow me to understand how to proceed? Thanks a lot to any one that could help me. D.

asked 15 Feb '22, 19:14

Shardana's gravatar image

Shardana
16223
accept rate: 0%


The correct way for a bbox extraction with osmosis would require the command line parameters (I am putting one per line but you need them all on the same line):

--read-pbf europe-latest.osm.obf
--bb left=-15 bottom=41 right=16 top=62
--write-pbf myfile.osm.pbf

The --bb has a couple of options which you should read up on; they will affect memory consumption as well as the question of referential integrity in your output file. The way I have written it above it will run fastest, but if a way has some nodes inside and some nodes outside your box, only the inside nodes will be copied and the way will be left with "dangling" references. Same for relations.

Also, try to get a copy of the "osmium" command line utility - it's made for Linux but should be available in Windows builds as well - since that will do the job a little more efficiently than osmosis.

permanent link

answered 15 Feb '22, 19:41

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Hi, Frederik! Thanks a lot for your help, it works, but it seems my machine can't manage the task. I got this message, I think is not related to the file size, but to something else I can not manage at this time, I tried the same command with a smaller map (belgium) and getting the same output:

*** La RICORSIONE BATCH supera i limiti dello STACK Conteggio ricorsione=315, utilizzo stack=90 percento ELABORAZIONE BATCH INTERROTTA ***

I'm sorry it is in Italian, I tried to find some explication but as I think you well know, as much you dig deeper as much it become harder. So, maybe, it's better to look for any alternative solutions. This afternoon I'll try to work a little on Osmium as you suggested, but if this is the starting point I really feel without any abilities by now. Thanks a new time. D.

(16 Feb '22, 10:22) Shardana

It might be a case of having to set the right Java options allowing it to consume more memory, with the environment variable JAVACMD_OPTIONS. For osmium, you'd be looking at https://docs.osmcode.org/osmium/latest/osmium-extract.html

(16 Feb '22, 10:29) Frederik Ramm ♦
Your answer
toggle preview

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:

×83
×48
×30

question asked: 15 Feb '22, 19:14

question was seen: 1,434 times

last updated: 16 Feb '22, 10:29

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