Code Monkey home page Code Monkey logo

map-matching's Introduction

Map Matching based on GraphHopper

Build Status

Snaps GPX traces to the road using the GraphHopper routing engine.

Read more about the map matching problem at Wikipedia.

See the demo in action (black is GPS track, green is matched result):

map-matching-example

License

Apache License 2.0

Discussion

Our web forum is here.

Usage

Java 8 and Maven >=3.3 are required.

Build:

mvn package -DskipTests

Then you need to import an OSM map for the area you want to do map-matching on, e.g. the provided sample data:

java -jar matching-web/target/graphhopper-map-matching-web-3.0-SNAPSHOT.jar import map-data/leipzig_germany.osm.pbf

OpenStreetMap data in pbf or xml format are available from here.

The optional parameter --vehicle defines the routing profile like car, bike, motorcycle or foot. You can also provide a comma separated list. For all supported values see the variables in the FlagEncoderFactory of GraphHopper.

Before re-importing, you need to delete the graph-cache directory, which is created by the import.

Now you can match GPX traces against the map:

java -jar matching-web/target/graphhopper-map-matching-web-3.0-SNAPSHOT.jar match matching-web/src/test/resources/*.gpx

If you were using multiple vehicles for the import you can use --vehicle to select one of them, otherwise the first one will be used.

Web app

Start via:

java -jar matching-web/target/graphhopper-map-matching-web-3.0-SNAPSHOT.jar server config.yml

Access the simple UI via localhost:8989.

You can post GPX files and get back snapped results as GPX or as compatible GraphHopper JSON. An example curl request is:

curl -XPOST -H "Content-Type: application/gpx+xml" -d @matching-web/src/test/resources/test1.gpx "localhost:8989/match?vehicle=car&type=json"

Tools

Determine the bounding box of one or more GPX files:

java -jar matching-web/target/graphhopper-map-matching-web-3.0-SNAPSHOT.jar getbounds matching-web/src/test/resources/*.gpx

Java usage

Have a look at MapMatchingResource.java to see how the web service is implemented on top of library functions to get an idea how to use map matching in your own project.

Use this Maven dependency:

<dependency>
    <groupId>com.graphhopper</groupId>
    <artifactId>graphhopper-map-matching-core</artifactId>
    <version>3.0-SNAPSHOT</version>
</dependency>

Note

Note that the edge and node IDs from GraphHopper will change for different PBF files, like when updating the OSM data.

About

The map matching algorithm mainly follows the approach described in

Newson, Paul, and John Krumm. "Hidden Markov map matching through noise and sparseness." Proceedings of the 17th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems. ACM, 2009.

This algorithm works as follows. For each input GPS position, a number of map matching candidates within a certain radius around the GPS position is computed. The Viterbi algorithm as provided by the hmm-lib is then used to compute the most likely sequence of map matching candidates. Thereby, the distances between GPS positions and map matching candidates as well as the routing distances between consecutive map matching candidates are taken into account. The GraphHopper routing engine is used to find candidates and to compute routing distances.

Before GraphHopper 0.8, this faster but more heuristic approach was used.

map-matching's People

Contributors

1kastner avatar chucre avatar devemux86 avatar easbar avatar hbruch avatar karussell avatar kodonnell avatar michaz avatar nakaner avatar rockwellw avatar stefanholder avatar tochev avatar tyrasd avatar ustroetz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

map-matching's Issues

Remove duplicate entries from LocationIndexMatch

Currently a list returned from LocationIndexMatch can contain QueryResult with duplicate edges, we should keep only the QueryResult with the closest snap (only make a difference if NODE or EDGE snap)

keep -> 51.0299515,13.7312364,135.0, 1262321564000, query distance:5.303846908850638, gpxListIndex:218
        51.0299515,13.7312364,135.0, 1262321564000, query distance:7.0464515718966, gpxListIndex:218
        51.0299515,13.7312364,135.0, 1262321564000, query distance:12.1125611024485, gpxListIndex:218

Date import fails

After cloning , I tried running following :
./map-matching.sh action=import datasource=/home/harshit.sharma/random.osm

LocationIndexMatch.java:[67,31] error: method findNetworkEntries in class LocationIndexTree cannot be applied to given types.

Following is stacktrace:
ls: cannot access target/map-matching-*-dependencies.jar: No such file or directory
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GraphHopper Map Matching 0.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ map-matching ---
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ map-matching ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ map-matching ---
[INFO] Compiling 6 source files to /home/harshitsharma/map-matching/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.117s
[INFO] Finished at: Fri Aug 07 16:24:45 IST 2015
[INFO] Final Memory: 12M/143M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project map-matching: Compilation failure
[ERROR] /home/harshitsharma/map-matching/src/main/java/com/graphhopper/matching/LocationIndexMatch.java:[67,31] error: method findNetworkEntries in class LocationIndexTree cannot be applied to given types;
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Error: Unable to access jarfile action=import

Can't handle subsecond precision in GPX files

Some GPX traces have more than one point per second, and have sub-second accuracy. (AFAIR) this is allowed in ISO datetimes, but the DATE_FORMAT/DATE_FORMAT_Z doesn't match subseconds, and you get this error when trying to match such a GPX file:

Exception in thread "main" java.lang.IllegalStateException: java.text.ParseException: Unparseable date: "2012-11-08T14:19:37.500Z"

Timedate parse issue

I tried the following file as a test: https://www.openstreetmap.org/user/epe/traces/776904

The error I got is the following:

2015-02-12 14:59:45,897 [main] ERROR com.graphhopper.matching.MapMatchingMain - Problem with file 776904.gpx Error: java.text.ParseException: Unparseable date: "2010-07-30T17:5236"

What is the expected datetime format? Can we add this to the docs?

All vehicles in input data

I need to process data from 24h when somebody can use all vehicle.
After hopper.importOrLoad(); I can't change settings. How can I prepare map-matching for a large number of different routes?

Suggestion: More precision

During the matching algorithm, the software can do an extra check to remove spurious errors. The program may check the edge of the point, and check one (two-customizable) points backwards and one (two-customizable) points forwards to see if their edge is in a street that's on the same class. If the point before (x-1) and after (x+1) are on a highway, and x is not on a motorway, you can do an extra check if the point is near a motorway, and ignore it if it so. Could this be a right idea?

Association of all provided GPXEntry to the corresponding EdgeMatch

Discussion: https://discuss.graphhopper.com/t/map-matchresult-to-gpxentry/977

The plan was that all GPXEntries which we used for matching should be associated to EdgeMatch

This doesn't work since the rework of the matching algorithm in doWork(List<GPXEntry> gpxList)
from the pull-request #49

The main reason for this is the filtering of GPXEntries by a distance threshold
distance(previousGPX, currentGPX) > 2 * measurementErrorSigma
which are never considered again in the the following resolvation of MostLikelySequence to EdgeMatch

GPXEntries are disregarded to avoid too many (superfluous) calculations.

How to match a ferry route

Some of my test tracks include ferry rides. Here the algorithm often fails as ferries don't always take exactly the same route. The algorithm could maybe adjust the gpxAccuracy in this case to a much more relaxed value, eventually by somehow takeing the length of the ferry route edge into account.
Besides that the algorithm works pretty well.

Missing or old OSM data

I tried to match this GPX track to the Berlin Metro Extracts:
https://www.openstreetmap.org/user/6arms1leg/traces/1744934

I got the error:

 ERROR com.graphhopper.matching.MapMatchingMain - Problem with file 1744934.gpx Error: Cannot find matching path! Missing or old OpenStreetMap data? 3, [9440-9459  52.504784799189046,13.431137763501447,NaN], [9459-9460  52.503416108960835,13.430194862753655,NaN]

Both points are directly on a OSM street. What could be the reason for the error?

PostGIS map matching adaptor/plugin

I feel really stupid to ask this, but I can't make head or tail of the readme. Is the only valid input format a GPX file? Actually I have my points stored within PostGIS and I'm searching for an easy way to map it to OSM. Any ideas?

src/main/resources/log4j.xml overriding client log configuration

The src/main/resources/log4j.xml is interfering with my own logging configuration.
Suggest that you move your log4j.xml to src/test/resources.

Log4j attempts to load log4j.xml first, and then log4j.properties, using the first it finds on the classpath.

I have my own logging configuration (log4j.properties). Your log4j.xml is being picked up instead.

I can workaround it, but this is something you might like to clean up.

Some related discussion:
http://stackoverflow.com/questions/10890505/multiple-log4j-properties-files-in-classpath?rq=1

Suggestion: Looping resolution

Hi! I've read about the loop problem, and your idea about MappointX, MappointX+4, etc... I was thinking it would be better to divide the subtrack based on same points. For example
idea1 instead of routing from A to B, you can route in pair A-B,C-D,etc...

If points are near (5m-10m-adjustable) and subsequent, treat them as one. In are near but not subsequent, like the drawing above, dividing the route should be OK. It's a good idea? :)

refactor to use hmm-lib 1.0.0

I just published a pre-release (snapshot) of hmm-lib 1.0.0.

Using this new version in Graphhopper map-matching would bring several improvements:

  • The API was redesigned to allow calling the Viterbi algorithm iteratively. This allows using single-source multi-target routing, which should result in a speed-up. Moreover, if an HMM break occurs, the GPS trace can be split at the break and both sub traces can be matched separately.
  • The paths between matched positions (the entire matched route) can now be retrieved after computing the most likely sequence using transition descriptors. Hence, there is no need anymore to store all paths between subsequent candidates.
  • Memory footprint is reduced from O(t*nยฒ) to O(t) for typical GPS traces, where t is the number of time steps and n is the number of candidates per time step.

The project offline-map-matching, branch-1.0.0 is now also using the hmm-lib 1.0.0-SNAPSHOT. In there, OfflineMapMatcherTest.java provides an example how to use the new hmm-lib API, which can be used as a template for Graphhopper map-matching.

Feedback is welcome!

Cannot find matching path error

Iโ€™m trying to use your map matching software, but I am running into the following error when I try to execute it in terminal:
2015-06-30 13:09:45,455 [main] ERROR com.graphhopper.matching.MapMatchingMain - Problem with file /Users/jycai/Desktop/newGpx2.gpx Error: Cannot find matching path! Wrong vehicle car or missing OpenStreetMap data? Try to increase maxSearchMultiplier (100.0). Current gpx sublist:52, start list:[5184-46176 32.245996756389665,34.91484582233829,NaN], end list:[5422-6047 32.24460089008363,34.91189092200751,NaN], bounds: 34.700081714244526,35.051999838322395,31.92900062193723,32.24599936409293

The command Iโ€™m using is: ./map-matching.sh action=match gpx=~/Desktop/newGpx2.gpx as specified by the readme.

The route is a route in Tel Aviv, Israel and I downloaded the .osm.pbf map for that and processed it, so I am not sure why I am running into this error or how to proceed. Could you lend any suggestions?

gpx attributes lost after map matching

After running the map matching algorithm on an input gpx file, the output gpx file is missing all other attributes such as <desc></desc> or <link></link>

Cannot extract path - no edges returned

I am get this error for the file posted below:

2015-04-02 12:50:16,920 [main] INFO  com.graphhopper.matching.MapMatchingMain - loading graph from cache
2015-04-02 12:50:17,043 [main] INFO  com.graphhopper.matching.MapMatchingMain - Setup lookup index. Accuracy filter is at 15m
2015-04-02 12:50:17,048 [main] INFO  com.graphhopper.matching.MapMatchingMain - Now processing 1 files
gps import took:0.063660115s, match took: 0.5550446
2015-04-02 12:50:17,667 [main] ERROR com.graphhopper.matching.MapMatchingMain - Problem with file /Users/ustroetz/Downloads/test.gpx Error: Cannot extract path - no edges returned? 9, [1267-9365  -33.470600025404266,-70.67163408976633,NaN], [1267-9365  -33.470600025404266,-70.67163408976633,NaN, 1267-9319  -33.470646940833944,-70.67162938581463,NaN, 1267-9317  -33.47064704009847,-70.67163353424445,NaN, 36597-1267  -33.47064704009847,-70.67163353424445,NaN]

I am using the santiago_chile metro extracts. Any ideas what might be the reason?

The sample file:

<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd" creator="gpx.py -- https://github.com/tkrajina/gpxpy">
   <trk>
      <name />
      <type />
      <desc />
      <trkseg>
         <trkpt lat="-33.4617" lon="-70.623482">
            <time>2015-04-02T12:25:56Z</time>
         </trkpt>
         <trkpt lat="-33.461948" lon="-70.623413">
            <time>2015-04-02T12:25:57Z</time>
         </trkpt>
         <trkpt lat="-33.462002" lon="-70.623352">
            <time>2015-04-02T12:25:58Z</time>
         </trkpt>
         <trkpt lat="-33.462109" lon="-70.623383">
            <time>2015-04-02T12:25:59Z</time>
         </trkpt>
         <trkpt lat="-33.462601" lon="-70.623238">
            <time>2015-04-02T12:26:00Z</time>
         </trkpt>
         <trkpt lat="-33.46278" lon="-70.623108">
            <time>2015-04-02T12:26:01Z</time>
         </trkpt>
         <trkpt lat="-33.46278" lon="-70.623108">
            <time>2015-04-02T12:26:02Z</time>
         </trkpt>
         <trkpt lat="-33.46283" lon="-70.623169">
            <time>2015-04-02T12:26:03Z</time>
         </trkpt>
         <trkpt lat="-33.463661" lon="-70.62294">
            <time>2015-04-02T12:26:04Z</time>
         </trkpt>
         <trkpt lat="-33.463749" lon="-70.622864">
            <time>2015-04-02T12:26:05Z</time>
         </trkpt>
         <trkpt lat="-33.463921" lon="-70.622871">
            <time>2015-04-02T12:26:06Z</time>
         </trkpt>
         <trkpt lat="-33.464409" lon="-70.622726">
            <time>2015-04-02T12:26:07Z</time>
         </trkpt>
         <trkpt lat="-33.4645" lon="-70.62265">
            <time>2015-04-02T12:26:08Z</time>
         </trkpt>
         <trkpt lat="-33.464642" lon="-70.622673">
            <time>2015-04-02T12:26:09Z</time>
         </trkpt>
         <trkpt lat="-33.46526" lon="-70.622498">
            <time>2015-04-02T12:26:10Z</time>
         </trkpt>
         <trkpt lat="-33.465439" lon="-70.622383">
            <time>2015-04-02T12:26:11Z</time>
         </trkpt>
         <trkpt lat="-33.4655" lon="-70.622421">
            <time>2015-04-02T12:26:12Z</time>
         </trkpt>
         <trkpt lat="-33.46637" lon="-70.622192">
            <time>2015-04-02T12:26:13Z</time>
         </trkpt>
         <trkpt lat="-33.466511" lon="-70.62207">
            <time>2015-04-02T12:26:14Z</time>
         </trkpt>
         <trkpt lat="-33.466511" lon="-70.62207">
            <time>2015-04-02T12:26:15Z</time>
         </trkpt>
         <trkpt lat="-33.46664" lon="-70.622124">
            <time>2015-04-02T12:26:16Z</time>
         </trkpt>
         <trkpt lat="-33.467281" lon="-70.622063">
            <time>2015-04-02T12:26:17Z</time>
         </trkpt>
         <trkpt lat="-33.467388" lon="-70.621971">
            <time>2015-04-02T12:26:18Z</time>
         </trkpt>
         <trkpt lat="-33.467541" lon="-70.622017">
            <time>2015-04-02T12:26:19Z</time>
         </trkpt>
         <trkpt lat="-33.46859" lon="-70.62191">
            <time>2015-04-02T12:26:20Z</time>
         </trkpt>
         <trkpt lat="-33.468658" lon="-70.621841">
            <time>2015-04-02T12:26:21Z</time>
         </trkpt>
         <trkpt lat="-33.468658" lon="-70.621841">
            <time>2015-04-02T12:26:22Z</time>
         </trkpt>
         <trkpt lat="-33.468681" lon="-70.62191">
            <time>2015-04-02T12:26:23Z</time>
         </trkpt>
         <trkpt lat="-33.469608" lon="-70.621803">
            <time>2015-04-02T12:26:24Z</time>
         </trkpt>
         <trkpt lat="-33.46973" lon="-70.621719">
            <time>2015-04-02T12:26:25Z</time>
         </trkpt>
         <trkpt lat="-33.46973" lon="-70.621719">
            <time>2015-04-02T12:26:26Z</time>
         </trkpt>
         <trkpt lat="-33.469769" lon="-70.621788">
            <time>2015-04-02T12:26:27Z</time>
         </trkpt>
         <trkpt lat="-33.470921" lon="-70.621658">
            <time>2015-04-02T12:26:28Z</time>
         </trkpt>
         <trkpt lat="-33.471069" lon="-70.621567">
            <time>2015-04-02T12:26:29Z</time>
         </trkpt>
         <trkpt lat="-33.471069" lon="-70.621567">
            <time>2015-04-02T12:26:30Z</time>
         </trkpt>
         <trkpt lat="-33.471001" lon="-70.622192">
            <time>2015-04-02T12:26:31Z</time>
         </trkpt>
         <trkpt lat="-33.471081" lon="-70.622704">
            <time>2015-04-02T12:26:32Z</time>
         </trkpt>
         <trkpt lat="-33.471279" lon="-70.623154">
            <time>2015-04-02T12:26:33Z</time>
         </trkpt>
         <trkpt lat="-33.471809" lon="-70.623878">
            <time>2015-04-02T12:26:34Z</time>
         </trkpt>
         <trkpt lat="-33.471809" lon="-70.623878">
            <time>2015-04-02T12:26:35Z</time>
         </trkpt>
         <trkpt lat="-33.47332" lon="-70.623482">
            <time>2015-04-02T12:26:36Z</time>
         </trkpt>
         <trkpt lat="-33.47337" lon="-70.623413">
            <time>2015-04-02T12:26:37Z</time>
         </trkpt>
         <trkpt lat="-33.47337" lon="-70.623413">
            <time>2015-04-02T12:26:38Z</time>
         </trkpt>
         <trkpt lat="-33.473431" lon="-70.623459">
            <time>2015-04-02T12:26:39Z</time>
         </trkpt>
         <trkpt lat="-33.474869" lon="-70.623077">
            <time>2015-04-02T12:26:40Z</time>
         </trkpt>
         <trkpt lat="-33.474918" lon="-70.623009">
            <time>2015-04-02T12:26:41Z</time>
         </trkpt>
         <trkpt lat="-33.474918" lon="-70.623009">
            <time>2015-04-02T12:26:42Z</time>
         </trkpt>
         <trkpt lat="-33.475479" lon="-70.626091">
            <time>2015-04-02T12:26:43Z</time>
         </trkpt>
         <trkpt lat="-33.475479" lon="-70.626091">
            <time>2015-04-02T12:26:44Z</time>
         </trkpt>
         <trkpt lat="-33.4753" lon="-70.626137">
            <time>2015-04-02T12:26:45Z</time>
         </trkpt>
         <trkpt lat="-33.4753" lon="-70.626137">
            <time>2015-04-02T12:26:46Z</time>
         </trkpt>
         <trkpt lat="-33.47617" lon="-70.631149">
            <time>2015-04-02T12:26:47Z</time>
         </trkpt>
         <trkpt lat="-33.477001" lon="-70.63707">
            <time>2015-04-02T12:26:48Z</time>
         </trkpt>
         <trkpt lat="-33.477161" lon="-70.641922">
            <time>2015-04-02T12:26:49Z</time>
         </trkpt>
         <trkpt lat="-33.477161" lon="-70.641922">
            <time>2015-04-02T12:26:50Z</time>
         </trkpt>
         <trkpt lat="-33.477581" lon="-70.641907">
            <time>2015-04-02T12:26:51Z</time>
         </trkpt>
         <trkpt lat="-33.477638" lon="-70.641838">
            <time>2015-04-02T12:26:52Z</time>
         </trkpt>
         <trkpt lat="-33.477638" lon="-70.641838">
            <time>2015-04-02T12:26:53Z</time>
         </trkpt>
         <trkpt lat="-33.477612" lon="-70.648193">
            <time>2015-04-02T12:26:54Z</time>
         </trkpt>
         <trkpt lat="-33.477612" lon="-70.648193">
            <time>2015-04-02T12:26:55Z</time>
         </trkpt>
         <trkpt lat="-33.477558" lon="-70.648529">
            <time>2015-04-02T12:26:56Z</time>
         </trkpt>
         <trkpt lat="-33.47747" lon="-70.648788">
            <time>2015-04-02T12:26:57Z</time>
         </trkpt>
         <trkpt lat="-33.4771" lon="-70.649483">
            <time>2015-04-02T12:26:58Z</time>
         </trkpt>
         <trkpt lat="-33.477001" lon="-70.650063">
            <time>2015-04-02T12:26:59Z</time>
         </trkpt>
         <trkpt lat="-33.476978" lon="-70.651176">
            <time>2015-04-02T12:27:00Z</time>
         </trkpt>
         <trkpt lat="-33.476978" lon="-70.651176">
            <time>2015-04-02T12:27:01Z</time>
         </trkpt>
         <trkpt lat="-33.47683" lon="-70.651978">
            <time>2015-04-02T12:27:02Z</time>
         </trkpt>
         <trkpt lat="-33.47678" lon="-70.652496">
            <time>2015-04-02T12:27:03Z</time>
         </trkpt>
         <trkpt lat="-33.476742" lon="-70.653923">
            <time>2015-04-02T12:27:04Z</time>
         </trkpt>
         <trkpt lat="-33.47683" lon="-70.653999">
            <time>2015-04-02T12:27:05Z</time>
         </trkpt>
         <trkpt lat="-33.47683" lon="-70.653999">
            <time>2015-04-02T12:27:06Z</time>
         </trkpt>
         <trkpt lat="-33.475868" lon="-70.654083">
            <time>2015-04-02T12:27:07Z</time>
         </trkpt>
         <trkpt lat="-33.475868" lon="-70.654083">
            <time>2015-04-02T12:27:08Z</time>
         </trkpt>
         <trkpt lat="-33.47578" lon="-70.65416">
            <time>2015-04-02T12:27:09Z</time>
         </trkpt>
         <trkpt lat="-33.475712" lon="-70.654343">
            <time>2015-04-02T12:27:10Z</time>
         </trkpt>
         <trkpt lat="-33.475712" lon="-70.654343">
            <time>2015-04-02T12:27:11Z</time>
         </trkpt>
         <trkpt lat="-33.47578" lon="-70.65416">
            <time>2015-04-02T12:27:12Z</time>
         </trkpt>
         <trkpt lat="-33.475868" lon="-70.654083">
            <time>2015-04-02T12:27:13Z</time>
         </trkpt>
         <trkpt lat="-33.47683" lon="-70.653999">
            <time>2015-04-02T12:27:14Z</time>
         </trkpt>
         <trkpt lat="-33.477299" lon="-70.653908">
            <time>2015-04-02T12:27:15Z</time>
         </trkpt>
         <trkpt lat="-33.478889" lon="-70.653801">
            <time>2015-04-02T12:27:16Z</time>
         </trkpt>
         <trkpt lat="-33.478889" lon="-70.653801">
            <time>2015-04-02T12:27:17Z</time>
         </trkpt>
         <trkpt lat="-33.47884" lon="-70.653877">
            <time>2015-04-02T12:27:18Z</time>
         </trkpt>
         <trkpt lat="-33.47868" lon="-70.655472">
            <time>2015-04-02T12:27:19Z</time>
         </trkpt>
         <trkpt lat="-33.47868" lon="-70.655472">
            <time>2015-04-02T12:27:20Z</time>
         </trkpt>
         <trkpt lat="-33.47773" lon="-70.655273">
            <time>2015-04-02T12:27:21Z</time>
         </trkpt>
         <trkpt lat="-33.47773" lon="-70.655273">
            <time>2015-04-02T12:27:22Z</time>
         </trkpt>
         <trkpt lat="-33.477859" lon="-70.655251">
            <time>2015-04-02T12:27:23Z</time>
         </trkpt>
         <trkpt lat="-33.47797" lon="-70.655121">
            <time>2015-04-02T12:27:24Z</time>
         </trkpt>
         <trkpt lat="-33.477982" lon="-70.654961">
            <time>2015-04-02T12:27:25Z</time>
         </trkpt>
         <trkpt lat="-33.477798" lon="-70.654732">
            <time>2015-04-02T12:27:26Z</time>
         </trkpt>
         <trkpt lat="-33.47757" lon="-70.654701">
            <time>2015-04-02T12:27:27Z</time>
         </trkpt>
         <trkpt lat="-33.47731" lon="-70.654968">
            <time>2015-04-02T12:27:28Z</time>
         </trkpt>
         <trkpt lat="-33.47731" lon="-70.654968">
            <time>2015-04-02T12:27:29Z</time>
         </trkpt>
         <trkpt lat="-33.477299" lon="-70.653908">
            <time>2015-04-02T12:27:30Z</time>
         </trkpt>
         <trkpt lat="-33.477299" lon="-70.653908">
            <time>2015-04-02T12:27:31Z</time>
         </trkpt>
         <trkpt lat="-33.47683" lon="-70.653999">
            <time>2015-04-02T12:27:32Z</time>
         </trkpt>
         <trkpt lat="-33.473621" lon="-70.654243">
            <time>2015-04-02T12:27:33Z</time>
         </trkpt>
         <trkpt lat="-33.473621" lon="-70.654243">
            <time>2015-04-02T12:27:34Z</time>
         </trkpt>
         <trkpt lat="-33.47356" lon="-70.654449">
            <time>2015-04-02T12:27:35Z</time>
         </trkpt>
         <trkpt lat="-33.473049" lon="-70.654732">
            <time>2015-04-02T12:27:36Z</time>
         </trkpt>
         <trkpt lat="-33.471439" lon="-70.65583">
            <time>2015-04-02T12:27:37Z</time>
         </trkpt>
         <trkpt lat="-33.47118" lon="-70.655899">
            <time>2015-04-02T12:27:38Z</time>
         </trkpt>
         <trkpt lat="-33.47002" lon="-70.655983">
            <time>2015-04-02T12:27:39Z</time>
         </trkpt>
         <trkpt lat="-33.47002" lon="-70.655983">
            <time>2015-04-02T12:27:40Z</time>
         </trkpt>
         <trkpt lat="-33.469978" lon="-70.656036">
            <time>2015-04-02T12:27:41Z</time>
         </trkpt>
         <trkpt lat="-33.470009" lon="-70.65657">
            <time>2015-04-02T12:27:42Z</time>
         </trkpt>
         <trkpt lat="-33.470058" lon="-70.656616">
            <time>2015-04-02T12:27:43Z</time>
         </trkpt>
         <trkpt lat="-33.470058" lon="-70.656616">
            <time>2015-04-02T12:27:44Z</time>
         </trkpt>
         <trkpt lat="-33.46999" lon="-70.6567">
            <time>2015-04-02T12:27:45Z</time>
         </trkpt>
         <trkpt lat="-33.46999" lon="-70.657028">
            <time>2015-04-02T12:27:46Z</time>
         </trkpt>
         <trkpt lat="-33.470131" lon="-70.659447">
            <time>2015-04-02T12:27:47Z</time>
         </trkpt>
         <trkpt lat="-33.470211" lon="-70.65963">
            <time>2015-04-02T12:27:48Z</time>
         </trkpt>
         <trkpt lat="-33.470211" lon="-70.65963">
            <time>2015-04-02T12:27:49Z</time>
         </trkpt>
         <trkpt lat="-33.473309" lon="-70.659439">
            <time>2015-04-02T12:27:50Z</time>
         </trkpt>
         <trkpt lat="-33.473309" lon="-70.659439">
            <time>2015-04-02T12:27:51Z</time>
         </trkpt>
         <trkpt lat="-33.473209" lon="-70.659554">
            <time>2015-04-02T12:27:52Z</time>
         </trkpt>
         <trkpt lat="-33.473309" lon="-70.661209">
            <time>2015-04-02T12:27:53Z</time>
         </trkpt>
         <trkpt lat="-33.473412" lon="-70.66127">
            <time>2015-04-02T12:27:54Z</time>
         </trkpt>
         <trkpt lat="-33.473412" lon="-70.66127">
            <time>2015-04-02T12:27:55Z</time>
         </trkpt>
         <trkpt lat="-33.473309" lon="-70.661324">
            <time>2015-04-02T12:27:56Z</time>
         </trkpt>
         <trkpt lat="-33.473419" lon="-70.663223">
            <time>2015-04-02T12:27:57Z</time>
         </trkpt>
         <trkpt lat="-33.47353" lon="-70.663292">
            <time>2015-04-02T12:27:58Z</time>
         </trkpt>
         <trkpt lat="-33.47353" lon="-70.663292">
            <time>2015-04-02T12:27:59Z</time>
         </trkpt>
         <trkpt lat="-33.47068" lon="-70.663422">
            <time>2015-04-02T12:28:00Z</time>
         </trkpt>
         <trkpt lat="-33.47068" lon="-70.663422">
            <time>2015-04-02T12:28:01Z</time>
         </trkpt>
         <trkpt lat="-33.470501" lon="-70.663391">
            <time>2015-04-02T12:28:02Z</time>
         </trkpt>
         <trkpt lat="-33.470451" lon="-70.663429">
            <time>2015-04-02T12:28:03Z</time>
         </trkpt>
         <trkpt lat="-33.470451" lon="-70.663429">
            <time>2015-04-02T12:28:04Z</time>
         </trkpt>
         <trkpt lat="-33.470581" lon="-70.667702">
            <time>2015-04-02T12:28:05Z</time>
         </trkpt>
         <trkpt lat="-33.470551" lon="-70.667892">
            <time>2015-04-02T12:28:06Z</time>
         </trkpt>
         <trkpt lat="-33.4706" lon="-70.671631">
            <time>2015-04-02T12:28:07Z</time>
         </trkpt>
         <trkpt lat="-33.4706" lon="-70.671631">
            <time>2015-04-02T12:28:08Z</time>
         </trkpt>
         <trkpt lat="-33.47192" lon="-70.671623">
            <time>2015-04-02T12:28:09Z</time>
         </trkpt>
         <trkpt lat="-33.47192" lon="-70.671623">
            <time>2015-04-02T12:28:10Z</time>
         </trkpt>
         <trkpt lat="-33.471901" lon="-70.670326">
            <time>2015-04-02T12:28:11Z</time>
         </trkpt>
         <trkpt lat="-33.471901" lon="-70.670326">
            <time>2015-04-02T12:28:12Z</time>
         </trkpt>
         <trkpt lat="-33.470619" lon="-70.670341">
            <time>2015-04-02T12:28:13Z</time>
         </trkpt>
         <trkpt lat="-33.470589" lon="-70.670288">
            <time>2015-04-02T12:28:14Z</time>
         </trkpt>
         <trkpt lat="-33.470589" lon="-70.670288">
            <time>2015-04-02T12:28:15Z</time>
         </trkpt>
         <trkpt lat="-33.4706" lon="-70.671631">
            <time>2015-04-02T12:28:16Z</time>
         </trkpt>
         <trkpt lat="-33.4706" lon="-70.671631">
            <time>2015-04-02T12:28:17Z</time>
         </trkpt>
         <trkpt lat="-33.46941" lon="-70.671661">
            <time>2015-04-02T12:28:18Z</time>
         </trkpt>
         <trkpt lat="-33.46941" lon="-70.671661">
            <time>2015-04-02T12:28:19Z</time>
         </trkpt>
         <trkpt lat="-33.469421" lon="-70.672089">
            <time>2015-04-02T12:28:20Z</time>
         </trkpt>
         <trkpt lat="-33.469421" lon="-70.672089">
            <time>2015-04-02T12:28:21Z</time>
         </trkpt>
         <trkpt lat="-33.470619" lon="-70.672081">
            <time>2015-04-02T12:28:22Z</time>
         </trkpt>
         <trkpt lat="-33.470619" lon="-70.672081">
            <time>2015-04-02T12:28:23Z</time>
         </trkpt>
         <trkpt lat="-33.470669" lon="-70.679131">
            <time>2015-04-02T12:28:24Z</time>
         </trkpt>
         <trkpt lat="-33.470669" lon="-70.67913">
            <time>2015-04-02T12:28:25Z</time>
         </trkpt>
      </trkseg>
   </trk>
</gpx>

Example Code in Readme

The sample code in the Readme is not working:

Graph graph = hopper.getGraph();
LocationIndexMatch locationIndex = new LocationIndexMatch(graph, new RAMDirectory());
locationIndex.prepareIndex();
MapMatching mapMatching = new MapMatching(graph, locationIndex, encoder);

I get the following error:

The constructor LocationIndexMatch(Graph, RAMDirectory) is undefined    Routing.java    line 145    Java Problem

That is because LocationIndexMatch expects a GraphStorage and not a Graph.
But if I change the code to, like it is done in the test files:

GraphStorage graph = hopper.getGraph();
LocationIndexMatch locationIndex = new LocationIndexMatch(graph, (LocationIndexTree) hopper.getLocationIndex());         
MapMatching mapMatching = new MapMatching(graph, locationIndex, encoder);

I get the following exception:

05-07 11:26:24.235: E/AndroidRuntime(18902): Caused by: java.lang.IllegalArgumentException: Call LevelGraph.getBaseGraph() instead of using the LevelGraph itself

can the input gps traces file contain just point ?

Hi,
I want to match some points to the road network with the ESRI's shp file(point layer and road network layer). I try to convert the shp file to gpx format and run it in your software, error 'gpx list needs at least 2 points' appears. So, can the input gps traces file contain just point ? what should I do ?

map edgeId to OSM wayID

Hey,

I'm new to graphhopper and i'm using this map matching master to match some GPX data.
I want to get the OSM wayID or nodeID of the matched result but it seems that the results is list of matched edges. I don't really understand what are those edgeID, what do they represent in Open street map?

Thanks for help.

Cannot import data - error

Hi,

When I ran this command:
./map-matching.sh action=import datasource=/home/map-matching/map-data/leipzig_germany.osm.pbf

I got this error:
ipzig_germany.osm.pbf
ls: cannot access target/map-matching-*-dependencies.jar: No such file or directory
[INFO] Scanning for projects...
Downloading: https://oss.sonatype.org/content/groups/public/org/sonatype/oss/oss-parent/9/oss-parent-9.pom
Downloading: http://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/9/oss-parent-9.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.graphhopper:map-matching:0.5-SNAPSHOT (/home/isg/Desktop/map-matching/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not transfer artifact org.sonatype.oss:oss-parent:pom:9 from/to sonatype-oss-public (https://oss.sonatype.org/content/groups/public/): oss.sonatype.org: No address associated with hostname and 'parent.relativePath' points at no local POM @ line 17, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Error: Unable to access jarfile action=import

Maven and Java are installed.
The output of echo $JAVA_HOME is the following: /usr/lib/jvm/java-7-openjdk-amd64/jre

Can you help me ?

Thanks,

Error: Unable to access jarfile action=import

When I am trying to import a file I get the following error:

ls: target/map-matching-*-dependencies.jar: No such file or directory
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building GraphHopper Map Matching 0.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ map-matching ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ map-matching ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ map-matching ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /Users/ustroetz/projects/map-matching/target/classes
[WARNING] /Users/ustroetz/projects/map-matching/src/main/java/com/graphhopper/matching/MapMatching.java: /Users/ustroetz/projects/map-matching/src/main/java/com/graphhopper/matching/MapMatching.java uses unchecked or unsafe operations.
[WARNING] /Users/ustroetz/projects/map-matching/src/main/java/com/graphhopper/matching/MapMatching.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ map-matching ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ map-matching ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/ustroetz/projects/map-matching/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ map-matching ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.5:jar (default-jar) @ map-matching ---
[INFO] Building jar: /Users/ustroetz/projects/map-matching/target/map-matching-0.5-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ map-matching ---
[INFO] Installing /Users/ustroetz/projects/map-matching/target/map-matching-0.5-SNAPSHOT.jar to /Users/ustroetz/.m2/repository/com/graphhopper/map-matching/0.5-SNAPSHOT/map-matching-0.5-SNAPSHOT.jar
[INFO] Installing /Users/ustroetz/projects/map-matching/pom.xml to /Users/ustroetz/.m2/repository/com/graphhopper/map-matching/0.5-SNAPSHOT/map-matching-0.5-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-assembly-plugin:2.5.3:single (default-cli) @ map-matching ---
[INFO] Building jar: /Users/ustroetz/projects/map-matching/target/map-matching-0.5-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.583 s
[INFO] Finished at: 2015-03-11T11:02:43+01:00
[INFO] Final Memory: 28M/207M
[INFO] ------------------------------------------------------------------------
Error: Unable to access jarfile action=import

The steps I did are the following:

git clone https://github.com/graphhopper/map-matching.git
cd map-matching/
wget https://s3.amazonaws.com/metro-extracts.mapzen.com/santiago_chile.osm.pbf
./map-matching.sh action=import datasource=santiago_chile.osm.pbf [vehicle=car]

The target folder lists the following:

$ ll target/
total 10104
drwxr-xr-x  2 ustroetz  staff       68 Mar 11 11:02 archive-tmp
drwxr-xr-x  4 ustroetz  staff      136 Mar 11 11:02 classes
drwxr-xr-x  3 ustroetz  staff      102 Mar 11 11:02 generated-sources
drwxr-xr-x  3 ustroetz  staff      102 Mar 11 11:02 generated-test-sources
-rw-r--r--  1 ustroetz  staff  5133695 Mar 11 11:02 map-matching-0.5-SNAPSHOT-jar-with-dependencies.jar
-rw-r--r--  1 ustroetz  staff    34353 Mar 11 11:02 map-matching-0.5-SNAPSHOT.jar
drwxr-xr-x  3 ustroetz  staff      102 Mar 11 11:02 maven-archiver
drwxr-xr-x  3 ustroetz  staff      102 Mar 11 11:02 maven-status
drwxr-xr-x  9 ustroetz  staff      306 Mar 11 11:02 test-classes

extended_json & GeoJson

Hi ,
when i use extanded_json as output with webServer, MapMatching create invalid GeoJson Object with only one point in LineString.

could you confirm this is an issue ?

{ "geometry": "{\"coordinates\":[[3.89894,43.609859]],\"type\":\"LineString\"}", "id": 78938, "wpts": [] }, { "geometry": "{\"coordinates\":[[3.898914,43.609945]],\"type\":\"LineString\"}", "id": 471587, "wpts": [] }, { "geometry": "{\"coordinates\":[[3.898889,43.61003],[3.898851,43.610155],[3.898824,43.610272]],\"type\":\"LineString\"}", "id": 471588, "wpts": [] }

Problem with file .\track-data\*.gpx Error: Cannot find matching path! Wrong vehicle car or missing OpenStreetMap data? Try to increase maxSearchMultiplier

Hello,

I installed the map-matching some days ago and i'm trying to run it on different GPX files of GPS bike data. Some of them work and i get good results some others don't and i'm getting the following error:
"Problem with file .\track-data*.gpx Error: Cannot find matching path! Wrong vehicle car or missing OpenStreetMap data? Try to increase maxSearchMultiplier=100.0"

Even though i set my vehicle to be a bike.
I tried to set the maxSearchMultiplier to 100.0 and it didn't work.
I don't know whats wrong and i couldn't debug the whole algorithm.

Is there any restrictions on the GPX files? Am i missing something here?

Thanks for your help.

Arguments not parsed

When running this the arguments given to main don't get parsed.

When running ./map-matching.sh action=import datasource=file.pbf
the arguments passed to CmdArgs.read are ["action=import datasource=file.pbf"] and not ["action=import", "datasource=file.pbf"]. Consequently when getting the action it gets "import datasource=file.pbf" and it's empty for the datasource.

I've made a small adjustment to run it locally, if it's an issue I can make a PR, but not sure if it's just me.

Anyway, I'm running on OSX El Capitain, and I'm using zsh

java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

Running this in a docker container (maven:3.3.3-jdk-8), with bash and without the changes, also causes this problem.

Thank you

Possible problem with a less frequent GPX signal

In the case if the GPX signal is not that frequent and the edge of one point P is rather short, this will reduce the impact of the weighting of the taken route through P and therefor could go another route without P.

One solution could be to insert artificial GPX points before and after P to reduce other edges close to P as well and increase probability that the routing engine uses a route through P.

Improve matching for oneways

I'm trying to map match the following route - it is a series of lat-lon-time triplets taken at 1 Hz.
screen shot 2015-07-01 at 11 41 11 am

After I put them through graphhopper's mapmatching software, I get the following output:
screen shot 2015-07-01 at 11 41 12 am
As you can see, there are a bunch of points on the right that are returned by graphhopper that are not in the route that was inputted. What I believe happened was a trip was detected to occur on the opposite end of the street, so graphhopper returned the closest shortest way to get from one side of the street to the other, hence the extra points. Is there anything I can do to reformat the data I input so this does not occur, otherwise what can I do to detect when this occurs (other than looking at its output)?

I'm also running into a problem with another route. The route I'm using looks like this:
screen shot 2015-07-01 at 11 41 07 am

The points that I am getting back look like this:
screen shot 2015-07-01 at 11 41 09 am
I double checked the order in which points were inputted in my route - the first point is on the bottom left and continue on to the top right as they are inputted. The result that graphhopper is returning starts at the end of my trip (top right), and ends on the bottom left. I'm not sure why this is happening and I've tried reversing the input of my data and am getting the same result. Does anyone know why this is happening?

Improve results if GPX contains loop

  • forceRepair currently is limited. Instead of checking for edge duplicates we should check for missing GPX matches
  • we need a proper loop detection and then
  • recursively detect loops and insert them
  • Or instead of this loop insert algorithm I can think of a guided routing algorithm with a steadily changing goal. (could time dependent weights solve this?)

support CH for matching

Currently it is based on none-CH routing giving us several advantages. We should try CH and see if it is faster.

findNClosest fails for large measurementErrorSigma

Just something I noticed while trying to understand findNClosest (as I'll be refactoring it for another use) - it won't find all matches if measurementErrorSigma is too large. That is, it will at most only ever find all matches within +- deltaLat/deltaLon.

Not sure if this is intended behaviour or an actual bug. If it is a bug, I think it should be a simple fix to replace

for (int iteration = 0; iteration < 2; iteration++) {
    // should we use the return value of earlyFinish?
    index.findNetworkEntries(queryLat, queryLon, set, iteration);

with

while (!index.findNetworkEntries(queryLat, queryLon, set, iteration))

(from here).

Mapping sidewalk

I am working on a project to infer the sidewalk from the GPX traces that are collected while the person is walking. The map-matching algorithm works perfectly to map the GPS points to the road, but is there any way i can infer which side of the road the user is walking. This would enable me to tag where the sidewalk is available on the street (i.e., right/left side of the road). I would appreciate, if you can could throw some pointers on how to achieve this with the graph hopper based map-matcher.

maxSearchMultiplier is too error prone

maxSearchMultiplier is too error prone we need e.g. to solve this via a more generic maxVisitedNodes. Increasing maxSearchMultiplier to high values does fix the problem but hurts performance

Attach turn instructions to the GPX result

Use MatchResult.edgeMatches to fill MatchResult.instructions identical to what we do in Path.calcInstructions.

This needs some changes in the core (moving submethod of Path.calcInstructions into public method of e.g. InstructionList.create?).

Wrong match

What is the reason for this match? Is there a way for me as a user to improve the input?
Is it possible that the map matching algorithm respects bearing?

green line = matched track
points = input track
grey lines = OSM highways

screen shot 2015-02-18 at 13 12 15
screen shot 2015-02-18 at 13 12 05

Bus tracking

The matcher seems to assume that cars will obey traffic rules, for example by not taking shortcuts through roads that only allow buses. Example with bus only exit marked with red "B":

bus_route

But what if the vehicle that we're trying to track is a bus? Any chance of implementing a vehicle option for buses?

Slicing the GPX leads to orientation errors

With most GPX trails I tested map-matching with, I'm getting orientation errors with most separatedSearchDistance values, except when I set separatedSearchDistance to very high values so that the trail will be sliced only very few times or not at all.

The tests were done with GPX files where there is a GPS point every one second or every two seconds.

As far as I can see, the problem seems to occur when by chance, the start of a new slice of the GPX file is where the current GPS point is closer to a street that leads away from the actual street driven than to that street itself.

If required, I can provide GPX files showing the issue, but I'll do so only directly to you, not via publicly visible means.

Failue in case that the very last two points of a track have exactly the same location

One of my tracks contains two exactly same located waypoints at the very end of the track. In this case the algortihm fails. I have made a test and a hack solution which solves this case, see

992998d

This hack solves the problem I had. I didn't test if two consecutive nodes at an arbitrary location somewhere in between the first and the last waypoint of a track would be also a problem and if the change would work in such a case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.