Jump to conversation
Unresolved conversations (0)
Nice work!

Nice work!

All of your conversations have been resolved.

Resolved conversations (12)
@sgillies sgillies Nov 13, 2019
Recommend putting these directives above the Python import statement.
...evelopment/rfc/rfc76_ogrpythondrivers.rst
rouault
@sgillies sgillies Nov 13, 2019
```suggestion bit artifical. The CityJSON driver mentioned below does not need it. ```
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
@sgillies sgillies Nov 13, 2019
```suggestion These directives will be parsed in a pure textual way, without invocation of the Python ```
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
@sgillies sgillies Nov 13, 2019
```suggestion ```
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
@sgillies sgillies Nov 13, 2019
```suggestion Those Python script must set in their first lines at least 2 directives: ``` These are no longer Python variables.
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
@mloskot mloskot Nov 6, 2019
Why this `create_driver` is required; what's the purpose? Why not to use the `__init__` magic? Since user's module is regularly imported https://github.com/rouault/gdal/blob/1bf795f25458dfb7e2a88e5d99b0e3647b82f2d4/gdal/gcore/gdalpythondriverloader.cpp#L2212-L2214 then why not look for classes that are `PyType_IsSubtype` of `Driver` class and construct calling the regular Python `__init__`? ```cpp PyObject* poTypeDriver = ... ; // class item found with PyDict_Next for callable PyType_Check // that is PyType_IsSubtype of Driver PyTypeObject* poDriverType = reinterpret_cast<PyTypeObject*>(poTypeDriver); // poDriverType is `self` PyObject* poDriver = poDriverType->tp_new(poDriver, args, kwds); if (!poDriver) { throw ...; } if (poDriverType->tp_init(poDriver, args, kwds) < 0) { throw ... ; } PyObject* poMethod = PyObject_GetAttrString(poDriver, "open" ); ... ```
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
mloskot rouault
@mloskot mloskot Nov 5, 2019
I can be someone will complain why the API is not Pythonic :-)
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
rouault
@mloskot mloskot Nov 5, 2019
Simply, the new one is "GDAL in Python" and the existing one is "Python in GDAL" :-)
...evelopment/rfc/rfc76_ogrpythondrivers.rst
rouault hobu
mloskot
@mloskot mloskot Nov 5, 2019
This explains my earlier question in https://github.com/OSGeo/gdal/pull/1984/files#r342839730 (a footnote missing)
...evelopment/rfc/rfc76_ogrpythondrivers.rst
@mloskot mloskot Nov 5, 2019
What does the '"interpreter" mean? A `PyThreadState` or `Py_NewInterpreter`-made sub-interpreter? An installed Python interpreter external to the Python built into GDAL? IMO, this is a bit unclear.
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
rouault
@mloskot mloskot Nov 5, 2019
It may be (better clearer to reader and script maintainer, unambiguous for detection and loading) if those have `GDAL_` prefix.
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
rouault
@elpaso elpaso Nov 5, 2019
Actually, you can create QGIS vector data provider in python: https://github.com/qgis/QGIS/blob/master/tests/src/python/test_provider_python.py
Outdated
...evelopment/rfc/rfc76_ogrpythondrivers.rst
rouault