Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

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.