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

Optimization: createOperations(): avoid database lookups for CRS (typically PROJ strings) using unknown datums #4320

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented Nov 11, 2024

Fixes #4319

With that improvement, the runtime of the following snippet goes from
25.4 second to 0.9 second:

    for(int i = 0; i < 2000; ++i)
    {
        PJ_CONTEXT *C = proj_context_create();
        PJ *P = proj_create_crs_to_crs(C,
           "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs",
           "+proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs", NULL);
        proj_destroy(P);
        proj_context_destroy(C);
    }

@rouault rouault added this to the 9.6.0 milestone Nov 11, 2024
…ically PROJ strings) using unknown datums

Fixes OSGeo#4319

With that improvement, the runtime of the following snippet goes from
25.4 second to 0.9 second:
```c
    for(int i = 0; i < 2000; ++i)
    {
        PJ_CONTEXT *C = proj_context_create();
        PJ *P = proj_create_crs_to_crs(C,
           "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs",
           "+proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs", NULL);
        proj_destroy(P);
        proj_context_destroy(C);
    }
```
@rouault rouault merged commit 863a75e into OSGeo:master Nov 14, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
funded through GSP Work funded through the GDAL Sponsorship Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix slowness on proj_create_crs_to_crs() on WGS 84 <--> UTM conversions
2 participants