Bridges-C++  3.4.2
Bridges(C++ API)
Public Member Functions | Static Public Member Functions | List of all members
bridges::dataset::OSMData Class Reference

#include <OSMData.h>

Detailed Description

Class that hold Open Street Map Data.

Class that holds Open Street Map data, from https://openstreetmap.org

Objects from this class are typically not created by the user but retruned by bridges::DataSource::getOSMData()

See also
Check out how to use OSM data at: https://bridgesuncc.github.io/tutorials/Data_OSM.html
Author
Erik Saule, Kalpathi Subramanian
Date
2/16/19, 12/28/20

Public Member Functions

void setLatLongRange (double *lat_range, double *longit_range)
 set the latitude and longitude range of the dataset More...
 
void setLatLongRange (double lat_min, double lat_max, double long_min, double long_max)
 set the range of the dataset More...
 
void getGraph (GraphAdjList< int, OSMVertex, double > *gr) const
 
 OSMData ()
 
const string & getName () const
 get the name of the dataset More...
 
void setName (const string &n)
 change the name of the dataset More...
 
void getLatLongRange (double *lat_range, double *longit_range) const
 
void getCartesianCoordsRange (double *xrange, double *yrange) const
 get the range of dataset in Cartesian coords More...
 
const vector< OSMVertex > & getVertices () const
 
void setVertices (const vector< OSMVertex > &verts)
 replace the vertices stored by this new set. More...
 
const vector< OSMEdge > & getEdges () const
 get edges. More...
 
void setEdges (const vector< OSMEdge > &e)
 set edges More...
 

Static Public Member Functions

static void toCartesianCoords (double lat, double longit, double *coords)
 

Constructor & Destructor Documentation

◆ OSMData()

bridges::dataset::OSMData::OSMData ( )
inline

Member Function Documentation

◆ getCartesianCoordsRange()

void bridges::dataset::OSMData::getCartesianCoordsRange ( double *  xrange,
double *  yrange 
) const
inline

get the range of dataset in Cartesian coords

Parameters
[out]xrange(array of 2 for min and max)
[out]yrange(array of 2 for min and max)

◆ getEdges()

const vector<OSMEdge>& bridges::dataset::OSMData::getEdges ( ) const
inline

get edges.

Typically the roads

Returns
edges (std::vector)

◆ getGraph()

void bridges::dataset::OSMData::getGraph ( GraphAdjList< int, OSMVertex, double > *  gr) const
inline

Construct a graph out of the vertex and edge data of the OSM object. The graph will associate the length of the edge to the graph edge. No data is bound to the vertices.

The vertices of the graph will be located at the location given in the data set converted to cartesian coordinate.

Parameters
[out]grconstructed graph from the OSM data

◆ getLatLongRange()

void bridges::dataset::OSMData::getLatLongRange ( double *  lat_range,
double *  longit_range 
) const
inline

get the Latitude and Longitude range of the dataset

Parameters
[out]lat_rangelatitude range
[out]longit_rangelongitude range

◆ getName()

const string& bridges::dataset::OSMData::getName ( ) const
inline

get the name of the dataset

Returns
name of the dataset

◆ getVertices()

const vector<OSMVertex>& bridges::dataset::OSMData::getVertices ( ) const
inline

get vertices

Returns
vertices (std::vector)

◆ setEdges()

void bridges::dataset::OSMData::setEdges ( const vector< OSMEdge > &  e)
inline

set edges

There is an assumption that the edges set have corresponding vertices.

Parameters
ea vector of OSMEdge to set

◆ setLatLongRange() [1/2]

void bridges::dataset::OSMData::setLatLongRange ( double *  lat_range,
double *  longit_range 
)
inline

set the latitude and longitude range of the dataset

Parameters
[in]lat_range(array of 2 for min and max)
[in]longit_range(array of 2 for min and max)

◆ setLatLongRange() [2/2]

void bridges::dataset::OSMData::setLatLongRange ( double  lat_min,
double  lat_max,
double  long_min,
double  long_max 
)
inline

set the range of the dataset

Parameters
lat_min,long_minlower left corner
lat_max,long_maxupper right corner

◆ setName()

void bridges::dataset::OSMData::setName ( const string &  n)
inline

change the name of the dataset

Parameters
nname of the data set

◆ setVertices()

void bridges::dataset::OSMData::setVertices ( const vector< OSMVertex > &  verts)
inline

replace the vertices stored by this new set.

This will adjust the lat/long range to the tightest box around the vertices

Parameters
vertsa vector of OSMVertex to set.

◆ toCartesianCoords()

static void bridges::dataset::OSMData::toCartesianCoords ( double  lat,
double  longit,
double *  coords 
)
inlinestatic

convert lat/long coords to Cartesian

Parameters
[in]latlatitude
[in]longitlongitude
[out]coordscomputed cartesian coords

The documentation for this class was generated from the following file: