[gdal-dev] Problems with passing parameters into gdalwrap in Python

Chaitanya kumar CH chaitanya.ch at gmail.com
Wed Jan 12 22:20:34 EST 2011


James,

Instead of passing the arguments as array elements, try to pass the
arguments in the same string, separated by a space.
http://trac.osgeo.org/gdal/browser/trunk/autotest/warp/warp.py#L481

On Thu, Jan 13, 2011 at 3:06 AM, manzione
<james.j.manzione at usace.army.mil>wrote:

>
> Greetings All,
> I am a student who has been having a difficult time passing in source
> parameters into gdalwrap in Python, and would truly appreciate any insight
> that great minds like you might have on my simple problem.
>
> First off, I am attempting to reproject a Tiff image that was generated
> from
> a Grib2 rasterband by using the subprocess.call(cmd) method.  My cmd
> statement is as follows:
>
> cmd = ["gdalwarp", "-t_srs", "EPSG:4326", in_Src, target_Src]
>
> The "in_Src" parameter represents the input source file, and the
> "target_Src" parameter is an empty temporary file.
>
> I've seen (and tried) a lot of examples where instead of calling an object
> in the cmd line they call a string that references the name of the image
> file.
>
> Example:  subprocess.call(["gdalwarp", "-t_srs", "EPSG:4326", "input.tif",
> "output.tif"])
>
> However each time I attempt this technique gdalwarp returns an error
> message
> that states that it cannot locate the source file.  I've tried replacing
> the
> names with path locations and yet I still get the same error returned.
>
> If someone would be kind enough to show me how to get over this issue I
> would be incredibly grateful!
>
> Thank you in advance,
>
> -James
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Problems-with-passing-parameters-into-gdalwrap-in-Python-tp5916192p5916192.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110113/9e571e81/attachment-0001.html


More information about the gdal-dev mailing list