First of all, thanks for building a great open-source map-matching library!
I tried to run the built-in test cases and had to change few places in mapmatcher.py to make it run successfully. Without further investigation, I am not sure if these are due to my configuration/packages versions (PostgreSQL 9.6, pgRouting 2.4.1). So instead of doing a pull request, I will just list the issues I encountered below fyi.
ST_LineLocatePoint's 1st argument wrong type throwing "ERROR: line_locate_point: 1st arg isn't a line".
I replaced all "_STLineLocatePoint(%(streetGeomCol)s" with "_ST_LineLocatePoint(STLineMerge(%(streetGeomCol)s)", following this suggestion here: https://gis.stackexchange.com/a/95263.
there is one extra argument passed to pgr_dijkstra which throws type errors.
I changed it to:
cmd = '''SELECT array_agg(edge) AS edges FROM pgr_dijkstra(
'SELECT %(streetIdCol)s, %(source)s, %(target)s, %(cost)s, %(reverse_cost)s FROM %(streetsTable)s', %(oNode)s, %(dNode)s, True);
A rather minor issue with tests.py:
The expected uturnFrcs for _testtrace65.gpx case is slightly different (after 10 decimal places..) from what I got from the test run, which might due to the difference between latest OSM network and the version when the expected result is generated.
First of all, thanks for building a great open-source map-matching library!
I tried to run the built-in test cases and had to change few places in mapmatcher.py to make it run successfully. Without further investigation, I am not sure if these are due to my configuration/packages versions (PostgreSQL 9.6, pgRouting 2.4.1). So instead of doing a pull request, I will just list the issues I encountered below fyi.
ST_LineLocatePoint's 1st argument wrong type throwing "ERROR: line_locate_point: 1st arg isn't a line". I replaced all "_STLineLocatePoint(%(streetGeomCol)s" with "_ST_LineLocatePoint(STLineMerge(%(streetGeomCol)s)", following this suggestion here: https://gis.stackexchange.com/a/95263.
This code block may have two seperate issues: https://github.com/amillb/pgMapMatch/blob/d4dc9413ddf533ff76f6d8a7cd33e85f7404ec53/mapmatcher.py#L670-L672
id2 is undefined.
there is one extra argument passed to pgr_dijkstra which throws type errors.
I changed it to:
A rather minor issue with tests.py: The expected uturnFrcs for _testtrace65.gpx case is slightly different (after 10 decimal places..) from what I got from the test run, which might due to the difference between latest OSM network and the version when the expected result is generated.
https://github.com/amillb/pgMapMatch/blob/d4dc9413ddf533ff76f6d8a7cd33e85f7404ec53/tests.py#L45
'testtrace_36Uturns.gpx':[-1]*20+[(0.0341696793**913362**, 0.3423193020**70578**), -1, -1]
After three changes above, I can run the tests successfully.