Skip to content
This repository was archived by the owner on Mar 1, 2021. It is now read-only.
This repository was archived by the owner on Mar 1, 2021. It is now read-only.

Wrong match #13

Closed
Closed

Description

@ustroetz

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

Activity

  1. karussell commented on Feb 18, 2015

    @karussell
    Member

    If you change the separatedSearchDistance (to a higher value or something) is this fixed?

  2. ustroetz commented on Feb 18, 2015

    @ustroetz
    ContributorAuthor

    No this did not fix it.

    The GPX file I try to match is the below. I try to match it to the Istanbul Metro Extract.

    <?xml version="1.0" encoding="UTF-8"?>
    <gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" 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="41.0119089" lon="29.08910865">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0118916" lon="29.0892053">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0118725" lon="29.08929845">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01185135" lon="29.08939115">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0118263" lon="29.0894814">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0117989" lon="29.08956945">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0117678" lon="29.08965675">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0117371" lon="29.089747">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0117079" lon="29.08983775">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01167605" lon="29.08992865">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01164325" lon="29.09002255">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.011612" lon="29.0901183">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0115803" lon="29.0902159">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01154605" lon="29.09031725">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01151005" lon="29.09042">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01147355" lon="29.09052405">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01143775" lon="29.0906194">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0114005" lon="29.09071235">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0113635" lon="29.0908039">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01132835" lon="29.0908926">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0112937" lon="29.09098185">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0112593" lon="29.09107005">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0112247" lon="29.0911578">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0111918" lon="29.09124565">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0111619" lon="29.0913338">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.011134" lon="29.0914224">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0111091" lon="29.09151445">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.0110886" lon="29.09160745">
    <time>2015-01-01T11:35:02Z</time></trkpt>
    <trkpt lat="41.01107275" lon="29.09170405">
    <time>2015-01-01T11:35:02Z</time></trkpt></trkseg></trk></gpx>
    
  3. karussell commented on Feb 18, 2015

    @karussell
    Member

    Hmmh, I'll have a look in the next days

  4. ustroetz commented on Feb 18, 2015

    @ustroetz
    ContributorAuthor

    Thanks!

  5. karussell commented on Feb 27, 2015

    @karussell
    Member

    Hmmh, I cannot reproduce this with a car profile. Which profile did you use?

  6. ustroetz commented on Feb 27, 2015

    @ustroetz
    ContributorAuthor

    Where can I set the profile? I guess I used the default profile.

  7. karussell commented on Feb 27, 2015

    @karussell
    Member

    Hmmh, okay, the default was 'car'. (There is a new command line option 'vehicle=car', the old would have been too hidden via a config.properties)

  8. ustroetz commented on Feb 27, 2015

    @ustroetz
    ContributorAuthor

    I'll give it a try again on Monday with the latest build and let you know my results.

    Also we should add this parameter to the readme.

    On Feb 27, 2015, at 9:21 PM, Peter [email protected] wrote:

    Hmmh, okay, the default was 'car'. (There is a new command line option 'vehicle=car', the old would have been too hidden via a config.properties)

    —
    Reply to this email directly or view it on GitHub.

  9. karussell commented on Feb 27, 2015

    @karussell
    Member

    Its already there ;)

  10. ustroetz commented on Mar 2, 2015

    @ustroetz
    ContributorAuthor

    Hm, after cloning the latest build I get the following error:

    $ ./map-matching.sh action=match gpx=test.gpx
    Exception in thread "main" java.lang.NullPointerException
        at com.graphhopper.GraphHopper.getFirstVehicle(GraphHopper.java:128)
        at com.graphhopper.GraphHopper.init(GraphHopper.java:602)
        at com.graphhopper.matching.MapMatchingMain.start(MapMatchingMain.java:56)
        at com.graphhopper.matching.MapMatchingMain.main(MapMatchingMain.java:39)
    
  11. karussell commented on Mar 2, 2015

    @karussell
    Member

    That is a GraphHopper issue. I'll fix.

  12. karussell commented on Mar 2, 2015

    @karussell
    Member

    Would you update the graphhopper and map-matching repo?

  13. ustroetz commented on Mar 2, 2015

    @ustroetz
    ContributorAuthor

    I have the latest map-matching repo. Though I am not using the graphhopper repo. It least I am not aware of it.

  14. karussell commented on Mar 2, 2015

    @karussell
    Member

    Okay. Then you fetch graphhopper this via the snapshot repo. (which is currently rebuild only every 8 hours or so). You'll have to get it and install it or what 2 hours (will be build at 11 German time again I think)

  15. 2 remaining items

  16. ustroetz commented on Mar 2, 2015

    @ustroetz
    ContributorAuthor

    Still get the same error. Probable because I have the wron GrapHopper version. It says:

    2015-03-02 13:32:43,830 [main] INFO  com.graphhopper.GraphHopper - version 0.4|2015-02-27T17:00:27+0000 (4,11,3,2,2)
    

    Where can I set which GrapHopper it should use/fetch?

  17. karussell commented on Mar 2, 2015

    @karussell
    Member

    you clone the GraphHopper repo and install it locally: mvn clean install -DskipTests=true (this will copy a jar into ~/.m2/repository/...)

  18. ustroetz commented on Mar 2, 2015

    @ustroetz
    ContributorAuthor

    Okay, got it to work. However still matches like before. I used the car profile.
    Here the full log:

    ulrichs-mbp:map-matching ustroetz$ ./map-matching.sh action=import datasource=istanbul_turkey.osm.pbf [vehicle=car]
    [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building GraphHopper Map Matching 0.4-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [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.4:jar (default-jar) @ map-matching ---
    [INFO] Building jar: /Users/ustroetz/projects/map-matching/target/map-matching-0.4-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.4-SNAPSHOT.jar to /Users/ustroetz/.m2/repository/com/graphhopper/map-matching/0.4-SNAPSHOT/map-matching-0.4-SNAPSHOT.jar
    [INFO] Installing /Users/ustroetz/projects/map-matching/pom.xml to /Users/ustroetz/.m2/repository/com/graphhopper/map-matching/0.4-SNAPSHOT/map-matching-0.4-SNAPSHOT.pom
    [INFO] 
    [INFO] --- maven-assembly-plugin:2.5.2:single (default-cli) @ map-matching ---
    [INFO] Building jar: /Users/ustroetz/projects/map-matching/target/map-matching-0.4-SNAPSHOT-jar-with-dependencies.jar
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.501 s
    [INFO] Finished at: 2015-03-02T13:55:35+01:00
    [INFO] Final Memory: 27M/212M
    [INFO] ------------------------------------------------------------------------
    2015-03-02 13:55:35,876 [main] INFO  com.graphhopper.GraphHopper - version 0.4|2015-03-02T12:51:04+0000 (4,11,3,2,2)
    2015-03-02 13:55:35,891 [main] INFO  com.graphhopper.GraphHopper - graph GraphHopperStorage|car|RAM_STORE|2D|NoExt|,,,,, details:edges:0(0), nodes:0(0), name: /(0), geo:0(0), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308
    2015-03-02 13:55:35,906 [main] INFO  com.graphhopper.GraphHopper - start creating graph from istanbul_turkey.osm.pbf
    2015-03-02 13:55:35,907 [main] INFO  com.graphhopper.GraphHopper - using GraphHopperStorage|car|RAM_STORE|2D|NoExt|,,,,, memory:totalMB:123, usedMB:10
    2015-03-02 13:55:36,988 [main] INFO  com.graphhopper.reader.OSMReader - creating graph. Found nodes (pillar+tower):583 959, totalMB:221, usedMB:148
    2015-03-02 13:55:37,629 [main] INFO  com.graphhopper.reader.OSMReader - 824 781, now parsing ways
    2015-03-02 13:55:39,722 [main] INFO  com.graphhopper.reader.OSMReader - 960 167, now parsing relations
    2015-03-02 13:55:39,725 [main] INFO  com.graphhopper.reader.OSMReader - finished way processing. nodes: 199503, osmIdMap.size:584047, osmIdMap:8MB, nodeFlagsMap.size:88, relFlagsMap.size:0 totalMB:500, usedMB:186
    2015-03-02 13:55:39,726 [main] INFO  com.graphhopper.reader.OSMReader - time(pass1): 1 pass2: 2 total:3
    2015-03-02 13:55:39,731 [main] INFO  com.graphhopper.GraphHopper - start finding subnetworks, totalMB:500, usedMB:186
    2015-03-02 13:55:39,920 [main] INFO  com.graphhopper.routing.util.PrepareRoutingSubnetworks - optimize to remove subnetworks (311), zero-degree-nodes (0), unvisited-dead-end-nodes(-1), maxEdges/node (8)
    2015-03-02 13:55:40,192 [main] INFO  com.graphhopper.GraphHopper - edges: 293559, nodes 197990, there were 311 subnetworks. removed them => 1513 less nodes. Remaining subnetworks:2
    2015-03-02 13:55:40,192 [main] INFO  com.graphhopper.GraphHopper - optimizing ... (totalMB:500, usedMB:192)
    2015-03-02 13:55:40,192 [main] INFO  com.graphhopper.GraphHopper - finished optimize (totalMB:500, usedMB:192)
    2015-03-02 13:55:40,617 [main] INFO  com.graphhopper.storage.index.LocationIndexTree - location index created in 0.4226492s, size:233 894, leafs:18 680, precision:300, depth:4, entries:[64, 64, 4, 4], entriesPerLeaf:12.521092
    2015-03-02 13:55:40,620 [main] INFO  com.graphhopper.GraphHopper - flushing graph GraphHopperStorage|car|RAM_STORE|2D|NoExt|4,11,3,2,2, details:edges:293 559(9), nodes:197 990(3), name: /(1), geo:825 092(4), bounds:28.313012122653696,29.67797695870646,40.73816945563635,41.42083040820428, totalMB:500, usedMB:261)
    ulrichs-mbp:map-matching ustroetz$ ./map-matching.sh action=match gpx=test.gpx 
    2015-03-02 13:56:04,607 [main] INFO  com.graphhopper.matching.MapMatchingMain - loading graph from cache
    2015-03-02 13:56:04,693 [main] INFO  com.graphhopper.matching.MapMatchingMain - Setup lookup index. Accuracy filter is at 15m
    2015-03-02 13:56:04,696 [main] INFO  com.graphhopper.matching.MapMatchingMain - Now processing 1 files
    test.gpx
        matches:    7, gps entries:29
        gpx length: 237.48259 vs 262.51987
        gpx time:   0.0 vs 29.699
        export results to:/Users/ustroetz/projects/map-matching/test.gpx.res.gpx
    gps import took:0.019526549s, match took: 0.12543204
    ulrichs-mbp:map-matching ustroetz$ ./map-matching.sh action=import datasource=istanbul_turkey.osm.pbf [vehicle=car]
    
  19. karussell commented on Mar 3, 2015

    @karussell
    Member

    Can you create an integration or even better unit test for it? Maybe we use different PBF files

  20. ustroetz commented on Mar 3, 2015

    @ustroetz
    ContributorAuthor
  21. ustroetz commented on Mar 4, 2015

    @ustroetz
    ContributorAuthor

    I can't find anything in the documentation about integration or unit tests. Maybe you can reference me to documents on how to do that. Else we can also leave this issue for now.

  22. karussell commented on Mar 4, 2015

    @karussell
    Member

    No problem, an example of a unit test you can find in the source. I tried it with the pbf file you mentioned and can now reproduce it. Will investigate.

  23. karussell commented on Mar 4, 2015

    @karussell
    Member

    The reason is that the highway (Yunus Emre) is slightly better for the path finding algorithm (e.g. 60kph vs. 30kph). Still here the shorter street should be significantly preferred as there are many GPX points which are also close. This will be fixed.

  24. karussell commented on Mar 4, 2015

    @karussell
    Member

    (There was a mechanism to prefer edges with many GPX points before but due to other problems I removed it at that time. Will investigate it next week.)

  25. ustroetz commented on Mar 4, 2015

    @ustroetz
    ContributorAuthor

    👍 Sounds great!

  26. added this to the 0.8 milestone on Jul 26, 2016
  27. added a commit that references this issue on Oct 10, 2016
    5c5969d
  28. karussell commented on Oct 12, 2016

    @karussell
    Member
  29. added a commit that references this issue on Oct 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions