GISCup 2015
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Public Attributes | List of all members
NewShapeCollection Class Reference

#include <giscup.hpp>

Public Member Functions

void addPolygonalObstacle (polycollection::value_type &in)
 addPolygonalObstacle
void getMBR (double &l, double &r, double &b, double &t)
 getMBR returns the bounding box of the junctinos
void fillSpatialIndizes ()
 fillSpatialIndizes()
size_t nearestJunction (double x, double y)
 nearestJunction returns the index of the nearest junction given coordinates
std::vector< size_t > nearestRoads (double x, double y, size_t k)
 nearestRoads returns the index of the k nearest road points
void LoadFiles (std::string roadfile, std::string junctionfile)
 LoadFiles loads road and node from file names.
void LoadDirectory (std::string filebase)
 LoadDirectory loads road and node files from a directory assuming default names.
void LoadRestrictions (std::string fname)
 LoadRestrictions.

Public Attributes

polycollection roads
 The road geometry as an STL vector.
newroadattribcollection aroads
 The junction attributes.
bgi::rtree< value, bgi::rstar< 16, 4 > > roads_rtree
 An R* tree indexing roads.
polycollection junctions
 The junction geometry as an STL vector.
newnodeattribcollection ajunctions
 The junction attributes.
bgi::rtree< value, bgi::rstar< 16, 4 > > junction_rtree
 An A* tree indexing junctions.
polycollection polygons
 The polygons from the constraint file, as STL vectors.
std::vector< polygonobstacles
 The polygons from the constraint file as boost::geometry polygons.

Member Function Documentation

void NewShapeCollection::addPolygonalObstacle ( polycollection::value_type &  in)
inline

addPolygonalObstacle

Adds a polygonal obstacle from the polycollection's valuetype (e.g., an STL vector<vector<double>> to a boost::geometry polygon (outer, the real polygon, counter-clockwise oriented, and pushes it to obstacles.

In short: converts SHAPE data polygon to boost::geometry objects.

void NewShapeCollection::fillSpatialIndizes ( )
inline

fillSpatialIndizes()

Takes all roads and junctions and fills the repspective R-trees. The roads are indexed as points, that is nearest point from any road is directly answered as nearest predicate on road R-tree resulting in the road index to which the point belongs. Note that this is not actually nearest on the road given as a linestring.

Junctions are points and therefore obviously indexed as points.

void NewShapeCollection::getMBR ( double &  l,
double &  r,
double &  b,
double &  t 
)
inline

getMBR returns the bounding box of the junctinos

This method returns the bounding rectangle of junctions into referenced parameters left, right, bottom and up. It is mainly used for OpenGL GUI zoomFit() functionality

void NewShapeCollection::LoadDirectory ( std::string  filebase)
inline

LoadDirectory loads road and node files from a directory assuming default names.

First, loads sfo_roads.* SHP and DBF file into roads and aroads, Second, loads sfo_nodes.* into junctions and ajunctions Finally, creates spatial indizes

void NewShapeCollection::LoadFiles ( std::string  roadfile,
std::string  junctionfile 
)
inline

LoadFiles loads road and node from file names.

First, loads given roads file (removing extension, if present) Second, loads given junctions file (removing extension, if present) Finally, creates spatial indizes

void NewShapeCollection::LoadRestrictions ( std::string  fname)
inline

LoadRestrictions.

Loads a file (extension is removed, if it was given) containing polygonal avoidance data and pushes these polygons using addPolygonalObstacles. Note that it clears polygons, the polygon set last read from a file. It does not remove polygons possibly contained in the obstacles geometry file. Therefore, several files can be loaded after each other. Polygons always contains the polygons from the file last loaded and obstacles contains all polygons that have been loaded or otherwise added to the document.

size_t NewShapeCollection::nearestJunction ( double  x,
double  y 
)
inline

nearestJunction returns the index of the nearest junction given coordinates

The nearest junction is calculated using Euclidean geometry. Mainly used to support mouse clicking in the GUI, therefore Euclidean geometry is what users expect. This method interrupts with SEGFAULT, if junction_rtree should be empty.

std::vector<size_t> NewShapeCollection::nearestRoads ( double  x,
double  y,
size_t  k 
)
inline

nearestRoads returns the index of the k nearest road points

This method interrupts with SEGFAULT, if roads_rtree should be empty.

Member Data Documentation

newnodeattribcollection NewShapeCollection::ajunctions

The junction attributes.

newroadattribcollection NewShapeCollection::aroads

The junction attributes.

bgi::rtree< value, bgi::rstar<16, 4> > NewShapeCollection::junction_rtree

An A* tree indexing junctions.

polycollection NewShapeCollection::junctions

The junction geometry as an STL vector.

std::vector<polygon> NewShapeCollection::obstacles

The polygons from the constraint file as boost::geometry polygons.

polycollection NewShapeCollection::polygons

The polygons from the constraint file, as STL vectors.

polycollection NewShapeCollection::roads

The road geometry as an STL vector.

bgi::rtree< value, bgi::rstar<16, 4> > NewShapeCollection::roads_rtree

An R* tree indexing roads.


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