開放街圖標誌 OpenStreetMap 開放街圖

Extracting regions from planet.osm ?

於 2015年七月28日 由 adavielEnglish發表。

I’ve been using Merkaartor on LInux for some years. Usually I import a track, zoom in, then use “download more” to download OSM for that region. But there’s a 50,000 item limit, so if I’m not zoomed in far enough, it fails.

Years ago I had read that I could get planet.osm as a default start set, but I never did. Now, when I look, it’s huge. Merkaartor can’t handle that, at least not with the amount of RAM I have. It can’t even handle all of Canada without swapping.

I see that the US is split into states, but all of Canada is one big file. Is there any easy way, preferably command-line on Linux, that would let me split out a region from the Canada OSM - one province, or a smaller area ?

電子郵件圖示 藍天圖示 Facebook 圖示 LinkedIn 圖示 乳齒象圖示 Telegram 圖示 X 圖示

討論

maxerickson2015年07月28日 23時13分 發表的評論

Here’s one way:

osm.wiki/Osmconvert#Clipping_based_on_a_Polygon

I’ve not actually done that, but I think Osmconvert is relatively stable. There are some other tools with the same feature:

osm.wiki/OSM_file_formats#Splitting_one_big_file_into_different_geographical_regions

TheSwavu2015年07月28日 23時17分 發表的評論

You can try downloading by province from here and Osmconvert will let you clip to a bounding box or a polygon.

You can use this website to create the polygons from relations in OSM if you want to clip to a municipality or neighbourhood.

adaviel2015年07月28日 23時24分 發表的評論

Thanks. I will try Osmconvert. (That is idiotic - I was on the geofabrik website and downloaded the Canada OSM, but did not realize Canada had sub-regions. Logically, BC and Maine would be at the same level.)

stephan752015年07月29日 16時14分 發表的評論

Hello adaviel,

I fear that both known offline editors (Merkaartor 0.18.2 and JOSM) are NOT able to load raw OSM data with the extend of a whole province.

So I recomment to download data for a bigger area step by step via the built-in data download features.

In JOSM you also have the continuous download feature or plugin, which loads data when you drag the data layer inside JOSM when there has been no download for that area before.

登入 來留下評論