Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Output #228

Closed
dyltricks opened this issue Dec 9, 2021 · 10 comments
Closed

Empty Output #228

dyltricks opened this issue Dec 9, 2021 · 10 comments

Comments

@dyltricks
Copy link

I have installed the FMM program according to the instructions on the wiki for both a Windows and Ubuntu computer. When running the examples during the wiki it appears that the program runs without error but the output in the Mr.txt is empty.

@ziXet
Copy link

ziXet commented Dec 10, 2021

Can you put your fmm command and arguments here?

@dyltricks
Copy link
Author

I have downloaded my network from the script found at https://github.com/cyang-kth/osm_mapmatching
I checked and it has two links for bidirectional streets with opposite nodes listed for the target and sources. I have a feeling that maybe its my gps data format?

GPS Format

For my GPS data I had GPS points in which I plotted in ArcGIS Pro and used point to line function to create a linestring. I then used the shapefile created as my GPS Trajectory.

FMM v Stmatch
I read that we should be using stmatch if we have a relatively large network, and additionally that stmatch doesn't need to be precombuted. Does this mean I don't need to run the following lines before trying to match:
ubodt_gen ubodt_config.xml
ubodt_gen --network ../data/edges.shp --output ubodt.txt --delta 3
stmatch stmatch_config.xml

For my GPS data I had GPS points in which I plotted in ArcGIS Pro and used point to line function to create a linestring. I then used the shapefile created as my GPS Trajectory.

Here is the lines of codes I have been using to run stmatch:
stmatch --network ./data/graph_shapefile/edges.shp --gps ./gps_linestring.shp -k 10 -r 4 -e 1 --output mr.txt --source u --target v --gps_id ID --network_id osmid --reverse_tolerance 1

Similarly when I use fmm it is the same.

Also when I try to do the examples from https://fmm-wiki.github.io/docs/tutorial/cpp.html I receive the same output, an unchanged and empty Mr.txt

@ziXet
Copy link

ziXet commented Dec 10, 2021

Can you paste the output of the program here?

@dyltricks
Copy link
Author

id;cpath;mgeom
0;;LINESTRING()

@ziXet
Copy link

ziXet commented Dec 10, 2021

This means that it could not match any trajectory. can you upload your gps_linestring.shp here? does it follow the same unit as your network?

@ziXet
Copy link

ziXet commented Dec 10, 2021

It would also help if you paste the logs (stdout) output of the stmatch.

@dyltricks
Copy link
Author

Here are my personal files from my project
fmm_provo_github.zip

Logs
From my project
[info][stmatch_app_config.cpp:48 ] Start reading stmatch configuration from arguments
[info][stmatch_app_config.cpp:77 ] Finish with reading stmatch arg configuration
[info][stmatch_app_config.cpp:81 ] ---- Print configuration ----
[info][network_config.cpp:6 ] NetworkConfig
[info][network_config.cpp:7 ] File name: ./graph_shapefile/edges.shp
[info][network_config.cpp:8 ] ID name: osmid
[info][network_config.cpp:9 ] Source name: u
[info][network_config.cpp:10 ] Target name: v
[info][gps_config.cpp:8 ] GPS format: GDAL trajectory
[info][gps_config.cpp:9 ] File name: ./gps_linestring.shp
[info][gps_config.cpp:10 ] ID name: ID
[info][gps_config.cpp:11 ] Timestamp name: timestamp
[info][result_config.cpp:34 ] ResultConfig
[info][result_config.cpp:35 ] File: mr.txt
[info][result_config.cpp:36 ] Fields: cpath mgeom
[info][stmatch_algorithm.cpp:25 ] STMATCHAlgorithmConfig
[info][stmatch_algorithm.cpp:26 ] k 10 radius 4 gps_error 1 vmax 30 factor 1.5
[info][stmatch_algorithm.cpp:28 ] reverse_tolerance 1
[info][stmatch_app_config.cpp:86 ] Log level 2-info
[info][stmatch_app_config.cpp:87 ] Step 100
[info][stmatch_app_config.cpp:88 ] Use omp false
[info][stmatch_app_config.cpp:89 ] ---- Print configuration done ----
[info][network.cpp:72 ] Read network from file ./graph_shapefile/edges.shp
[info][network.cpp:170] Number of edges 36886 nodes 13525
[info][network.cpp:171] Field index: id 0 source 14 target 15
[info][network.cpp:174] Read network done.
[info][network_graph.cpp:17 ] Construct graph from network edges start
[info][network_graph.cpp:30 ] Graph nodes 13525 edges 36886
[info][network_graph.cpp:31 ] Construct graph from network edges end
[info][gps_reader.cpp:337] GPS data in trajectory shapefile format
[info][gps_reader.cpp:45 ] Read trajectory from file ./gps_linestring.shp
[warning][gps_reader.cpp:69 ] Timestamp column timestamp not found
[info][gps_reader.cpp:81 ] Total number of trajectories 1
[info][gps_reader.cpp:82 ] Finish reading meta data
[info][stmatch_app.cpp:26 ] Progress report step 100
[info][stmatch_app.cpp:28 ] Start to match trajectories
[info][stmatch_app.cpp:57 ] Run map matching in single thread
[info][stmatch_app.cpp:60 ] Progress 0
[info][stmatch_app.cpp:74 ] MM process finished
[info][stmatch_app.cpp:78 ] Time takes 0.038
[info][stmatch_app.cpp:79 ] Time takes excluding input 0.037
[info][stmatch_app.cpp:80 ] Finish map match total points 8 matched 0
[info][stmatch_app.cpp:82 ] Matched percentage: 0
[info][stmatch_app.cpp:83 ] Point match speed: 0
[info][stmatch_app.cpp:84 ] Point match speed (excluding input): 0
[info][stmatch_app.cpp:86 ] Time takes 0.038

From the example
[info][stmatch_app_config.cpp:48 ] Start reading stmatch configuration from arguments
[info][stmatch_app_config.cpp:77 ] Finish with reading stmatch arg configuration
[info][stmatch_app_config.cpp:81 ] ---- Print configuration ----
[info][network_config.cpp:6 ] NetworkConfig
[info][network_config.cpp:7 ] File name: ../data/edges.shp
[info][network_config.cpp:8 ] ID name: id
[info][network_config.cpp:9 ] Source name: source
[info][network_config.cpp:10 ] Target name: target
[info][gps_config.cpp:8 ] GPS format: GDAL trajectory
[info][gps_config.cpp:9 ] File name: ../data/trips.shp
[info][gps_config.cpp:10 ] ID name: id
[info][gps_config.cpp:11 ] Timestamp name: timestamp
[info][result_config.cpp:34 ] ResultConfig
[info][result_config.cpp:35 ] File: mr.txt
[info][result_config.cpp:36 ] Fields: cpath mgeom
[info][stmatch_algorithm.cpp:25 ] STMATCHAlgorithmConfig
[info][stmatch_algorithm.cpp:26 ] k 4 radius 0.4 gps_error 0.5 vmax 30 factor 1.5
[info][stmatch_algorithm.cpp:28 ] reverse_tolerance 0
[info][stmatch_app_config.cpp:86 ] Log level 2-info
[info][stmatch_app_config.cpp:87 ] Step 100
[info][stmatch_app_config.cpp:88 ] Use omp false
[info][stmatch_app_config.cpp:89 ] ---- Print configuration done ----
[warning][result_config.cpp:221] Overwrite existing result file mr.txt
[info][network.cpp:72 ] Read network from file ../data/edges.shp
[info][network.cpp:170] Number of edges 30 nodes 17
[info][network.cpp:171] Field index: id 1 source 2 target 3
[info][network.cpp:174] Read network done.
[info][network_graph.cpp:17 ] Construct graph from network edges start
[info][network_graph.cpp:30 ] Graph nodes 17 edges 30
[info][network_graph.cpp:31 ] Construct graph from network edges end
[info][gps_reader.cpp:337] GPS data in trajectory shapefile format
[info][gps_reader.cpp:45 ] Read trajectory from file ../data/trips.shp
[warning][gps_reader.cpp:69 ] Timestamp column timestamp not found
[info][gps_reader.cpp:81 ] Total number of trajectories 3
[info][gps_reader.cpp:82 ] Finish reading meta data
[info][stmatch_app.cpp:26 ] Progress report step 100
[info][stmatch_app.cpp:28 ] Start to match trajectories
[info][stmatch_app.cpp:57 ] Run map matching in single thread
[info][stmatch_app.cpp:60 ] Progress 0
[info][stmatch_app.cpp:74 ] MM process finished
[info][stmatch_app.cpp:78 ] Time takes 0.001
[info][stmatch_app.cpp:79 ] Time takes excluding input 0
[info][stmatch_app.cpp:80 ] Finish map match total points 17 matched 17
[info][stmatch_app.cpp:82 ] Matched percentage: 1
[info][stmatch_app.cpp:83 ] Point match speed: 17000
[info][stmatch_app.cpp:84 ] Point match speed (excluding input): inf
[info][stmatch_app.cpp:86 ] Time takes 0.001

@ziXet
Copy link

ziXet commented Dec 10, 2021

Just took a look at your graph and the sample trajectory (linestring). It seems that they do not use the same unit.
your graph is in degree unit but your linestring is in different unit:

{
"type": "FeatureCollection",
"name": "test",
"features": [
{ "type": "Feature", "properties": { "Id": 0 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 443889.202200000174344, 4453920.761 ], [ 443792.801599999889731, 4453884.847799999639 ], [ 443680.154099999927, 4453837.9568 ], [ 443673.583499999716878, 4453641.532099999487 ], [ 443672.092199999839067, 4453441.73949999921 ], [ 443668.667500000447035, 4453210.880899999291 ], [ 443680.435200000181794, 4453077.5907 ], [ 443773.7401, 4453039.1543 ] ] ] } }
]
}

@dyltricks
Copy link
Author

Which exact units need to be the same?

Do the Coordinate Systems need to be the same or just the units of the geometry?

@dyltricks
Copy link
Author

Was able to change units and project points to map network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants