0

I have a large osm file of a city. I want to split this file into multiple smaller pieces (e.g 50) and retain all smaller pieces for further use rather than just a portion of it. Is anyone aware of anything out there on the Windows platform that can do this?

I'm expecting I'll have to just get the max lat/lon and min lat long and just divide the numbers to get the coordinates for manual piece downloads from OSM, but this seems a shame if I have the full city osm already.

I am using QGIS.

3

Each tool mentioned here can be found in the Processing Toolbox.

If your OSM file is a vector layer,

  1. Use the create grid tool to create a rectangular grid layer (choose grid type: rectangle (polygon)).

    enter image description here

  2. Use the Intersection tool to split the OSM data based on the grid cells.

  3. Use the split vector layer tool to split the output from the intersection tool into separate files. Use the field called ID for the "Unique ID field" (this field comes from the grid layer; if your original OSM layer also had a field called ID, this one might be called something like grid_ID).

    enter image description here

If your OSM file is a raster layer, use r.tile to split it into tiles.

  • I've got my lines layer from the osm, created my grid lines. Selected my osm lines layer for the input layer, and my grid for the overlay. The intersection layer is just blank, as in white. I tried swapping over the overlay and input layer but same story, the intersection layer is empty. – James Aug 29 '19 at 17:59
  • are the two layers in the same CRS? – csk Aug 29 '19 at 18:00
  • 1
    Oh, the grid layer should be polygons, not lines. You can do it with grid lines, but you need to use the split with lines tool instead of intersection – csk Aug 29 '19 at 18:01
  • updated with more detailed steps and some screenshots – csk Aug 29 '19 at 18:10
  • Thanks csk that works great. On QGIS 3.4 I found them in Vector->Research Tools->Create Grid, Vector->Geoprocessing Tools->Intersection, and Vector->Data Management Tools->Split Vector. – James Aug 31 '19 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.