I am trying to write my fist time postgis query
My table looks like below
time (with time time zone), track_id, geography(geography(Point, 4326))
I am trying to calculate distance on particular track within some time range. e.g
select track_id, distance (in meters) from mytable where time between x and y group by track_id
I saw couple of posts online but none of those work with geography or does not take multiple geography points
CREATE TABLE data (
time TIMESTAMPTZ NOT NULL,
track_id VARCHAR NOT NULL
geography geography(point,4326)
);
Sample data
"2017-04-05 09:10:12-04";"1";"0101000020E6100000689B768C864A5540E00CA3C5BE953940"
"2017-04-06 15:23:10-04";"1";"0101000020E6100000358584DED14B55408F49905BDD953940"
"2017-05-12 05:30:03-04";"1";"0101000020E610000008420D3A7C50554060BE068E15903940"
"2017-05-20 01:19:24-04";"1";"0101000020E61000001D5C959F2F805540EEDBFFB6DDC23940"
"2017-05-20 01:17:52-04";"1";"0101000020E6100000E3F50599897F55406523C621D1C03940"
So, this is gps data of a vehicle whose id is one. I need to calculate total distance travelled by vehicle say for date 2017-05-20 in meters. There can be other views with different id.
Reference eg. https://gis.stackexchange.com/questions/268776/finding-total-distance-of-path-along-points-in-postgis but this is taking geometry instead of geography