Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

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.

share|improve this answer
    
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 –  Peter Cornelissen Aug 27 '12 at 14:20
    
FWTools is great, but in fact if you have QGIS you already have GDAL/OGR installed :) N. –  nhopton Aug 27 '12 at 15:15
    
I thought I had but could not work out how to use it!!! –  Peter Cornelissen Aug 27 '12 at 19:14
    
I should have mentioned that I could not find an ogr2ogr executable on my PC which was why I installed FWTools –  Peter Cornelissen Aug 27 '12 at 19:25
    
It should be in C:\Programs (x86)\Quantum GIS Lisboa\bin if you installed by standalone installer, else C:\Osgeo4w\bin. –  Andre Joost Aug 28 '12 at 4:19
show 1 more comment

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).

share|improve this answer
    
most probably the op wants to clip/extract the 100 km² data to parts of 10Km² each.. –  vinayan Aug 27 '12 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? –  Peter Cornelissen Aug 27 '12 at 11:00
    
OK, I have just installed Sextante and I think it will do the trick, so thanks Giovanni –  Peter Cornelissen Aug 27 '12 at 11:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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