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

2017-11-28 Thread Ari Jolma
v@lists.osgeo.org <mailto:gdal-dev@lists.osgeo.org> *Subject:* Re: [gdal-dev] pass gdal dataset as an argument from Python to C Shawn, PyObject and GDALDatasetH are incompatible types and you can't pass the former to a function that expects the latter. I'm surpr

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

2017-11-27 Thread Shawn Gong
] pass gdal dataset as an argument from Python to C 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/gd

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
ilename") > > result = _my_c_module.function1(ds) > > > > is this possible? If yes, how? > > > > > Shawn > ------ > *From:* Sean Gillies [s...@mapbox.com] > *Sent:* November-27-17 11:09 AM > *To:* Shawn Gong > *Cc:* g

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

2017-11-27 Thread Shawn Gong
.com] Sent: November-27-17 11:09 AM To: Shawn Gong Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] pass gdal dataset as an argument from Python to C Shawn, PyObject and GDALDatasetH are incompatible types and you can't pass the former to a function that expects the latter. I'm surp

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

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

2017-11-23 Thread Shawn Gong
Hi list, Has anyone done this before? I try to pass a gdal dataset as an argument from Python to C. in my C code, I have PyObject* py_my_func(PyObject *self, PyObject *args) { PyObject *poDataset; if(!PyArg_ParseTuple(args, "Odd", &poDataset, &a1, &a2)) { return NULL; }