[postgis-devel] Transform function for coordinates

Jeremy Palmer palmerj at xtra.co.nz
Fri Nov 18 00:19:45 PST 2005


Would it be possible to create a function that transforms x, y values from
one srid to another srid?

The reason I ask is I have a database of nodes, lines and boundaries
geometries which are physically translated (-160 shift, because or New
Zealand data crosses the 180 longitude line) and are stored at a low
precision. I also have a table of node coordinates (x, column y column, z
column) that are stored as double precision coordinates which have both a
higher precision that the spatial geometries and are not translated. These
coordinates are used for other mathematical operations, and when changed are
used to reconstruct the relating spatial geometries.

The function prototype I was thinking about was: transform(double x, double
y, [double z], int srid_in, int srid_out);

This function would be a convenience and would save me having to construct
and translate geometries each time (sometimes have to transforms 100's of
millions coordinates)


More information about the postgis-devel mailing list