[postgis-users] prj and SRID relation

Frank Warmerdam warmerdam at pobox.com
Thu Oct 14 07:40:19 PDT 2004


Paul Ramsey wrote:
> 
> Your problem is not postgis support (or lack thereof) of prj files, it 
> is how the DI Extension is inserting the projection information and 
> reading it back from PostGIS. The DI extension is actually based on code 
> from Safe software, perhaps someone (Ryan?) from there could comment.

Paul,

Oh dear ... that might end up back in my lap.

> In general, our own tools (shp2pgsql, pgsql2shp) could start to 
> recognize .prj information for import and export, but that would require 
> a means of parsing and using the WKT contained therein, which would 
> entail either (a) writing our own WKT projection handling code (b) 
> adding a dependency on OGR, which has decent WKT handling code or (c) 
> porting the OGR WKT code over the proj4 so that we only have one 
> dependency still for reprojection.  Of the set, I find (c) the least 
> unappealing, but even it is quite unappealing (and quite hard, since the 
> OGR code is C++ and proj4 is C, the "port" would essentially be a guided 
> re-write).  An advantage of having real WKT support would be that we 
> could retire the nonstandard PROJ4TEXT column in our SPATIAL_REF_SYS 
> table and stop ignoring the SRTEXT column.

I would be pleased to see (b) as at least an optional "build-in" for
PostGIS.  There is a C API for the OGR spatial reference code, though there
would still be a dependency on the C++ runtime library which I presume you
also face for GEOS.

I would add that implementing WKT to PROJ.4 translation isn't terribly hard,
but it is significantly harder to keep up with variations in WKT input from
different sources, especially ESRI.  Have to maintain multiple copies of this
sort of stuff would be quite a hassle for all involved.  My maintaining one
copy of it is already quite a hassle!

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the postgis-users mailing list