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.

Given a shapefile composed of contiguous polygons, I'd like to clip (or mask) regions of satellite photo to the polygon outlines, and export each resulting raster in medium resolution for further processing.

I've gotten as far as overlaying the shapefile on Google Maps imagery (in QGIS, with Openlayers plugin), but I can't find any operation to intersect vector data with raster data (presuming that the Openlayers layer is indeed treated as a raster layer).

A simple solution would be great, and suggestions of other free OSX-compatible software are fine. A programmatic solution would be ideal (though not requisite) as I'd like to export many such images, each named by an attribute field in the shapefile.

I hope I haven't over-explained a simple problem, but alas, I'm rather new to GIS software. Trying to move forward with this project as quickly as possible, but stymied by data acquisition... Thanks a ton!

share|improve this question
1  
Do any of these related threads answer your question? gis.stackexchange.com/questions/16657, gis.stackexchange.com/questions/24861, gis.stackexchange.com/questions/21402? –  whuber Jun 5 '12 at 0:54
1  
These provide useful additional context to dakcarto's perfectly neophyte-pitched answer. Thank you. –  sunspeck Jun 5 '12 at 7:30

1 Answer 1

up vote 4 down vote accepted

In QGIS, use the Clipper raster tool, under the Raster-> Extraction menu. See: How to clip a raster with vector boundaries?

enter image description here

You may have issues trying to clip data in a plugin layer (e.g. Openlayers) because the Clipper function requires a input graphic file (raster) from disk. Your best bet is to get the satellite imagery directly from the source and load that into QGIS.

Check here for most from Landsat missions:
USGS Global Visualization Viewer

Once you get it working in QGIS, delve into the gdalwarp utility (see code generated at bottom of Clipper dialog) to see about scripting your clippings (via bash or Python).

If you have installed QGIS using the KyngChaos.com frameworks, then gdal and its utility programs are located in:

/Library/Frameworks/GDAL.framework/Versions/1.9/Programs

Read the README included with the KyngChaos.com installers to see about updating your bash (Terminal) PATH environment variable.

EDIT: In your scripting you will need to loop through the features of your shapefile (used here as a cutline) and spatially match it up to the appropriate imagery. Alternatively, if it is a one-off project, you can export features to separate shapefiles using the Split vector layer tool, located under the Vector-> Data Management Tools menu. It may make your life easier when learning to make your first batch scripts.

enter image description here

share|improve this answer
    
A superb answer, thank you so much. –  sunspeck Jun 5 '12 at 7:10
    
And you're right: the Clipper tool unfortunately won't work with a Google Maps layer. I suppose it's due to licensing that you can't easily save georeferenced Google imagery. So I guess I'm back on the hunt for neighborhood-resolution satellite data, but from there it looks like gdalwarp and the Split vector layer tool will be just the ticket. –  sunspeck Jun 5 '12 at 7:18
    
(And for other newbies: to access the Clipper and other raster tools, you'll have to enable the preinstalled GdalTools plugin under 'Manage Plugins') –  sunspeck Jun 5 '12 at 7:21

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.