Coder Social home page Coder Social logo

Wrong match about map-matching HOT 27 CLOSED

graphhopper avatar graphhopper commented on May 22, 2024
Wrong match

from map-matching.

Comments (27)

karussell avatar karussell commented on May 22, 2024 1

Merged branch with a fix https://github.com/graphhopper/map-matching/compare/issue_13

from map-matching.

karussell avatar karussell commented on May 22, 2024

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

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

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>

from map-matching.

karussell avatar karussell commented on May 22, 2024

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

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

Thanks!

from map-matching.

karussell avatar karussell commented on May 22, 2024

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

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

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

from map-matching.

karussell avatar karussell commented on May 22, 2024

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)

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

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.

from map-matching.

karussell avatar karussell commented on May 22, 2024

Its already there ;)

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

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)

from map-matching.

karussell avatar karussell commented on May 22, 2024

That is a GraphHopper issue. I'll fix.

from map-matching.

karussell avatar karussell commented on May 22, 2024

Would you update the graphhopper and map-matching repo?

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

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

from map-matching.

karussell avatar karussell commented on May 22, 2024

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)

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

I'll wait and let you know what it does after lunch. Thanks for your help meanwhile!

from map-matching.

karussell avatar karussell commented on May 22, 2024

From this snapshot repo it'll get the version (BTW: it is 12:00 not 11)

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

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?

from map-matching.

karussell avatar karussell commented on May 22, 2024

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

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

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]

from map-matching.

karussell avatar karussell commented on May 22, 2024

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

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

I am using this PBF file: https://s3.amazonaws.com/metro-extracts.mapzen.com/istanbul_turkey.osm.pbf

I will look into integration or unit test tomorrow morning.

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

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.

from map-matching.

karussell avatar karussell commented on May 22, 2024

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.

from map-matching.

karussell avatar karussell commented on May 22, 2024

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.

from map-matching.

karussell avatar karussell commented on May 22, 2024

(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.)

from map-matching.

ustroetz avatar ustroetz commented on May 22, 2024

👍 Sounds great!

from map-matching.

Related Issues (20)

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.