Wednesday, 22 May 2019

How to select a raster file that is under a polygon in a vector file?


I am using: v.db.select map=PHL_adm1 where=NAME_1='Bulacan'


My vector map is over the raster map. I want to select the part of the raster map under the polygon(NAME_1='Bulacan') of a vector. Is it possible to do?



Answer



Hi here is the procedure to do that:


v.to.rast - convert vector to raster.

r.mask - create a mask from the raster.
r.resample - to create a new raster clipped by the mask.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...