App for Trajectories Map Matching
MIT License
To make a library available, a Jitpack platform will be used, which shares a more original version of the repository.
pom.xml
:<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
pom.xml
:<dependency>
<groupId>com.github.gabrielczar</groupId>
<artifactId>MapMatching</artifactId>
<version>1.3.0</version>
</dependency>
docker volume create pg_data
docker run --name=trajectory-data-postgis -d -e POSTGRES_USER=postgres -e POSTGRES_PASS=postgres -e POSTGRES_DBNAME=trajectory-data -e ALLOW_IP_RANGE=0.0.0.0/0 -p 5432:5432 -v pg_data:/var/lib/postgresql --restart=always kartoza/postgis:9.6-2.4
CREATE TABLE matched_points (
id serial primary key,
natural_id integer,
datetime timestamp,
longitude double precision,
latitude double precision,
edge_id bigint,
offset double precision,
geometry point
);
CREATE TABLE dataset (
id serial primary key,
natural_id integer,
datetime timestamp,
longitude double precision,
latitude double precision
);
ALTER TABLE dataset ADD COLUMN geom GEOMETRY;
ALTER TABLE dataset ADD COLUMN ID SERIAL PRIMARY KEY;
update dataset
set geom = ST_SetSRID(ST_MakePoint(t.long, t.lat), 4326)
from (
select id, longitude as long,
latitude as lat from dataset) as t
WHERE t.id = dataset.id;
SELECT * FROM dataset WHERE date_time::date >= date '2008-02-02' AND date_time::date < date '2008-02-03';