OpenStreetMap標誌 OpenStreetMap

Extracting regions from planet.osm ?

於 28 七月 2015 由 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 ?

電郵圖示 Bluesky圖示 Facebook圖示 LinkedIn圖示 Mastodon圖示 Telegram圖示 X圖示

討論

maxerickson2015年7月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年7月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年7月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年7月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.

登入以留言