I have a Point table in which the geometry column contains both 3 dimension and 2 dimension values. I want to convert this 3 dimensional geometry to 2 dimension.
Is there any function in PostGIS?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
SELECT ST_Force_2D(the_geom) FROM...
Update your existing table
ALTER TABLE your_geo_table ADD geom2d geometry; UPDATE your_geo_table SET geom2d = ST_Force_2D(the_geom);
See also http://postgis.net/docs/
If you don't want to add a new column you can also do the following:
ALTER TABLE your_geo_table ALTER COLUMN geom TYPE geometry(YOUR_GEOM_TYPE, YOUR_EPSG) USING ST_Force_2D(geom);
ALTER TABLE your_geo_table ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 4326) USING ST_Force_2D(geom);