Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CMake EMBED_GRIDS_DIRECTORY option to embed .tif/.json files in to libproj #4349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rouault
Copy link
Member

@rouault rouault commented Dec 13, 2024

and also generalize the existing EMBED_RESOURCE_FILES option to embed the ITRFxxxx resource files.

.. option:: EMBED_GRIDS_DIRECTORY=<directory>

    .. versionadded:: 9.6

    Embed files from <directory> ending with .tif or .json in the PROJ library itself.

    The pointed directory can potentially be the full PROJ-data package (uncompressed).
    In that case, about 6 GB of free disk and 16 GB of RAM are required to build PROJ.

    When using this parameter, EMBED_RESOURCE_FILES must be set to ON.

    If the content of the directory changes, you need to run CMake again to
    update the list of files.

…to libproj

and also generalize the existing EMBED_RESOURCE_FILES option to embed the ITRFxxxx
resource files.

```
.. option:: EMBED_GRIDS_DIRECTORY=<directory>

    .. versionadded:: 9.6

    Embed files from <directory> ending with .tif or .json in the PROJ library itself.

    The pointed directory can potentially be the full PROJ-data package (uncompressed).
    In that case, about 6 GB of free disk and 16 GB of RAM are required to build PROJ.

    When using this parameter, EMBED_RESOURCE_FILES must be set to ON.

    If the content of the directory changes, you need to run CMake again to
    update the list of files.
```
@rouault rouault added this to the 9.6.0 milestone Dec 13, 2024
@hobu
Copy link
Contributor

hobu commented Dec 13, 2024

All-or-nothing for now, but would you expect to allow configuration of which grids should be embedded?

@rouault
Copy link
Member Author

rouault commented Dec 13, 2024

All-or-nothing for now, but would you expect to allow configuration of which grids should be embedded?

why not just creating a directory containing all grids you are interested in ? Pointing at individual files with CMake options could be tedious, couldn't it?

@hobu
Copy link
Contributor

hobu commented Dec 13, 2024

why not just creating a directory containing all grids you are interested in ? Pointing at individual files with CMake options could be tedious, couldn't it?

Fair point, although I was thinking about standard distribution situations like a widely distributed WASM PROJ with embedded resources on cdn.proj.org. Maybe that's always every grid file...

@willcohen
Copy link

willcohen commented Dec 13, 2024

My work-in-progress WASM proj could be a good candidate for this (though, to be clear, it's still squarely in javascript+wasm land because of needing to handle the malloc and freeing of objects via the C api -- #4327). It'll prob be a little while before I stabilize enough to throw all the grid files in there, but I could imagine there being, effectively, two different distributions of WASM PROJ, one ~10-20MB one where it's the library + DB (size dependent on whether it's base64'd into a JS file, as is the case right now), or a mega one for people who are going for full-intensity projections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants