Friday, July 10, 2009

Reprojection in PostGIS

In order to convert the Spatail data from one projection system to the other,PostGIS
provides ST_Transform(the_geom,targetSRID) function.While the first parameter holds the input geometry,the second parameter refers to the SRID number of the target projection system.The following example converts WGS84(SRID#4326) into UTM,Zone43N(SRID#32643).

Example:-

--DROP TABLE MyTable1_UTM;
CREATE TABLE MyTable1_UTM WITH (OIDS=TRUE) AS
(
SELECT ST_Transform(the_geom,32643) as the_geom FROM MyTable1_geom
)


You can find the SRID of all PostGIS supported projection systems in spatial_ref_sys
table of every spatially enabled table.

No comments:

Post a Comment