[gdal-dev] Creation of a new driver from scratch

Howard Butler howard at hobu.co
Fri Jun 2 10:13:01 PDT 2023


Abel,

Comments inline

> On Jun 2, 2023, at 10:08 AM, Abel Pau <a.pau at creaf.uab.cat> wrote:
> 
>  You can find the specifications of our vector and raster formats on our website www.miramon.cat in the "Support/Technical notes" section under the titles "Format specification of the MiraMon vector files" and "Format specification of the MiraMon raster files".

It is nice that both your raster and vector formats are openly specified. That should make contribution of drivers for GDAL straightforward and provide long lasting resilience of the software that might otherwise be sensitive to a binary SDK that might rot over time.

>  I’ve been like 15 years programming this software in C (not C++) in our own style. So I have to get used to program in your style and in C++. It’ll not be easy for me but I hope you can help me if wome doubts arises.

It is indeed desired that the code style of the contribution matches GDAL's style to some degree. GDAL provides a .clang-format file that might be helpful when you are editing to provide some automated conformance.

>  I kindly request your collaboration in providing me with a clear roadmap of the steps we should follow to generate the GDAL drivers. While we are thoroughly reviewing the existing documentation, we want to ensure that we do not overlook any crucial aspects. Your guidance and expertise during this process would be greatly appreciated.
>  I hope you can answer some questions I have. Thanks in advance.
>  ·         Do I need to ask for permission before starting a new driver, or is it assumed to be welcome?

You do not need to ask permission. You are welcome to make the contribution as a pull request to the project, but do know that contributing code in this fashion does not promise the effort will be merged into the project. The project has a policy document about large contributions like new drivers from new contributors. You can read it at https://gdal.org/development/rfc/rfc85_policy_code_additions.html 

> ·         I have downloaded the code from GitHub, but I'm not sure if it will provide me with a Visual Studio project. Will it generate an sln file?

You might be able to build a sln file using GDAL's CMake configuration, but there is no standard documentation about how to do this. Do know that most any configuration you provide must build and work with the standard GDAL CMake configuration which is typically invoked through the command line.

> ·         Once I have a Visual Studio solution (sln) to inspire myself, how should I proceed to create the driver? Is there any pre-existing pattern or template to follow?

Find an existing raster or vector driver in the project that matches MiraMon's vector or raster format and use it as a skeleton. 

> I would like to be able to debug it.

Familiarize yourself with GDAL's tests (a good place to learn is to look at GDAL's CI configuration), get tests running locally on your machine, and then write tests that provide test coverage for your raster or vector driver.

> How will I know when I am ready to submit the driver?

When it provides the capabilities to GDAL you expect, it conforms to GDAL's formatting style, the tests that you have added to validate your driver works in CI in your own GitHub fork, and the tests are complete enough to protect the driver from rotting as time goes forward.

Howard






More information about the gdal-dev mailing list