[postgis-users] Using transform with proj4 string.

Brent Wood pcreso at pcreso.com
Tue Jul 17 12:25:16 PDT 2007

--- John Cole <john.cole at uai.com> wrote:
> There is a transform_geometry(geometry, text, text, integer) function, but I
> can't find any documentation on this.  I'd like to be able to be able to
> transform into a custom projection for processing (in my case using
> simplify) and then back to my srid based projection.
> Could someone provide a little insite into transform_geometry?

Hi guys,

You can't give transform a non-integer parameter. 

What you can do, however, is insert your custom projection in the
spatial_ref_sys table, with a new srid value which is not currently used, and
with the proj.4 parameter list in the proj_txt field. Then use this new srid
value in the transform function.

That should give you what you want:

select transform(simplify(transform(geom, <new srid value>), <dist>),4326)

Hope this helps,

   Brent Wood

More information about the postgis-users mailing list