2

I have downloaded a 100Km map from OS, but the problem is that it is far larger than I need and hence takes a long time to load every refresh in QGIS. Is there a way to cut down the size of the accompanying shape files to a more manageable size of, say, 10Km square?

2 Answers 2

4

The data is VectorMap District vectors I guess? If you are happy about working from a command line or in a terminal you can clip a shapefile to a precise 10 km square using a command like this:

ogr2ogr -spat 460000 190000 470000 200000 -f "ESRI Shapefile" SU_Road_clipped.shp SU_Road.shp

where "460000 190000" forms the coordinate of the bottom left-hand corner of a rectangle and "470000 200000" forms the coordinate of the top right-hand corner of the same rectangle. The original shapefile will be clipped to a subset having the extents specified by the rectangle (the output will be a new shapefile, the original will not be harmed in any way).

Nick.

5
  • I've downloaded ogr2ogr from FWTools (Is that the best place as it's given me 100s of new files!!!), tired it and it works, brilliant thanks. Better than the Sextante option Aug 27, 2012 at 14:20
  • FWTools is great, but in fact if you have QGIS you already have GDAL/OGR installed :) N.
    – nhopton
    Aug 27, 2012 at 15:15
  • I thought I had but could not work out how to use it!!! Aug 27, 2012 at 19:14
  • I should have mentioned that I could not find an ogr2ogr executable on my PC which was why I installed FWTools Aug 27, 2012 at 19:25
  • It should be in C:\Programs (x86)\Quantum GIS Lisboa\bin if you installed by standalone installer, else C:\Osgeo4w\bin.
    – AndreJ
    Aug 28, 2012 at 4:19
1

Use the GRASS v.generalize tool, you can use it with the qgis/grass plugin or now also with the sextante plugin (the last option is easier as you don't need to get deep into the grass data model).

3
  • most probably the op wants to clip/extract the 100 km² data to parts of 10Km² each..
    – vinayan
    Aug 27, 2012 at 10:22
  • That's right. I have not used Sextante or Grass as it was not needed for my purposes. Grass does not seem to fit the bill, but would Sextante? Aug 27, 2012 at 11:00
  • OK, I have just installed Sextante and I think it will do the trick, so thanks Giovanni Aug 27, 2012 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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