[postgis-devel] GDAL and Proj versions for PostGIS 3

Even Rouault even.rouault at spatialys.com
Mon Dec 17 04:23:29 PST 2018


> For using proj6 in full looks like it requires redesign in spatial_ref_sys
> table, dropping it non-user part of it and relying on internal proj6
> database?

That's a good question. You could at least conceptually imagine to dynamically 
populate part of the table: perhaps foreign table mechanism to automatically 
generate entries that come from the PROJ database by using the PROJ API, 
normal table for the user entries, and spatial_ref_sys being a view of the two 
?
I just want to warn that iterating over all CRS from the PROJ database and 
export them as WKT and PROJ string takes a few seconds, so the above would 
only perform well if clever instanciation can be done (that is if you do 
SELECT * FROM spatial_ref_sys WHERE srid = 12345, only 12345 will only be 
generated on the fly)

> Looks like we have to do it since proj7 is going to drop old way.

You could still have a full spatial_ref_sys table. It is just that it has a 
risk of being unsynchronized with the PROJ database.

Another thing to be aware of is that the generated WKT1 and PROJ strings will 
now lack in a lot of cases the TOWGS84 clause when there are several candidate 
datum transformations from the CRS to WGS84 (previously the libgeotiff script 
that created the GDAL .csv files would select the TOWGS84 transform whose area 
of use was the largest). The new way will be to pass to 
proj_create_crs_to_crs() an optional area of interest, and it will determine 
from the database the more appropriate datum transformation.

You also have the question to which part of the spatial_ref_sys entry you 
consider authoritative. The auth_name+auth_srid, the srtxt, the proj4text ? 
Currently PostGIS must certainly use the proj4text to use pj_init*() + 
pj_transform(). With PROJ 6, you can potentially use the 3 possibilities with 
proj_create_crs_to_crs(), but if you use the proj4text, you will not be able 
to benefit from the late-binding capabilities.

> 
> Looks like PostGIS is going to have mandatory transitive SQLite dependency
> via Proj.

Yes

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the postgis-devel mailing list