Ocean
Ocean::IO::Maps::Basemap Class Reference

This class implements an parser of basemap data. More...

Data Structures

class  Building
 This class implements a building object. More...
 
class  GeometryHandlerLinePolygons
 Geometry handler for polygons. More...
 
class  GeometryHandlerLineStrings
 Geometry handler for line strings. More...
 
class  GeometryHandlerPoints
 Geometry handler for points. More...
 
class  InnerOuterPolygonsObject
 This class implements an object composed of inner and outer polygons. More...
 
class  LandCover
 This class implements a land use object. More...
 
class  LandUse
 This class implements a land use object. More...
 
class  Object
 This class is the base class for all map objects. More...
 
class  Road
 This class implements a road object. More...
 
class  Tile
 This class stores the information belonging to one map tile. More...
 
class  TileIndexPair
 This class holds the tile indics in latitude and longitude direction. More...
 
class  Transit
 This class implements a transit object. More...
 
class  Water
 This class implements a water object. More...
 

Public Types

typedef CV::PixelPositionI PixelPositionI
 Definition of a location with signed pixel precision. More...
 
typedef CV::PixelPositionsI PixelPositionsI
 Definition of a vector holding locations with signed pixel precision. More...
 
typedef std::vector< PixelPositionsIPixelPositionGroupsI
 Definition of groups of pixel positions. More...
 
typedef std::shared_ptr< ObjectSharedObject
 Definition of a shared pointer holding an Object. More...
 
typedef std::vector< SharedObjectSharedObjects
 Definition of a vector holding shared objects. More...
 
typedef std::vector< TileIndexPairTileIndexPairs
 Definition of a vector holding tile index pairs. More...
 
typedef std::unordered_set< TileIndexPair, TileIndexPairTileIndexPairSet
 Definition of a set holding tile index pairs. More...
 
typedef std::shared_ptr< TileSharedTile
 Definition of a shared pointer holding a Tile. More...
 

Static Public Member Functions

static SharedTile newTileFromPBFData (const unsigned int level, const TileIndexPair &tileIndexPair, const void *data, const size_t size)
 Creates a new tile based on given PBF data. More...
 
static const std::string & styleUrl ()
 Returns the url for downloading the map style data. More...
 
static bool extractTileUrlTemplate (const char *styleData, const size_t styleSize, std::string &urlTemplate)
 Gets the url template for downloading a map tile. More...
 
static bool constructTileUrl (const std::string urlTemplate, const unsigned int level, const TileIndexPair &tileIndexPair, std::string &url)
 Constructs the url for downloading a map tile. More...
 

Protected Types

enum  LayerType : uint32_t {
  LT_UNKNOWN = 0u , LT_AIRPORT , LT_AREA_OF_INTEREST , LT_BATHYMETRY ,
  LT_BUILDING , LT_BUILDING_LABEL , LT_BORDER , LT_INDOOR ,
  LT_INDOOR_LABEL , LT_LAND_COVER , LT_LAND_USE , LT_LAND_USE_LABEL ,
  LT_LANDMARK_POINT , LT_NATURAL , LT_NATURAL_LABEL , LT_PARKING ,
  LT_PLACENAME , LT_PLACE_LABEL , LT_POI , LT_ROAD ,
  LT_TRANSIT , LT_TRANSIT_POINT , LT_TREE_POINT , LT_WATER ,
  LT_WATERWAY , LT_WATER_LABEL , LT_WATER_LINE , LT_WATER_OFFSET ,
  LT_WAVE , LT_END
}
 Definition of individual layer types. More...
 
typedef std::unordered_map< std::string, LayerTypeLayerTypeMap
 Definition of an unordered map mapping layer type strings to layer type values. More...
 

Static Protected Member Functions

static SharedObject parseBuilding (vtzero::feature &vtzeroFeature, PixelPositionGroupsI &&outerPolygons, PixelPositionGroupsI &&innerPolygons, PixelPositionGroupsI &&lineStrings, const unsigned int layerExtent)
 Parses a building feature. More...
 
static SharedObject parseRoad (vtzero::feature &vtzeroFeature, PixelPositionGroupsI &&lineStrings, const unsigned int layerExtent)
 Parses a road feature. More...
 
static SharedObject parseTransit (vtzero::feature &vtzeroFeature, PixelPositionGroupsI &&lineStrings, const unsigned int layerExtent)
 Parses a transit feature. More...
 
static SharedObject parseWater (vtzero::feature &vtzeroFeature, PixelPositionGroupsI &&outerPolygons, PixelPositionGroupsI &&innerPolygons, const unsigned int layerExtent)
 Parses a water feature. More...
 
static SharedObject parseLandUse (vtzero::feature &vtzeroFeature, PixelPositionGroupsI &&outerPolygons, PixelPositionGroupsI &&innerPolygons, PixelPositionGroupsI &&lineStrings, const unsigned int layerExtent)
 Parses a land use feature. More...
 
static SharedObject parseLandCover (vtzero::feature &vtzeroFeature, PixelPositionGroupsI &&outerPolygons, PixelPositionGroupsI &&innerPolygons, PixelPositionGroupsI &&lineStrings, const unsigned int layerExtent)
 Parses a land cover feature. More...
 
static bool numberFromPropertyValue (const vtzero::property_value &propertyValue, double &value)
 Returns the value of a property value as number. More...
 
static LayerType translateLayerName (const std::string &layerName)
 Translates the name of a layer to the corresponding layer type. More...
 

Static Protected Attributes

static constexpr double minLatitude = -85.05112878
 The minimal latitude angle, in degree. More...
 
static constexpr double maxLatitude = 85.05112878
 The maximal latitude angle, in degree. More...
 

Detailed Description

This class implements an parser of basemap data.

Member Typedef Documentation

◆ LayerTypeMap

typedef std::unordered_map<std::string, LayerType> Ocean::IO::Maps::Basemap::LayerTypeMap
protected

Definition of an unordered map mapping layer type strings to layer type values.

◆ PixelPositionGroupsI

Definition of groups of pixel positions.

◆ PixelPositionI

Definition of a location with signed pixel precision.

◆ PixelPositionsI

Definition of a vector holding locations with signed pixel precision.

◆ SharedObject

Definition of a shared pointer holding an Object.

◆ SharedObjects

Definition of a vector holding shared objects.

◆ SharedTile

typedef std::shared_ptr<Tile> Ocean::IO::Maps::Basemap::SharedTile

Definition of a shared pointer holding a Tile.

◆ TileIndexPairs

Definition of a vector holding tile index pairs.

◆ TileIndexPairSet

Definition of a set holding tile index pairs.

Member Enumeration Documentation

◆ LayerType

enum Ocean::IO::Maps::Basemap::LayerType : uint32_t
protected

Definition of individual layer types.

Enumerator
LT_UNKNOWN 

The layer type is unknown.

LT_AIRPORT 

The layer holds information about an airport (point, line, & polygon airport features).

LT_AREA_OF_INTEREST 

The layer holds areas of interest (polygonal areas of interest).

LT_BATHYMETRY 

The layer holds bathymetry information (depth polygons for oceans).

LT_BUILDING 

The layer holds buildings (polygonal structures).

LT_BUILDING_LABEL 

The layer holds labels of buildings (label point centroid for polygonal structures).

LT_BORDER 

The layer holds a border.

LT_INDOOR 

The layer is an indoor layer (floor plans for meta offices, malls, airports).

LT_INDOOR_LABEL 

The layer holds indoor label information (labels for indoor features).

LT_LAND_COVER 

The layer holds land cover information (polygons for physical land features).

LT_LAND_USE 

The layer holds land use information (mostly polygons for land usages).

LT_LAND_USE_LABEL 

The layer holds labels of land use (label point centroid for polygonal land usages).

LT_LANDMARK_POINT 

The layer holds landmark point information.

LT_NATURAL 

The layer holds natural areas.

LT_NATURAL_LABEL 

The layer holds labels of natural areas.

LT_PARKING 

The layer holds parking information (experimental parking layer, point & polygon).

LT_PLACENAME 

The layer holds labels of places (point features for cities, neighborhoods).

LT_PLACE_LABEL 

The layer holds place labels.

LT_POI 

The layer holds a point of interest.

LT_ROAD 

The layer holds road data (linear features for roads, sidewalks).

LT_TRANSIT 

The layer holds transit information (aerial, rail, ferry; linear features).

LT_TRANSIT_POINT 

The layer holds transit point information (aerial, rail, ferry stations).

LT_TREE_POINT 

The layer holds tree point information (point features for trees).

LT_WATER 

The layer holds water information (polygonal water features).

LT_WATERWAY 

The layer holds waterway information (linear water features).

LT_WATER_LABEL 

The layer holds water label information (label point centroid for polygonal water).

LT_WATER_LINE 

The layer holds water line information.

LT_WATER_OFFSET 

The layer holds water offset information (polygons used for creating a shadow effect on inland water features).

LT_WAVE 

The layer holds wave information (points used to show a wave icon over water).

LT_END 

Exclusive end value.

Member Function Documentation

◆ constructTileUrl()

static bool Ocean::IO::Maps::Basemap::constructTileUrl ( const std::string  urlTemplate,
const unsigned int  level,
const TileIndexPair tileIndexPair,
std::string &  url 
)
static

Constructs the url for downloading a map tile.

Parameters
urlTemplateThe url template, must be valid
levelThe detail level, with range [1, 22]
tileIndexPairThe tile index pair defining the location of the tile, with range [0, numberTiles(level) - 1]x[0, numberTiles(level) - 1]
urlThe resulting url
Returns
True, if succeeded

◆ extractTileUrlTemplate()

static bool Ocean::IO::Maps::Basemap::extractTileUrlTemplate ( const char *  styleData,
const size_t  styleSize,
std::string &  urlTemplate 
)
static

Gets the url template for downloading a map tile.

Parameters
styleDataThe style data, must be valid
styleSizeThe size of the style data buffer, in bytes, with range [1, infinity)
urlTemplateThe resulting url template
Returns
True, if succeeded

◆ newTileFromPBFData()

static SharedTile Ocean::IO::Maps::Basemap::newTileFromPBFData ( const unsigned int  level,
const TileIndexPair tileIndexPair,
const void *  data,
const size_t  size 
)
static

Creates a new tile based on given PBF data.

Parameters
levelThe detail level, with range [1, 22]
tileIndexPairThe tile index pair defining the location of the tile, with range [0, numberTiles(level) - 1]x[0, numberTiles(level) - 1]
dataThe data of the buffer, must be valid
sizeThe size of the buffer, in bytes, with range [1, infinity)
Returns
The resulting tile, invalid if the given PBF data could not be parsed

◆ numberFromPropertyValue()

static bool Ocean::IO::Maps::Basemap::numberFromPropertyValue ( const vtzero::property_value &  propertyValue,
double &  value 
)
staticprotected

Returns the value of a property value as number.

Parameters
propertyValueThe property value from which the number will be extracted
valueThe resulting number value
Returns
True, if succeeded

◆ parseBuilding()

static SharedObject Ocean::IO::Maps::Basemap::parseBuilding ( vtzero::feature &  vtzeroFeature,
PixelPositionGroupsI &&  outerPolygons,
PixelPositionGroupsI &&  innerPolygons,
PixelPositionGroupsI &&  lineStrings,
const unsigned int  layerExtent 
)
staticprotected

Parses a building feature.

Parameters
vtzeroFeatureThe building feature, must be valid
outerPolygonsThe outer polygons of the building, can be empty
innerPolygonsThe inner polygons of the building, can be empty
lineStringsThe line strings of the building, can be empty
layerExtentThe extent of the layer in which the building is located, in pixels, with range [1, infinity)
Returns
The resulting building object, nullptr if the feature could not be parsed

◆ parseLandCover()

static SharedObject Ocean::IO::Maps::Basemap::parseLandCover ( vtzero::feature &  vtzeroFeature,
PixelPositionGroupsI &&  outerPolygons,
PixelPositionGroupsI &&  innerPolygons,
PixelPositionGroupsI &&  lineStrings,
const unsigned int  layerExtent 
)
staticprotected

Parses a land cover feature.

Parameters
vtzeroFeatureThe building feature, must be valid
outerPolygonsThe outer polygons of the building, can be empty
innerPolygonsThe inner polygons of the building, can be empty
lineStringsThe line strings of the building, can be empty
layerExtentThe extent of the layer in which the building is located, in pixels, with range [1, infinity)
Returns
The resulting land cover object, nullptr if the feature could not be parsed

◆ parseLandUse()

static SharedObject Ocean::IO::Maps::Basemap::parseLandUse ( vtzero::feature &  vtzeroFeature,
PixelPositionGroupsI &&  outerPolygons,
PixelPositionGroupsI &&  innerPolygons,
PixelPositionGroupsI &&  lineStrings,
const unsigned int  layerExtent 
)
staticprotected

Parses a land use feature.

Parameters
vtzeroFeatureThe building feature, must be valid
outerPolygonsThe outer polygons of the building, can be empty
innerPolygonsThe inner polygons of the building, can be empty
lineStringsThe line strings of the building, can be empty
layerExtentThe extent of the layer in which the building is located, in pixels, with range [1, infinity)
Returns
The resulting land use object, nullptr if the feature could not be parsed

◆ parseRoad()

static SharedObject Ocean::IO::Maps::Basemap::parseRoad ( vtzero::feature &  vtzeroFeature,
PixelPositionGroupsI &&  lineStrings,
const unsigned int  layerExtent 
)
staticprotected

Parses a road feature.

Parameters
vtzeroFeatureThe building feature, must be valid
lineStringsThe line strings of the transit, at least one
layerExtentThe extent of the layer in which the transit is located, in pixels, with range [1, infinity)
Returns
The resulting road object, nullptr if the feature could not be parsed

◆ parseTransit()

static SharedObject Ocean::IO::Maps::Basemap::parseTransit ( vtzero::feature &  vtzeroFeature,
PixelPositionGroupsI &&  lineStrings,
const unsigned int  layerExtent 
)
staticprotected

Parses a transit feature.

Parameters
vtzeroFeatureThe building feature, must be valid
lineStringsThe line strings of the transit, at least one
layerExtentThe extent of the layer in which the transit is located, in pixels, with range [1, infinity)
Returns
The resulting transit object, nullptr if the feature could not be parsed

◆ parseWater()

static SharedObject Ocean::IO::Maps::Basemap::parseWater ( vtzero::feature &  vtzeroFeature,
PixelPositionGroupsI &&  outerPolygons,
PixelPositionGroupsI &&  innerPolygons,
const unsigned int  layerExtent 
)
staticprotected

Parses a water feature.

Parameters
vtzeroFeatureThe building feature, must be valid
outerPolygonsThe outer polygons of the building, can be empty
innerPolygonsThe inner polygons of the building, can be empty
layerExtentThe extent of the layer in which the building is located, in pixels, with range [1, infinity)
Returns
The resulting water object, nullptr if the feature could not be parsed

◆ styleUrl()

static const std::string& Ocean::IO::Maps::Basemap::styleUrl ( )
static

Returns the url for downloading the map style data.

Returns
The url for downloading the map style data

◆ translateLayerName()

static LayerType Ocean::IO::Maps::Basemap::translateLayerName ( const std::string &  layerName)
staticprotected

Translates the name of a layer to the corresponding layer type.

Parameters
layerNameThe name of the layer, must be valid
Returns
The resulting layer type, LT_UNKNOWN if unknown

Field Documentation

◆ maxLatitude

constexpr double Ocean::IO::Maps::Basemap::maxLatitude = 85.05112878
staticconstexprprotected

The maximal latitude angle, in degree.

◆ minLatitude

constexpr double Ocean::IO::Maps::Basemap::minLatitude = -85.05112878
staticconstexprprotected

The minimal latitude angle, in degree.


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