I am kind of new into the GIS world. I have a couple of GPS data in a CSV file as LonLat coordinates.

I used PostGIS to create points from those coordinates using ST_MakePoint(). Then I tried to recreate the route of those points using the ST_MakeLine() function. The output of the function is of geometry type Linestring.

So, I used a repository to map match the recreated route to the real routes on a map. However, that repository requires you to use geometry of type LinestringM. I come upon this post: Adding M coordinate with different measurings in PostGIS and it says to use the function ST_AddMeasure() to create the M dimension.

My question is: What do you use as dimension M? Do you use the length of the linestring between each GPS point? Can you use timestamp as a form of measurement? Is it any arbitrary measurement you want to define?

  • There are two restrictions: M values need to be numeric, and they need to be strictly increasing over the course of a geometry. And indeed you would usually add the UNIX timestamp of your GPS positions to feed to any map matching suite; use ST_MakePointM to create them. Also, I'd be interested what repo you are referring to?
    – geozelot
    Mar 5 '20 at 7:14
  • Thanks for the response. The repo I am using is this one pgMapMatch. I am still not sure what to use as dimension M for the linestringMs. I used the ST_length for every linestring but as you said, it needs to be of increasing order. I am wondering if it is a necessary dimension.
    – vtCode
    Mar 6 '20 at 3:01

Your Answer

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

Browse other questions tagged or ask your own question.