1

Do you know if it is possible to assign a date (whatever the format) as the 4th dimension to a geometry in PostGIS? If so, does it recognize it as a date?

2

Yes, it's possible to store time in the m-value.

No, it cannot be a date type. It has to be numeric.

I've used unixtime, e.g. in https://anitagraser.com/2017/10/15/movement-data-in-gis-9-trajectory-data-models/. It's all based on PostGIS' temporal support, e.g. https://postgis.net/docs/ST_IsValidTrajectory.html

(You can find more examples in https://anitagraser.com/2018/04/16/movement-data-in-gis-12-why-you-should-be-using-postgis-trajectories/)

  • It has to be stored as the same type as the x/y? I.e. it can't be integer? (Been wondering this, it's that way in R's sf.) – mdsumner May 11 at 23:16
  • 2
    @mdsumner SELECT ST_M(ST_MakePointM(-71.1, 42.3, 10::integer)); does not throw an error but it returns a double precision – underdark May 12 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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