Commit 5827565
committed
pj_obj_create: use database context if already open for grid name resolution
When pj_obj_create() exports a coordinate operation to a PROJ string, it
previously passed nullptr as the database context to PROJStringFormatter.
This prevented substitutePROJAlternativeGridNames() from resolving grid
names via the grid_alternatives table.
For grid transformations where old_proj_grid_name is NULL (153 entries in
the standard PROJ database), the file-level fallback (getProjGridName)
cannot resolve the grid because it queries old_proj_grid_name. Only
lookForGridAlternative (which queries original_grid_name) can resolve
these grids, but it requires a database context.
This change adds getDatabaseContextIfOpen() to projCppContext, which
returns the cached database context if already opened (e.g. from a prior
proj_create_from_database call), without attempting to open proj.db.
This preserves the original intent of commit 63c491e that callers
using plain pipeline strings can run without proj.db.
Adds a test for EPSG:9484 (grid href2008a.bin -> no_kv_href2008a.tif)
which has a NULL old_proj_grid_name.1 parent fc4c131 commit 5827565
File tree
3 files changed
+49
-1
lines changed- include/proj/internal
- src/iso19111
- test/unit
3 files changed
+49
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
208 | 219 | | |
209 | | - | |
| 220 | + | |
210 | 221 | | |
211 | 222 | | |
212 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1694 | 1694 | | |
1695 | 1695 | | |
1696 | 1696 | | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1697 | 1728 | | |
1698 | 1729 | | |
1699 | 1730 | | |
| |||
0 commit comments