Skip to content

Commit

Permalink
RFC102 text: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 9, 2024
1 parent e4982d8 commit 98cfa1d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions doc/source/development/rfc/rfc102_embedded_resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ Summary
-------

This RFC uses C23 ``#embed`` pre-processor directive, when available,
to be able to embed GDAL resource files directly into libgdal. It is also
intended to be used for PROJ, in particular for its :file:`proj.db` file.
to be able to optionally embed GDAL resource files directly into libgdal.
It is also intended to be used for PROJ, in particular for its :file:`proj.db` file.
For PROJ, a fallback mechanism will be used to not require C23.

Motivation
----------
Expand Down Expand Up @@ -88,7 +89,7 @@ locate resource files in the GDAL_DATA directory burnt at build time into libgda
(``${install_prefix}/share/gdal``), or by the :config:`GDAL_DATA` configuration option.

Said otherwise, if ``EMBED_RESOURCE_FILES=ON`` but ``USE_ONLY_EMBEDDED_RESOURCE_FILES=OFF``,
GDAL will first try to locate resource files from the file system, and
GDAL/PROJ will first try to locate resource files from the file system, and
fallback to the embedded version if not found.

The resource files will still be installed in ``${install_prefix}/share/gdal``,
Expand All @@ -102,7 +103,7 @@ Impacted code
- frmts/hdf5: embedding bag_template.xml
- frmts/nitf: embedding nitf_spec.xml
- frmts/pdf: embedding pdf_composition.xml
- frmts/pds: embedding pds4_template.xml
- frmts/pds: embedding pds4_template.xml and vicar.json
- ogr/ogrsf_frmts/dgn: embedding seed_2d.dgn and seed_3d.dgn
- ogr/ogrsf_frmts/dxf: embedding header.dxf and leader.dxf
- ogr/ogrsf_frmts/gml: embedding .gfs files and gml_registry.xml
Expand All @@ -122,6 +123,8 @@ Loading of the embedded :file:`proj.db` will involve using the
as done by
`DuckDB Spatial <https://github.com/duckdb/duckdb_spatial/blob/9c14a8b4a9093d981123a7d9f620a675ab29c6d5/spatial/src/spatial/proj/module.cpp#L56>`__

Embedding of resource files in PROJ is limited to :file:`proj.db`

Note: acknowledging how critical access to proj.db is, we make an exception of
also allowing embedding it with non-C23 capable compilers, using a CMake script,
derived from https://jonathanhamberg.com/post/cmake-file-embedding/.
Expand All @@ -145,7 +148,7 @@ Backward compatibility

Fully backwards compatible.

C23 is not required if EMBED_RESOURCE_FILES is not enabled.
C23 is not required, unless EMBED_RESOURCE_FILES is enabled in GDAL.

Documentation
-------------
Expand All @@ -166,7 +169,7 @@ Related issues and PRs

- https://github.com/OSGeo/gdal/issues/10780

- GDAL candidate implementation (in progress): https://github.com/OSGeo/gdal/compare/master...rouault:gdal:embedded_resources?expand=1
- GDAL candidate implementation: https://github.com/OSGeo/gdal/pull/10972

- PROJ candidate implementation: https://github.com/OSGeo/PROJ/pull/4265

Expand Down

0 comments on commit 98cfa1d

Please sign in to comment.