<font face="courier new,monospace">I use AutoCreateWarpedVRT() to create a virtual dataset, then you CreateCopy() to write your data using the proper Driver:<br><br>vrt_ds = AutoCreateWarpedVRT( ds, ... )<br>dst_ds = driver.CreateCopy('dst.out', vrt_ds, ...)<br>
dst_ds = None<br><br><br>kss<br><br></font># ============================<br>Kyle Shannon<br>Physical Science Technician<br>RMRS Fire Sciences Lab<br>Fire, Fuels & Smoke - RWU 4405<br>5775 Highway 10 W.<br>Missoula, MT 59808<br>
(406)829-6954<br><a href="mailto:kshannon@fs.fed.us" target="_blank">kshannon@fs.fed.us</a><br># ============================<br>
<br><br><div class="gmail_quote">On Mon, Apr 12, 2010 at 9:46 AM, Discourse Maps <span dir="ltr"><<a href="mailto:discoursemap@live.com" target="_blank">discoursemap@live.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
Hi,<br><br>I am attempting to use GDAL with Python to reproject a raster (called 'deforest') from Geographic Coordinate System to NAD83_UTM10N.<br><br>Most of the projection tutorials seem to be in C...<br>Can anyone offer assistance for Python?<br>
<br> My current code:<br><br> os.chdir(gp.workspace)<br> ds = gdal.Open('lulc_samp_cur', GA_ReadOnly)<br> if ds is None:<br> gp.AddError("Could not open image")<br> band = ds.GetRasterBand(1)<br>
<br> # obtain projection info from current LULC raster 'lulc_samp_cur'<br> prj_lcraster = ds.GetProjection()<br> ds = None<br> <br> # Project Raster for image 'defores' to same projection as 'lulc_samp_cur'<br>
ds = gdal.Open('deforest', GA_ReadOnly)<br> ....<br><br> ?                                            <br><hr>Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. <a href="http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1" target="_blank">Learn more.</a></div>
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br>