Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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? Please help me to solve this problem.

Regards Sreesha.T.A

share|improve this question

http://postgis.net/docs/manual-2.0/ST_Force_2D.html

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/

share|improve this answer

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);

For example:

ALTER TABLE your_geo_table  
  ALTER COLUMN geom TYPE geometry(MULTILINESTRING, 4326) 
    USING ST_Force_2D(geom);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.