openlr_dereferencer.example_sqlite_map package

Submodules

openlr_dereferencer.example_sqlite_map.primitives module

Contains the Node and the Line class of the example format

exception openlr_dereferencer.example_sqlite_map.primitives.ExampleMapError[source]

Bases: Exception

Some error reading the DB

class openlr_dereferencer.example_sqlite_map.primitives.Line(map_reader, line_id: int)[source]

Bases: openlr_dereferencer.maps.abstract.Line

Line object implementation for the example format

distance_to(coord) → float[source]

Returns the distance of this line to coord in meters

end_node

Returns the node to which this line goes

fow

Returns the form of way for this line

frc

Returns the functional road class for this line

geometry

Returns the line geometry

length

Length of line in meters

line_id

Returns the line id

near_nodes(distance)[source]

Yields every point within a certain distance, in meters.

num_points() → int[source]

Returns how many points the path geometry contains

point_n(index) → openlr.locations.Coordinates[source]

Returns the n th point in the path geometry, starting at 0

start_node

Returns the node from which this line comes from

class openlr_dereferencer.example_sqlite_map.primitives.Node(map_reader, node_id: int)[source]

Bases: openlr_dereferencer.maps.abstract.Node

Node class implementation for example_sqlite_map

connected_lines() → Iterable[openlr_dereferencer.example_sqlite_map.primitives.Line][source]

Returns lines which touch this node

coordinates

Returns the lon, lat coordinates of this node

incoming_lines() → Iterable[openlr_dereferencer.example_sqlite_map.primitives.Line][source]

Yields all lines coming directly to this node.

node_id

Returns the id of this node.

outgoing_lines() → Iterable[openlr_dereferencer.example_sqlite_map.primitives.Line][source]

Yields all lines coming directly from this node

Module contents

The example map format described in map_format.md, conforming to the interface in openlr_dereferencer.maps

class openlr_dereferencer.example_sqlite_map.ExampleMapReader(map_db_file: str)[source]

Bases: openlr_dereferencer.maps.abstract.MapReader

This is a reader for the example map format described in map_format.md.

Create an instance with: ExampleMapReader(‘example.sqlite’).

find_lines_close_to(coord: openlr.locations.Coordinates, dist: float) → Iterable[openlr_dereferencer.example_sqlite_map.primitives.Line][source]

Yields all lines within dist meters around coord

find_nodes_close_to(coord: openlr.locations.Coordinates, dist: float) → Iterable[openlr_dereferencer.example_sqlite_map.primitives.Node][source]

Finds all nodes in a given radius, given in meters

Yields every node within this distance to coord.

get_line(line_id: int) → openlr_dereferencer.example_sqlite_map.primitives.Line[source]

Returns a line by its id

get_linecount() → int[source]

Returns the number of lines in the map.

get_lines() → Iterable[openlr_dereferencer.example_sqlite_map.primitives.Line][source]

Yields all lines in the map.

get_node(node_id: int) → openlr_dereferencer.example_sqlite_map.primitives.Node[source]

Returns a node by its id.

get_nodecount() → int[source]

Returns the number of nodes in the map.

get_nodes() → Iterable[openlr_dereferencer.example_sqlite_map.primitives.Node][source]

Yields all nodes contained in the map.