alaCarte Maps
Renderer for OpenStreetMap tiles
TileIdentifier Class Reference

A TileIdentifier identifies a Tile. More...

#include <tile_identifier.hpp>

Inheritance diagram for TileIdentifier:
MetaIdentifier

Public Types

enum  Format { PNG, SVG, enumSize }
 Enumeration which contains all supported image formats. More...
 

Public Member Functions

 TileIdentifier (int x, int y, int zoom, string styleSheetpath, Format imageFormat)
 Constructs a new TileIdentifier with the given parameters. More...
 
TESTABLE int getX () const
 Returns the x coordinate of the Tile. More...
 
TESTABLE int getY () const
 Returns the y coordinate of the Tile. More...
 
TESTABLE int getZoom () const
 Returns the zoom level of the Tile. More...
 
TESTABLE Format getImageFormat () const
 Returns the image Format of the Tile. More...
 
TESTABLE const stringgetImageFormatString () const
 Returns the image Format of the Tile. More...
 
TESTABLE const stringgetStylesheetPath () const
 Returns the path to the Stylesheet which should be used for rendering. More...
 
TESTABLE bool isDefaultIdentifier () const
 Determine whether this is the Identifier for the default tile. More...
 
TESTABLE bool isNoneDataIdentifier () const
 

Static Public Member Functions

static shared_ptr< TileIdentifierCreate (const string &url, shared_ptr< StylesheetManager > StylesheetManager, const shared_ptr< Configuration > &config)
 Constructs a new TileIdentifier with the given url. More...
 
static shared_ptr< TileIdentifierCreateEmptyTID (const string &stylesheetPath, TileIdentifier::Format format)
 Return the TileIdentifier used for Tiles without data. More...
 
static int stringToInt (const char *c)
 Converts the given char* to integer. More...
 

Protected Attributes

int x
 x coordinate of the Tile. More...
 
int y
 y coordinate of the Tile. More...
 
int zoom
 zoom level of the Tile. More...
 
string styleSheetpath
 path to the Stylesheet which should be used for rendering. More...
 
Format imageFormat
 Format of the image. More...
 

Static Private Attributes

static const string FormatString [enumSize]
 This file is part of alaCarte. More...
 

Detailed Description

A TileIdentifier identifies a Tile.

Definition at line 33 of file tile_identifier.hpp.

Member Enumeration Documentation

Enumeration which contains all supported image formats.

Enumerator
PNG 
SVG 
enumSize 

Definition at line 39 of file tile_identifier.hpp.

Constructor & Destructor Documentation

TileIdentifier::TileIdentifier ( int  x,
int  y,
int  zoom,
string  styleSheetpath,
Format  imageFormat 
)

Constructs a new TileIdentifier with the given parameters.

Parameters
xThe x coordinate of the Tile.
yThe y coordinate of the Tile.
zoomThe zoom level of the Tile.
styleSheetpathThe path to the Stylesheet, which should be used for rendering this Tile. (With preceeding slash).
imageFormatThe image Format of the rendered Tile.

Definition at line 166 of file tile_identifier.cpp.

Member Function Documentation

shared_ptr< TileIdentifier > TileIdentifier::Create ( const string url,
shared_ptr< StylesheetManager stylesheetManager,
const shared_ptr< Configuration > &  config 
)
static

Constructs a new TileIdentifier with the given url.

Parameters
urlThe url which should be parsed.
StylesheetManagerused to validate the stylsheet parameter
Returns
A new TileIdentifier
Exceptions
MalformedURLExceptionif some part of the url isn't parseable.

Definition at line 72 of file tile_identifier.cpp.

shared_ptr< TileIdentifier > TileIdentifier::CreateEmptyTID ( const string stylesheetPath,
TileIdentifier::Format  format 
)
static

Return the TileIdentifier used for Tiles without data.

Returns
shared_ptr to TileIdentifier

Definition at line 152 of file tile_identifier.cpp.

TileIdentifier::Format TileIdentifier::getImageFormat ( ) const

Returns the image Format of the Tile.

Returns
The image Format of the Tile.

Definition at line 211 of file tile_identifier.cpp.

const string & TileIdentifier::getImageFormatString ( ) const

Returns the image Format of the Tile.

Returns
The image Format of the Tile.

Definition at line 221 of file tile_identifier.cpp.

const string & TileIdentifier::getStylesheetPath ( ) const

Returns the path to the Stylesheet which should be used for rendering.

Returns
The path to the Stylesheet.

Definition at line 232 of file tile_identifier.cpp.

int TileIdentifier::getX ( ) const

Returns the x coordinate of the Tile.

Returns
The x coordinate of the Tile.

Definition at line 181 of file tile_identifier.cpp.

int TileIdentifier::getY ( ) const

Returns the y coordinate of the Tile.

Returns
The y coordinate of the Tile.

Definition at line 191 of file tile_identifier.cpp.

int TileIdentifier::getZoom ( ) const

Returns the zoom level of the Tile.

Returns
The zoom level of the Tile.

Definition at line 201 of file tile_identifier.cpp.

bool TileIdentifier::isDefaultIdentifier ( ) const

Determine whether this is the Identifier for the default tile.

Returns
True if this is the identifier for the default tile.

Definition at line 242 of file tile_identifier.cpp.

bool TileIdentifier::isNoneDataIdentifier ( ) const

Definition at line 247 of file tile_identifier.cpp.

int TileIdentifier::stringToInt ( const char *  p)
static

Converts the given char* to integer.

Parameters
pChar pointer
Returns
Int read from the char pointer
Exceptions
MalformedURLExceptionif no convertable string given.

Definition at line 44 of file tile_identifier.cpp.

Member Data Documentation

const string TileIdentifier::FormatString
staticprivate
Initial value:
= {
"png",
"svg",
}

This file is part of alaCarte.

alaCarte is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

alaCarte is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with alaCarte. If not, see http://www.gnu.org/licenses/.

Copyright alaCarte 2012-2013 Simon Dreher, Florian Jacob, Tobias Kahlert, Patrick Niklaus, Bernhard Scheirle, Lisa Winter Maintainer: Simon Dreher

Definition at line 49 of file tile_identifier.hpp.

Format TileIdentifier::imageFormat
protected

Format of the image.

Definition at line 78 of file tile_identifier.hpp.

string TileIdentifier::styleSheetpath
protected

path to the Stylesheet which should be used for rendering.

Definition at line 76 of file tile_identifier.hpp.

int TileIdentifier::x
protected

x coordinate of the Tile.

Definition at line 70 of file tile_identifier.hpp.

int TileIdentifier::y
protected

y coordinate of the Tile.

Definition at line 72 of file tile_identifier.hpp.

int TileIdentifier::zoom
protected

zoom level of the Tile.

Definition at line 74 of file tile_identifier.hpp.


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