29

I need to clip a large and very detailed shapefile in QGIS showing environmental data similar to a temperature map.

Is there something like the very simple crop tool like in Adobe Photoshop where you can drag a rectangle over an area of interest and crop the shapefile to this area only?

I do have an additional shapefile of neighborhoods/districts that I could also use for cropping but I do not know how to specify "extract a shp/kml only within the borders of district X, row xxxxx in the attribute table of districts.shp"

How can I extract the data primitively within a rectangle of choice or per district?

I need smaller pieces from the large map that has been provided by an environmental geo-institute to be implemented into an mobile Application (Android) to view the quite heavy data in a lighter way.

I made some screenshots of the data and posted them here: http://merglindev.wordpress.com/2012/10/22/extracting-districts-from-big-shapefile-data/.

You can see the districts and the data layers. I need to have every district as a separate file / separately export every dataset per district to KML.

3 Answers 3

36

You say you have a shapefile with appropriate regions, so you can use that for cutting. In the parlance of QGIS, it sounds like you are after Vector->Geoprocessing Tools -> Clip. If you need to assign the data from the input layer to smaller units in the region layer, you could intersect or union instead, in the same menu.

edit (by Kurt): here is an image for clarification: enter image description here yellow: input layer (china) green: clipmask-layer violett: clipped output-layer

5
  • 6
    just make sure, that both layers (original layer and layer, which you use for clipping) use the same projection (crs)
    – Kurt
    Commented Oct 21, 2012 at 22:45
  • if i choose input vector layer "my_road_geodata" and use as a intersect layer "districts_2011" it processes a while but i don't see the difference to the original. "Union" just crashed my QGIS :( In the end I would like to export just one district x in combination with the "my_road_geodata" - is there any tutorial out there?
    – birgit
    Commented Oct 21, 2012 at 22:46
  • 3
    Are you saying you are clipping a line (road) layer with a polygon layer? And are you after just ONE polygon area for your output, or multiple?
    – ako
    Commented Oct 21, 2012 at 23:47
  • It is not a line layer. The "my_road_geodata" shows zones of noise pollution in the form of filled polygons, like in this webapp si2.nl/eu-kaarten/rdam - when cutting it by districts I just want to get the same map but cut in small puzzle pieces... so extracting the areas one by one and saving them in a file like district01 district02 ... would be what I am aiming for
    – birgit
    Commented Oct 22, 2012 at 8:14
  • In QGIS 2.16 this it in the Processing Toolbox under QGIS Geoalgorithms > Vector Overlay tools > Clip
    – chip
    Commented Aug 24, 2016 at 15:25
15

To create a new clip layer from scratch (In your case the rectangle).

Layer > New > New Shapefile layer (create blank vector object)

In layers menu: Right click on layer > toggle editing > use capture points, capture lines & capture polygons to create your customized new layer.

1

See this helpful answer, watch to the very end Custom Clipping in QGIS

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.