Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

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 points as geometry format in table that I use for some analysis. All points are saved in four dimensions eg. x, y, z and m - lon, lat, alt and time. The issue is that for the analysis are used functions like ST_GeomFromEWKT and ST_MakeLine, which included only two dimensions form the four present.

My specific questions is can I have the four dimensions using these functions?

I tried simple example

SELECT ST_AsText(ST_MakeLine(ST_MakePoint(1, 1, 0, 1339590840), ST_MakePoint(2, 2, 0, 1339590840)));

Which returns "LINESTRING(1 1,2 2)", without z and time dimensions.

Thanks in advance!

share|improve this question
up vote 1 down vote accepted

PostGIS has only limited functions for dealing with 3D and 4D geometries. As you already found out, ST_MakePoint is one of the few (search for 4d). Check if you have better luck with running them through ST_Force_4D first.

share|improve this answer
Thanks! Tried ST_Force_4D and ST_Force3DM and either are not working as I want. SELECT ST_AsText(ST_Force_4D(point)) from gps_data LIMIT 1 returns "POINT(-122.084091186523 37.422004699707)" with no z and m dimensions, but the point has it (can get with st_z() and st_m()). Will look for other solution... – kode Jun 14 '12 at 6:48

Your Answer


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.