[GRASS-user] cut raster

Markus Metz markus.metz.giswork at googlemail.com
Thu Oct 14 12:07:16 EDT 2010


Daniel Victoria wrote:
> Hi Sofina,
>
> The way I normally do this is first, convert the vetor to raster
> (v.to.rast). Then I transform the converted newlly created raster to a
> mask (r.mask) and, using r.mapcalc, clip the satellite image. Don't
> forget to latter remove the raster mask.
>
> The commands performed would be something like this:

I would add some g.region commands:

# set region to extends and grid cell geometry of satellite raster
g.region rast=satellite_image
> v.to.rast input=building_vector output=build_raster
# reduce region to non-NULL part of build_raster to reduce clipped raster size
g.region zoom=build_raster
> r.mask build_raster
> r.mapcalc "clipped_sat = satellite_image"
> r.mask -r
>
Markus M

> @ Grass List.
> I can't recall if there is an easier way to do this... Maybe a script?
> Such a simple procedure should be done easily in one step...
>
> Cheers
> Daniel
>
> On Thu, Oct 14, 2010 at 10:16 AM, Sofina Natalia <nsofina at gmx.de> wrote:
>> Hi everybody! I'm a beginner with GRASS... I have a lot of questions. Now I
>> need to cut out an area from a satellite image according a relevant vector
>> object from digital map. I need to cut out a building from satellite image,
>> that I have as a vector object, and save it to the new raster map (only one
>> building). Or may be it's possible to cut out an area from a satellite image
>> using coordinates from vector object.
>>
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>


More information about the grass-user mailing list