2

I have a shapefile and I need to crop/clip it based on a rectangle of particular latitude and longitude using QGIS.

If it is possible, how do I do that?

enter image description here

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
egig
  • 121
  • 1
  • 5
  • @vinayan no, it use 2 shapefile in that question, I only have one. – egig Aug 25 '14 at 06:42
  • Would you be able to edit your question to clarify that your requirement is to be able to specify min/max lats and longs to form a rectangle that is to be used to clip a shapefile, please? – PolyGeo Aug 25 '14 at 06:58
  • 1
    This Q&A looks like it may also be helpful to you: http://gis.stackexchange.com/questions/34202/enter-4-coordinates-and-get-a-polygon-qgis – PolyGeo Aug 25 '14 at 07:02

1 Answers1

3

You can create another layer, draw a box by your coordinates and follow the already referenced answer How to crop Shapefiles in QGIS?. I would myself use ogr2ogr with the -spat parameter. If you want also to clip the selected features with the selection box use -clipsrc [xmin ymin xmax ymax]|

http://gdal.org/ogr2ogr.html

QGIS Processing toolbox has a GDAL raster tool in "GDAL/OGR - Extraction - Clip raster by extent". Similar tool for vectors would be generally useful. Perhaps you could make a QGIS feature request "Add a new GDAL/ORG tool: Clip vector layer by extent".

user30184
  • 65,331
  • 4
  • 65
  • 118