#2991 closed enhancement (fixed)
ST_Transform using PROJ.4 strings
Reported by: | Mike Taves | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS Fund Me |
Component: | postgis | Version: | |
Keywords: | Cc: |
Description
The idea behind this enhancement is to directly use a PROJ.4 string to transform to/from, rather than looking up proj4text
in spatial_ref_sys
using a SRID.
There are an infinite number of possible projections that can be described with a PROJ.4 string, such as projections centred on a particular geometry used to perform an equidistant spatial analysis. It could also be useful to fine-tune a proj4text
before assigning it an SRID in spatial_ref_sys
.
Here are some ideas for the SQL signatures:
ST_Transform(geometry g, text to_proj, text from_proj) RETURNS geometry; ST_Transform(geometry g, text to_proj, integer from_srid DEFAULT NULL) RETURNS geometry; ST_Transform(geometry g, integer to_srid, text from_proj) RETURNS geometry;
Only the last signature would return a geometry with an SRID from spatial_ref_sys
; all others would return a geometry with undefined SRID (0). With the second signature, if from_srid
is NULL, then the SRID is obtained from the geometry, and an error is raised if it is undefined.
Any thoughts? Do these signatures cover everything, or are there potential clashes?
It seems there is an older, undocumented
postgis_transform_geometry(geometry, text, text, integer)
function; see #2207