Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#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?

Change History (4)

comment:1 by Mike Taves, 10 years ago

It seems there is an older, undocumented postgis_transform_geometry(geometry, text, text, integer) function; see #2207

comment:3 by dbaston, 9 years ago

Resolution: fixed
Status: newclosed

Committed at r14698

comment:4 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.