[gdal-dev] How to wrap a C++ library using GDAL in a Python library?

Paul Harwood runette at gmail.com
Tue Dec 8 08:46:07 PST 2020


I may have misunderstood but I think you are asking the wrong community.

You can take your own C++ library and make it available to a Python library
- see https://docs.python.org/3/extending/extending.html etc - but this is
not the community to ask for advice about that. You can, of course, access
GDAL in that c++ library using the c++ API but I don't think that doing so
would change how you expose the API from your library in Python ...

Perhaps you need to make your question more specific?

On Tue, 8 Dec 2020 at 12:37, Alex HighViz <alexhighviz at hotmail.com> wrote:

> Hello,
>
> Could somebody please put me on the right track with the following
> problem?
>
> I have a C++ library that makes use of GDAL for processing raster maps and
> I would like to wrap some of its features into a Python library to make it
> accessible to a wider community.
>
> I would like my library to present functions that take rasters as input
> and produce rasters as outputs.  I can modify the C++ side to have the
> functions work on GDALRasterBands, GDALDatasets, or just on filenames. From
> my perspective I'd prefer to write any wrapping / boiler plate in C++ and
> have the Python parts as small as possible.
>
> I know this question has been asked before here, but I don't recall the
> answer and could not find it again. A simple example of "best practice"
> would be ideal.
>
>
> With many thanks, Alex
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20201208/e6e4259f/attachment.html>


More information about the gdal-dev mailing list