Types

LightOSM.OSMGraphType

Container for storing OpenStreetMap node, way, relation and graph related obejcts.

Fields

U <: Integer,T <: Union{String, Int},W <: Real

  • nodes::Dict{T,Node{T}}: Mapping of node ids to node objects.
  • node_coordinates::Vector{Vector{W}}: Vector of node coordinates [[lat, lon]...], indexed by graph vertices.
  • ways::Dict{T,Way{T}}: Mapping of way ids to way objects. Previously called highways.
  • node_to_index::OrderedDict{T,U}: Mapping of node ids to graph vertices.
  • index_to_node::OrderedDict{U,T}: Mapping of graph vertices to node ids.
  • node_to_way::Dict{T,Vector{T}}: Mapping of node ids to vector of way ids. Previously called node_to_highway.
  • edge_to_way::Dict{Vector{T},T}: Mapping of edges (adjacent node pairs) to way ids. Previously called edge_to_highway.
  • restrictions::Dict{T,Restriction{T}}: Mapping of relation ids to restriction objects.
  • indexed_restrictions::Union{DefaultDict{U,Vector{MutableLinkedList{U}}},Nothing}: Mapping of via node ids to ordered sequences of restricted node ids.
  • graph::Union{AbstractGraph,Nothing}: Either DiGraph, StaticDiGraph, SimpleWeightedDiGraph or MetaDiGraph.
  • weights::Union{SparseMatrixCSC{W,U},Nothing}: Sparse adjacency matrix (weights between graph vertices), either :distance (km), :time (hours) or :lane_efficiency (time scaled by number of lanes).
  • dijkstra_states::Vector{Vector{U}}: Vector of dijkstra parent states indexed by source vertices, used to retrieve shortest path from source vertex to any other vertex.
  • kdtree::Union{KDTree,Nothing}: KDTree used to calculate nearest nodes.
  • kdtree::Union{RTree,Nothing}: R-tree used to calculate nearest nodes.
  • weight_type::Union{Symbol,Nothing}: Either :distance, :time or :lane_efficiency.
source
LightOSM.GeoLocationType

Representation of a geospatial coordinates.

Fields

  • lat::Float64: Latitude.
  • lon::Float64: Longitude.
  • alt::Float64: Altitude.

Constructors

GeoLocation(lat, lon)
GeoLocation(point::Vector{<:Real})
GeoLocation(point_vector::Vector{<:Vector{<:Real}})
GeoLocation(g::OSMGraph, ep::EdgePoint)
source
LightOSM.NodeType

OpenStreetMap node.

Fields

T<:String

  • id::T: OpenStreetMap node id.
  • nodes::Vector{T}: Node's GeoLocation.
  • tags::AbstractDict{String,Any}: Metadata tags.
source
LightOSM.WayType

OpenStreetMap way.

Fields

T<:Integer

  • id::T: OpenStreetMap way id.
  • nodes::Vector{T}: Ordered list of node ids making up the way.
  • tags::AbstractDict{String,Any}: Metadata tags.
source
LightOSM.RestrictionType

OpenStreetMap turn restriction (relation).

Fields

T<:String

  • id::T: OpenStreetMap relation id.
  • type::String: Either a via_way or via_node turn restriction.
  • tags::AbstractDict{String,Any}: Metadata tags.
  • from_way::T: Incoming way id to the turn restriction.
  • to_way::T: Outgoing way id to the turn restriction.
  • via_node::Union{T,Nothing}: Node id at the centre of the turn restriction.
  • via_way::Union{Vector{T},Nothing}: Way id at the centre of the turn restriction.
  • is_exclusion::Bool: Turn restrictions such as no_left_turn, no_right_turn or no_u_turn.
  • is_exclusive::Bool: Turn restrictions such as striaght_on_only, left_turn_only, right_turn_only.
source
LightOSM.BuildingType

OpenStreetMap building.

Fields

T<:String

  • id::T: OpenStreetMap building way id a simple polygon, relation id if a multi-polygon
  • is_relation::Bool: True if building is a a multi-polygon / relation.
  • polygons::Vector{Polygon{T}}: List of building polygons, first is always the outer ring.
  • tags::AbstractDict{String,Any}: Metadata tags.
source