<br><font size=2 face="sans-serif">Derek,</font>
<br><font size=2 face="sans-serif"> You
can do this in GRASS ( using gdal in the background) by doing the
following:</font>
<br><font size=2 face="sans-serif">1) create a workspace in the same projection
as your existing raster ( when you first start GRASS it will ask
you to set up a workspace with projection information)</font>
<br><font size=2 face="sans-serif">2) import the existing raster
layer into GRASS, ( r.in.gdal,http://grass.fbk.eu/grass64/manuals/html64_user/r.in.gdal.html)</font>
<br><font size=2 face="sans-serif">3)set the region to match the imported
raster layer in extent and resolution (g.region, </font><a href=http://grass.fbk.eu/grass64/manuals/html64_user/g.region.html><font size=2 face="sans-serif">http://grass.fbk.eu/grass64/manuals/html64_user/g.region.html)
</font></a>
<br><font size=2 face="sans-serif">4) import the county vector layer (v.in.ogr,
</font><a href=http://grass.fbk.eu/grass64/manuals/html64_user/v.in.ogr.html><font size=2 face="sans-serif">http://grass.fbk.eu/grass64/manuals/html64_user/v.in.ogr.html
)</font></a>
<br><font size=2 face="sans-serif">5) convert the vector layer to a raster
layer(v.to.rast, </font><a href=http://grass.fbk.eu/grass64/manuals/html64_user/v.to.rast.html><font size=2 face="sans-serif">http://grass.fbk.eu/grass64/manuals/html64_user/v.to.rast.html)
</font></a>
<br>
<br><font size=2 face="sans-serif">When you create the new raster it will
use the existing alignment and resolution of the region ( based off of
the existing raster) in the placement of the cells. Even though
I reference the tabular commands in the above process, it can be easily
done through both GRASS gui's</font>
<br>
<br><font size=2 face="sans-serif">Doug</font>
<br><font size=2 face="sans-serif"> </font>
<br>
<br>
<br><font size=2 face="sans-serif">Doug Newcomb
<br>
USFWS<br>
Raleigh, NC<br>
919-856-4520 ext. 14 doug_newcomb@fws.gov<br>
---------------------------------------------------------------------------------------------------------<br>
The opinions I express are my own and are not representative of the official
policy of the U.S.Fish and Wildlife Service or Dept. of the Interior.
Life is too short for undocumented, proprietary data formats.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Derek Morgan <jdmorgan@unca.edu></b>
</font>
<br><font size=1 face="sans-serif">Sent by: gdal-dev-bounces@lists.osgeo.org</font>
<p><font size=1 face="sans-serif">03/22/2012 10:12 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">gdal-dev@lists.osgeo.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[gdal-dev] shifting (or snapping) one
raster to another</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Hello,<br>
<br>
I am in a jam with ArcGIS, and am hoping there is a easier way to do<br>
this with GDAL. Here is the situation: I am converting a vector<br>
dataset of county polygons to raster at a pixel resolution of 231 m.<br>
However, I want this to line up with a different raster dataset I have<br>
at a much larger extent, but also the same resolution 231 m. As you<br>
probably guessed the two datasets are slightly askew as they have<br>
different extents. I would like to align the newly created county<br>
raster with the larger raster data set by shifting (or snapping) it to<br>
the closest pixels. Hopefully, this makes enough sense for someone
to<br>
let me know if this can be done in GDAL.<br>
<br>
Thanks ahead of time,<br>
Derek<br>
_______________________________________________<br>
gdal-dev mailing list<br>
gdal-dev@lists.osgeo.org<br>
</font></tt><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"><tt><font size=2>http://lists.osgeo.org/mailman/listinfo/gdal-dev<br>
</font></tt></a>
<br>