<div dir="ltr"><div dir="ltr"><div>Hi all,</div><div><br></div><div>I'm trying to
figure out how to use the GDALWarp function from gdalwarp_lib.cpp. It
looks like it takes a pointer to a GDALWarpAppOptions structure that is
parsed from a string list, basically gdalwarp's argv, right?</div><div><br></div><div>I'm
able to get it to warp data, but the options, specifically the
resampling option, don't seem to be passed into the warper. The output
is the same for all resampling values.</div><div><br></div><div>Here's my C usage (Cython, actually, but translates to C).</div><div><br></div><div> cdef GDALWarpAppOptions *warp_options = NULL <br></div><div>
cdef char **argv = NULL
</div><div>
try:
<br> argv = CSLAddString(argv, <const char *>"lolwut")<br> resampling_opt_value = Resampling(resampling).name # like "bilinear"<br> argv = CSLAddString(argv, <const char *>"-r")<br> argv = CSLAddString(argv, <const char *>resampling_opt_value)<br></div><div> ...</div><div> CSLPrint(argv, NULL)<br> warp_options = GDALWarpAppOptionsNew(argv, NULL)<br> output_ds = GDALWarp(<br> NULL,<br> dst_dataset,<br> 1, <br> src_datasets,<br> warp_options,<br> NULL<br> )<br> finally:</div><div> ...</div><div><br></div><div>The printed output, my argv, is</div><div><br></div><div> lolwut<br> -r<br> bilinear<br></div><div><br></div><div>Does
GDALWarpAppOptionsNew expect more values at the head of the command
line? Is that why it is missing "-r"? Or is my string list made up of
the wrong kind of strings? Documentation examples of building the
arguments for GDALWarp are scarce. I'd be super grateful for help from
anyone who has got code this to work.</div><div><br></div><div>Thanks,</div><div class="gmail-adL"><br></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Sean Gillies</div></div>