catatom2osm.hgwnames module

Parsing of highway names.

catatom2osm.hgwnames.dsmatch(name, dataset, fn)[source]

Fuzzy search best matching object for string name in dataset.

Parameters
  • name (str) – String to look for

  • dataset (list) – List of objects to search for

  • fn (function) – Function to obtain a string from a element of the dataset

Returns

First element with the maximun fuzzy ratio.

catatom2osm.hgwnames.match(name, choices)[source]

Fuzzy search best match for string name in iterable choices.

If the result is not good enough returns the name parsed.

Parameters
  • name (str) – String to look for

  • choices (list) – Iterable with choices

catatom2osm.hgwnames.normalize(text)[source]
catatom2osm.hgwnames.parse(name)[source]

Transform the name of a street from Cadastre conventions to OSM ones.