<jupyter_start><jupyter_text>Demo of fmm Python API<jupyter_code>import sys
sys.path.append("/fmm/python/build/")
from fmm import Network,NetworkGraph,FastMapMatch,FastMapMatchConfig,UBODT<jupyter_output><empty_output><jupyter_text>Load data and model<jupyter_code>network = Network("../data/edges.shp")
print "Nodes {} edges {}".format(network.get_node_count(),network.get_edge_count())
graph = NetworkGraph(network)
# Load ubodt file
ubodt = UBODT.read_ubodt_csv("../data/ubodt.txt")
model = FastMapMatch(network,graph,ubodt)
### Trajectory in WKT
wkt = "LINESTRING(0.200812146892656 2.14088983050848,1.44262005649717 2.14879943502825,3.06408898305084 2.16066384180791,3.06408898305084 2.7103813559322,3.70872175141242 2.97930790960452,4.11606638418078 2.62337570621469)"<jupyter_output><empty_output><jupyter_text>Define FMM configuration<jupyter_code>k = 4
radius = 0.4
gps_error = 0.5
config = FastMapMatchConfig(k,radius,gps_error)<jupyter_output><empty_output><jupyter_text>Run map matching<jupyter_code>result = model.match_wkt(wkt,config)
print "Matched path: ", list(result.cpath)
print "Matched edge for each point: ", list(result.opath)
print "Matched edge index ",list(result.indices)
print "Matched geometry: ",result.mgeom.export_wkt()
print "Matched point ", result.pgeom.export_wkt()<jupyter_output>Matched path:  [8, 11, 13, 18, 20, 24]
Matched edge for each point:  [8, 11, 18, 18, 20, 24]
Matched edge index  [0, 1, 3, 3, 4, 5]
Matched geometry:  LINESTRING(0.200812 2,1 2,2 2,3 2,3 3,4 3,4 2.62338)
Matched point  LINESTRING(0.200812 2,1.44262 2,3 2.16066,3 2.71038,3.70872 3,4 2.62338)
{'fraction_non_alphanumeric': 0.13316739265712507, 'fraction_numerical': 0.1748599875544493, 'mean_word_length': 7.375, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '83307', 'license': 'Apache-2.0', 'n_tokens_mistral': 827, 'n_tokens_neox': 655, 'n_words': 121, 'path': 'example/notebook/fmm_example.ipynb', 'repo_name': 'aelissa/fmm', 'size': '1607'}