[gdal-dev] GDAL Python Projection Question

Kyle Shannon ksshannon at gmail.com
Mon Apr 12 12:05:18 EDT 2010


I use AutoCreateWarpedVRT() to create a virtual dataset, then you
CreateCopy() to write your data using the proper Driver:

vrt_ds = AutoCreateWarpedVRT( ds, ... )
dst_ds = driver.CreateCopy('dst.out', vrt_ds, ...)
dst_ds = None


kss

# ============================
Kyle Shannon
Physical Science Technician
RMRS Fire Sciences Lab
Fire, Fuels & Smoke - RWU 4405
5775 Highway 10 W.
Missoula, MT 59808
(406)829-6954
kshannon at fs.fed.us
# ============================


On Mon, Apr 12, 2010 at 9:46 AM, Discourse Maps <discoursemap at live.com>wrote:

>  Hi,
>
> I am attempting to use GDAL with Python to reproject a raster (called
> 'deforest') from Geographic Coordinate System to NAD83_UTM10N.
>
> Most of the projection tutorials seem to be in C...
> Can anyone offer assistance for Python?
>
>  My current code:
>
>      os.chdir(gp.workspace)
>      ds = gdal.Open('lulc_samp_cur', GA_ReadOnly)
>      if ds is None:
>           gp.AddError("Could not open image")
>      band = ds.GetRasterBand(1)
>
>     # obtain projection info from current LULC raster 'lulc_samp_cur'
>      prj_lcraster = ds.GetProjection()
>      ds = None
>
>     # Project Raster for image 'defores' to same projection as
> 'lulc_samp_cur'
>      ds = gdal.Open('deforest', GA_ReadOnly)
>      ....
>
>      ?
> ------------------------------
> Hotmail has tools for the New Busy. Search, chat and e-mail from your
> inbox. Learn more.<http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100412/5efd0bfc/attachment.html


More information about the gdal-dev mailing list