Лагатып OpenStreetMap OpenStreetMap

Extracting regions from planet.osm ?

Апублікавана карыстальнікам adaviel 28 Ліпень 2015 на мове English

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 ?

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Абмеркаванне

Каментар ад maxerickson у 28 Ліпень 2015 у 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

Каментар ад TheSwavu у 28 Ліпень 2015 у 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.

Каментар ад adaviel у 28 Ліпень 2015 у 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.)

Каментар ад stephan75 у 29 Ліпень 2015 у 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.

Увайсці каб пакінуць каментар