Re: [gdal-dev] How to use -dstnodata in gdalwarp

2017-11-27 Thread jratike80
sunil.chaudhary wrote > I have tried using -srcnodata 0 but I got the same result. > I don't know about -wo UNIFIED_SRC_NODATA=YES, what exactly does that do? Hi, Read carefully what Even wrote and try exactly with -srcnodata "0 0 0". There is a link to warpinp options in http://www.gdal.org/gdal

Re: [gdal-dev] How to use -dstnodata in gdalwarp

2017-11-27 Thread sunil.chaudhary
I have tried using -srcnodata 0 but I got the same result. I don't know about -wo UNIFIED_SRC_NODATA=YES, what exactly does that do? -- Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html ___ gdal-dev mailing list gdal-dev@lists.osgeo

Re: [gdal-dev] How to use -dstnodata in gdalwarp

2017-11-27 Thread Even Rouault
On lundi 27 novembre 2017 14:38:55 CET sunil.chaudhary wrote: > I have also tried quoting the dstnodata value as "0 0 0" and I got the same > result The issue is more likely on the source side. Try adding: -srcnodata "0 0 0" Or: -wo UNIFIED_SRC_NODATA=YES Even -- Spatialys - Geospatial profess

Re: [gdal-dev] How to use -dstnodata in gdalwarp

2017-11-27 Thread sunil.chaudhary
I have also tried quoting the dstnodata value as "0 0 0" and I got the same result -- Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal

[gdal-dev] How to use -dstnodata in gdalwarp

2017-11-27 Thread sunil.chaudhary
Can someone give me the correct syntax on how to use -dstnodata in gdalwarp? I'm having an issue where when I'm trying to use this option I'm getting some unpredictable outputs What I am trying to do is set the output no data value as black or 0, so for my command line I put in the following: gd

Re: [gdal-dev] pass gdal dataset as an argument from Python to C

2017-11-27 Thread Shawn Gong
Thank you both Sean and Even. SWIG is too complicated for me, and I will find a work around. Shawn From: Even Rouault [even.roua...@spatialys.com] Sent: November-27-17 2:10 PM To: gdal-dev@lists.osgeo.org Cc: Sean Gillies; Shawn Gong Subject: Re: [gdal-dev] pass

Re: [gdal-dev] pass gdal dataset as an argument from Python to C

2017-11-27 Thread Even Rouault
On lundi 27 novembre 2017 11:46:50 CET Sean Gillies wrote: > I believe it's possible, yes, but it will be challenging. I'm not aware of > anybody else doing this. > > In > https://github.com/OSGeo/gdal/blob/trunk/gdal/swig/python/extensions/gdal_wr > ap.cpp you can see examples of C++ functions th

Re: [gdal-dev] pass gdal dataset as an argument from Python to C

2017-11-27 Thread Sean Gillies
I believe it's possible, yes, but it will be challenging. I'm not aware of anybody else doing this. In https://github.com/OSGeo/gdal/blob/trunk/gdal/swig/python/extensions/gdal_wrap.cpp you can see examples of C++ functions that access the GDAL objects referenced by Python objects. This isn't a st

Re: [gdal-dev] Build with MinGW in Linux

2017-11-27 Thread Even Rouault
On lundi 27 novembre 2017 18:52:26 CET Ari Jolma wrote: > My PR https://github.com/OSGeo/gdal/pull/265 currently fails on MinGW > cross compilation and on Windows (AppVeyor) while running a test > involving gdal.Translate (python code). The error is "ValueError: > Received a NULL pointer." which is

Re: [gdal-dev] Build with MinGW in Linux

2017-11-27 Thread Sandro Mani
On 27.11.2017 17:52, Ari Jolma wrote: My PR https://github.com/OSGeo/gdal/pull/265 currently fails on MinGW cross compilation and on Windows (AppVeyor) while running a test involving gdal.Translate (python code). The error is "ValueError: Received a NULL pointer." which is from the Swig bindin

[gdal-dev] Build with MinGW in Linux

2017-11-27 Thread Ari Jolma
My PR https://github.com/OSGeo/gdal/pull/265 currently fails on MinGW cross compilation and on Windows (AppVeyor) while running a test involving gdal.Translate (python code). The error is "ValueError: Received a NULL pointer." which is from the Swig bindings. How could I study the issue on my

Re: [gdal-dev] pass gdal dataset as an argument from Python to C

2017-11-27 Thread Shawn Gong
Thank you Sean. What I want to do is to compile C/C++ code into "_my_c_module.pyd" and then to be called by Python. The Python code passes an argument to C/C++. I did previously by passing a file name (str) or a numpy array as argument to C/C++, and it is all good. This time I want to pass a

Re: [gdal-dev] pass gdal dataset as an argument from Python to C

2017-11-27 Thread Sean Gillies
Shawn, PyObject and GDALDatasetH are incompatible types and you can't pass the former to a function that expects the latter. I'm surprised your program can compile with these incompatible types. Do you mean for your module to extend GDAL's Python bindings? If you look inside the C code of GDAL's