[GRASS-user] Clip/Extract Rasters using a vector

stephen sefick ssefick at gmail.com
Mon Sep 20 13:23:03 EDT 2010


quote the string before the pipe?

On Mon, Sep 20, 2010 at 12:03 PM, Andrew Lewin
<andrew.lewin at sympatico.ca> wrote:
> Here is the error:
> GRASS 6.4.0RC6 (MacrophytesGIS):~/grass/MacrophytesGIS/PERMANENT >
> natemp20092010=mynatempnewrast + 0 | r.mapcalc
> bash: +: command not found
> syntax error, unexpected $end, expecting NAME or STRING
> Parse error
> Andrew
> Andrew Lewin
> andrew.lewin at sympatico.ca
> President
> Coastal/Marine Spatial Ecologist
> Spatial-Conserve Incorporated
> Associate
> C-FOAM (Canadian Fisheries, Oceans and Aquaculture Management Group)
> Telfer School of Management, University of Ottawa
>
>
>
>
>
>
> On 2010-09-20, at 12:59 PM, Mark Seibel wrote:
>
> Would you please post your command syntax, and associated error?
>
> Mark
>
> "Andrew Lewin" <andrew.lewin at sympatico.ca> wrote:
>
> Hi John and Mark,
>
> I am getting a syntax error when I type in either of your statements.  To be
> clear, I am using Mac Snow Leopard in the Terminal program (bash).
>
> Cheers,
>
> Andrew
>
> Andrew Lewin
>
> andrew.lewin at sympatico.ca
>
> President
>
> Coastal/Marine Spatial Ecologist
>
> Spatial-Conserve Incorporated
>
> Associate
>
> C-FOAM (Canadian Fisheries, Oceans and Aquaculture Management Group)
>
> Telfer School of Management, University of Ottawa
>
>
>
>
>
>
>
> On 2010-09-16, at 12:22 PM, John C. Tull wrote:
>
> Correct me if I am wrong, but for step 3, you can simply use an equality
> statement, i.e., echo clippedRaster=NA_temperature | r.mapcalc'. This
> shortens things a little further.
>
> Regards,
>
> John
>
> On Sep 16, 2010, at 8:41 AM, Mark Seibel wrote:
>
> Surely there is a more elegant way...
>
> 1) Convert the vector you wish to use as a clipper to a raster.
>
> 2) Set the raster mask to be the raster clipper (the converted vector).
>
> 3) Use map calculator to perform some non-data altering operation, but
>
> get the mask to do its thing (eg. echo 'clippedRaster=NA_temperature +
>
> 0 | r.mapcalc').
>
> Mark
>
> On Thu, Sep 16, 2010 at 10:52 AM, Andrew Lewin
>
> <andrew.lewin at sympatico.ca> wrote:
>
> Dear Listers,
>
> I would like to clip or extract a raster using a vector file; however, I
>
> can't seem to find the command to do this in GRASS 6.4 ORC6.  The raster
>
> file is an interpolated file of temperature for North America.  The raster
>
> file extends beyond the North America boundaries. I would like to clip the
>
> raster file to the North American boundaries, but I cannot find the command
>
> to do so.
>
> I would appreciate any help possible.
>
> Thank You,
>
> Andrew
>
> Andrew Lewin
>
> andrew.lewin at sympatico.ca
>
> President
>
> Coastal/Marine Spatial Ecologist
>
> Spatial-Conserve Incorporated
>
> Associate
>
> C-FOAM (Canadian Fisheries, Oceans and Aquaculture Management Group)
>
> Telfer School of Management, University of Ottawa
>
>
>
>
>
>
> _______________________________________________
>
> 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
>
>
>
>
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>



-- 
Stephen Sefick
____________________________________
| Auburn University                                   |
| Department of Biological Sciences           |
| 331 Funchess Hall                                  |
| Auburn, Alabama                                   |
| 36849                                                    |
|___________________________________|
| sas0025 at auburn.edu                             |
| http://www.auburn.edu/~sas0025             |
|___________________________________|

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

                                -K. Mullis

"A big computer, a complex algorithm and a long time does not equal science."

                              -Robert Gentleman


More information about the grass-user mailing list