[gdal-dev] adding a new method to OGRFieldDefn & gdalautotest

Even Rouault even.rouault at spatialys.com
Tue Nov 6 13:26:22 PST 2018


On mardi 6 novembre 2018 21:16:04 CET Alan Stewart wrote:
> I'm working in Windows 7 with VS 2017 and Python 2.7.15.
> 
> I've added a new method to this class,  and wish to add tests for it to
> gdalautotest. I found and added the new method to swig/python/osgeo/ogr.py.
> Is there anything else I need to do to add python support for my new class
> method?

As the header of this file warns it, this is a generated file that you 
shouldn't edit. Adding new methods in it is not sufficient. Code must also be 
added swig/python/extensions/ogr_wrap.cpp.
So edit swig/include/ogr.i to define your new method there, and run "make 
generate" in swig/python (you need SWIG to be available) (or "nmake /f 
makefile.vc python" from swig/ on Windows)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list