CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CartoTypeCore::MapObject Class Referenceabstract

#include <cartotype_map_object.h>

Inheritance diagram for CartoTypeCore::MapObject:
CartoTypeCore::MPath

Public Member Functions

virtual std::unique_ptr< MapObjectCopy (Result &aError) const
 
virtual Text StringAttributes () const =0
 
virtual Text Label () const =0
 
virtual WritableContourView WritableContour (size_t aIndex)=0
 
virtual MStringWritableStringAttributes ()
 
virtual const BitmapViewBitmap () const
 
virtual const AffineTransformBitmapTransform () const
 
virtual void Normalize ()
 
virtual void Simplify (int32_t aResolution)
 
virtual TAttribSet * AttribSet ()
 
const TAttribSet * AttribSet () const
 
virtual std::shared_ptr< CartoTypeCore::Projection > Projection () const
 
Text StringAttribute (const MString &aName) const
 
Text StringAttribute (const String &aName) const
 
Text StringAttributeForLocale (const MString &aName, const char *aLocale) const
 
Text StringAttributeForLocale (const String &aName, const char *aLocale) const
 
Text StringAttributeUsingPath (const MString &aPath, const MString &aDefault, Font *aFont=nullptr) const
 
std::map< String, StringStringAttributeMap () const
 
uint64_t Id () const
 
MapObjectType Type () const
 
const MStringLayerName () const
 
RefCountedString LayerRef () const
 
CartoTypeCore::FeatureInfo FeatureInfo () const
 
String GenericName (const char *aLocale=nullptr) const
 
std::string Description () const
 
std::string VerboseDescription () const
 
PointFP Center () const
 
PointFP CenterInDegrees (Result &aError) const
 
RectFP BoundsInDegrees (Result &aError) const
 
Geometry GeometryInDegrees (Result &aError) const
 
bool GetHeight (Point aPoint, bool aHaveMetres, const AffineTransform *aInverseTransform, int32_t &aHeight) const
 
CartoTypeCore::GeoCodeType GeoCodeType () const
 
CartoTypeCore::GeoCodeItem GeoCodeItem (const char *aLocale) const
 
double SpeedLimit () const
 
double Top () const
 
double Bottom () const
 
double DimensionAttribute (const MString &aKey) const
 
bool NextStringAttribute (size_t &aPos, Text &aName, Text &aValue) const
 
bool Mergeable (const MapObject &aOther) const
 
void Project (const MapTransform &aMapTransform)
 
void Project (const CartoTypeCore::Projection &aProjection)
 
void Smooth ()
 
void Offset (int32_t aDx, int32_t aDy)
 
bool Clip (const Rect &aClip, std::unique_ptr< MapObject > &aClippedObject, MapObjectArray *aExtraClippedObjectArray=nullptr, bool aLinesMustBeSingleContours=false) const
 
bool Clip (const ClipRegion &aClip, std::unique_ptr< MapObject > &aClippedObject, MapObjectArray *aExtraClippedObjectArray=nullptr, bool aLinesMustBeSingleContours=false) const
 
std::unique_ptr< MapObjectFlatten (double aDistance) const
 
std::unique_ptr< MapObjectInterpolate (int32_t aGranularity) const
 
void SetType (MapObjectType aType)
 
Result Write (OutputStream &aOutput, const CartoTypeCore::Projection *aProjectionFromLatLong=nullptr) const
 
void WriteInMapCoords (OutputStream &aOutput) const
 
double Area (Result &aError) const
 
double LengthOrPerimeter (Result &aError) const
 
void SetId (uint64_t aId)
 
void SetFeatureInfo (CartoTypeCore::FeatureInfo aFeatureInfo)
 
CartoTypeCore::FeatureType FeatureType () const
 
Result SetSubType (uint32_t aSubType)
 
uint32_t SubType () const
 
void SetLayer (RefCountedString aLayer)
 
MapObjectMatch Match (const MString &aText, StringMatchMethod aMatchMethod, const MString *aAttributes=nullptr, bool aPhrase=true) const
 
StringMatchType MatchType (const MString &aText, const AbbreviationDictionary *aAbbreviationDictionary=nullptr) const
 
void SetUserData (int64_t aData)
 
int64_t UserData () const
 
void SetUserDataToPointer (void *aData)
 
void * UserDataAsPointer () const
 
void SetUserDataToUnion (CartoTypeCore::UserData aUserData)
 
CartoTypeCore::UserData UserDataAsUnion () const
 
Outline Clip (ClipOperation aClipOperation, const MPath &aClip) const
 
- Public Member Functions inherited from CartoTypeCore::MPath
virtual ~MPath ()
 
virtual size_t Contours () const =0
 
virtual ContourView ContourByIndex (size_t aIndex) const =0
 
virtual bool MayHaveCurves () const =0
 
template<class MPathTraverser >
void Traverse (MPathTraverser &aTraverser, const Rect &aClip) const
 
template<class MPathTraverser >
void Traverse (MPathTraverser &aTraverser, const Rect *aClip=nullptr) const
 
bool operator== (const MPath &aOther) const
 
Rect CBox () const
 
bool CBoxBiggerThan (int32_t aSize) const
 
bool IsContainedIn (const Rect &aRect) const
 
bool Contains (double aX, double aY) const
 
bool Contains (const Point &aPoint) const
 
bool Contains (const PointFP &aPoint) const
 
bool MayIntersect (const Rect &aRect) const
 
bool MayIntersect (const Rect &aRect, int32_t aBorder) const
 
bool Intersects (const Rect &aRect) const
 
bool Intersects (const MPath &aPath, const Rect *aBounds=nullptr) const
 
int32_t MaxDistanceFromOrigin () const
 
PathIntersectionType IntersectionType (const MPath &aOther, double *aDistance=nullptr, PointFP *aNearest1=nullptr, PointFP *aNearest2=nullptr) const
 
PathIntersectionInfo IntersectionInfo (const MPath &aOther) const
 
double DistanceFrom (const MPath &aOther, PointFP *aNearest1=nullptr, PointFP *aNearest2=nullptr, PathIntersectionType *aType=nullptr) const
 
double DistanceFromPoint (const PointFP &aPoint, PointFP *aNearest=nullptr, size_t *aContourIndex=nullptr, size_t *aLineIndex=nullptr, double *aFractionaLineIndex=nullptr, bool aTreatAsOpen=false) const
 
bool IsClippingNeeded (const Rect &aClip) const
 
Outline Copy () const
 
Outline ClippedPath (const Rect &aClip) const
 
Outline ClippedPath (const MPath &aClip) const
 
Outline ClippedPath (const ClipRegion &aClip) const
 
Outline Clip (ClipOperation aClipOperation, const MPath &aClip) const
 
Outline Envelope (double aOffset) const
 
Outline ConcaveHull (double aMaxEdgeLength, PolygonOrientation aAssumedOrientation=PolygonOrientation::None) const
 
bool IsSmoothingNeeded () const
 
Outline SmoothPath () const
 
Outline FlatPath (double aMaxDistance) const
 
Outline TruncatedPath (double aStart, double aEnd) const
 
Outline OffsetPath (double aOffset) const
 
Outline TransformedPath (const AffineTransform &aTransform) const
 
Outline TransformedPath (DrawResult &aError, MPointTransformer &aTransformer, int32_t aFractionalBits) const
 
Outline Interpolate (int32_t aGranularity) const
 
std::array< Line, 3 > HorizontalPaths (GraphicsContext *aGc, int32_t aPathLength, int32_t aLabelAscent, int32_t aLabelDescent, const PointFP &aUpVector, const Rect *aBounds, const Rect *aClip) const
 
PointFP CenterOfGravity () const
 
double Length () const
 
double Area () const
 
PointFP PointAtLength (double aPos) const
 
std::pair< Point, bool > End () const
 
void Write (OutputStream &aOutput) const
 
void WriteAsXml (OutputStream &aOutput) const
 
bool IsEmpty () const
 
bool IsPoint () const
 
bool IsGridOrientedRectangle (Rect *aRect=nullptr) const
 
void GetSphericalAreaAndLength (const Projection &aProjection, double *aArea, double *aLength) const
 
CartoTypeCore::ClipType ClipType (const Rect &aRect) const
 
bool HasCurves () const
 
size_t PointCount () const
 
ConstIter begin () const
 
ConstIter end () const
 

Static Public Member Functions

static double SpeedLimit (const MString &aStringAttribute)
 

Protected Member Functions

 MapObject (RefCountedString aLayer, MapObjectType aType)
 
 MapObject (RefCountedString aLayer, MapObjectType aType, CartoTypeCore::UserData aUserData)
 
 MapObject (const MapObject &aOther)=default
 
MapObjectoperator= (const MapObject &aOther)=default
 

Protected Attributes

RefCountedString iLayer
 
uint64_t iId = 0
 
MapObjectType iType
 
CartoTypeCore::FeatureInfo iFeatureInfo
 
CartoTypeCore::UserData iUserData
 

Detailed Description

The abstract base map object class. A map object is a path that also possesses cartographic attributes.

Constructor & Destructor Documentation

◆ MapObject() [1/3]

CartoTypeCore::MapObject::MapObject ( RefCountedString  aLayer,
MapObjectType  aType 
)
inlineprotected

Creates a map object with a specified layer and type.

◆ MapObject() [2/3]

CartoTypeCore::MapObject::MapObject ( RefCountedString  aLayer,
MapObjectType  aType,
CartoTypeCore::UserData  aUserData 
)
inlineprotected

Creates a map object with a specified layer, type and user data.

◆ MapObject() [3/3]

CartoTypeCore::MapObject::MapObject ( const MapObject aOther)
protecteddefault

Creates a map object by copying another one.

Member Function Documentation

◆ Area()

double CartoTypeCore::MapObject::Area ( Result aError) const

Calculates the area of a map object in square meters, using the projection stored in the map object. Returns 0 if the object is a point or line object.

◆ AttribSet() [1/2]

virtual TAttribSet * CartoTypeCore::MapObject::AttribSet ( )
inlinevirtual

Returns a pointer to a TAttribSet if possible; used by makemap.

◆ AttribSet() [2/2]

const TAttribSet * CartoTypeCore::MapObject::AttribSet ( ) const
inline

Returns a constant pointer to a TAttribSet if possible; used by makemap.

◆ Bitmap()

virtual const BitmapView * CartoTypeCore::MapObject::Bitmap ( ) const
virtual

If the object contains array data that can be represented as a bitmap, returns a pointer to the bitmap. The base implementation returns null.

◆ BitmapTransform()

virtual const AffineTransform * CartoTypeCore::MapObject::BitmapTransform ( ) const
virtual

If the object contains array data that can be represented as a bitmap, returns a transform to convert from the bitmap bounds to the extent in map coordinates. The base implementation returns null.

◆ Bottom()

double CartoTypeCore::MapObject::Bottom ( ) const

Gets the bottom of an object in metres by reading it from the _b attribute. Returns 0 if no bottom is specified. The _b attribute is a copy of the OpenStreetMap 'min_height' attribute.

◆ BoundsInDegrees()

RectFP CartoTypeCore::MapObject::BoundsInDegrees ( Result aError) const

Returns the bounding box of a map object in degrees.

◆ Center()

PointFP CartoTypeCore::MapObject::Center ( ) const

Returns the center of a map object in map coordinates. The center is defined as the center of gravity for polygons and arrays, a point half way along the path for lines, and the point itself for points.

◆ CenterInDegrees()

PointFP CartoTypeCore::MapObject::CenterInDegrees ( Result aError) const

Returns the center of a map object in degrees. The center is defined as the center of gravity for polygons and arrays, a point half way along the path for lines, and the point itself for points. Because the center is calculated using map coordinates then converted to degrees, it depends on the map projection used by the map object.

◆ Clip() [1/3]

Outline CartoTypeCore::MPath::Clip ( ClipOperation  aClipOperation,
const MPath aClip 
) const

Performs a general clip operation, which is one of clip, union, difference and exclusive or, on this path using aClip as the clip path, and returns the resulting path. The clipping path (aClip) must be made from closed contours only.

◆ Clip() [2/3]

bool CartoTypeCore::MapObject::Clip ( const ClipRegion aClip,
std::unique_ptr< MapObject > &  aClippedObject,
MapObjectArray aExtraClippedObjectArray = nullptr,
bool  aLinesMustBeSingleContours = false 
) const

Clips a map object to the clip region aClip.

If the object was clipped the function returns true and puts the clipped object, which may be null, in aClippedObject.

If aExtraClippedObjectArray is non-null, line objects with a single contour may be clipped into multiple objects to preserve their single-line nature, in which case the extra objects are appended to aExtraClippedObjectArray. All other objects are clipped to a single object.

If aLinesMustBeSingleContours is true, line objects are never converted to multiple contours, even if aExtraClippedObjectArray is non-null. They are not clipped if that is necessary.

If the object was not clipped (i.e., it was entirely contained in aClip) the function returns false.

◆ Clip() [3/3]

bool CartoTypeCore::MapObject::Clip ( const Rect aClip,
std::unique_ptr< MapObject > &  aClippedObject,
MapObjectArray aExtraClippedObjectArray = nullptr,
bool  aLinesMustBeSingleContours = false 
) const

Clips a map object to the rectangle aClip.

If the object was clipped the function returns true and puts the clipped object, which may be null, in aClippedObject.

If aExtraClippedObjectArray is non-null, line objects with a single contour may be clipped into multiple objects to preserve their single-line nature, in which case the extra objects are appended to aExtraClippedObjectArray. All other objects are clipped to a single object.

If aLinesMustBeSingleContours is true, line objects are never converted to multiple contours, even if aExtraClippedObjectArray is non-null. They are not clipped if that is necessary.

If the object was not clipped (i.e., it was entirely contained in aClip) the function returns false.

◆ Copy()

virtual std::unique_ptr< MapObject > CartoTypeCore::MapObject::Copy ( Result aError) const
virtual

Creates a copy of a map object. The base implementation works for all types of map object except array map objects.

◆ Description()

std::string CartoTypeCore::MapObject::Description ( ) const

Creates a UTF-8 string describing a map object; used for debugging. The string consists of the object's string attributes, separated by | characters, then the layer, feature type and object type in square brackets. The object type is encoded as a single character: . - @ # for point, line, polygon and array.

◆ DimensionAttribute()

double CartoTypeCore::MapObject::DimensionAttribute ( const MString aKey) const

Returns the value of a OpenStreetMap dimension attribute in meters.

◆ FeatureInfo()

CartoTypeCore::FeatureInfo CartoTypeCore::MapObject::FeatureInfo ( ) const
inline

Returns the feature info.

◆ FeatureType()

CartoTypeCore::FeatureType CartoTypeCore::MapObject::FeatureType ( ) const
inline

Returns the feature type.

◆ Flatten()

std::unique_ptr< MapObject > CartoTypeCore::MapObject::Flatten ( double  aDistance) const

Returns a version of a map object with all curved line segments flattened by being replaced by short straight line segments. Returns null if no flattening is needed.

◆ GenericName()

String CartoTypeCore::MapObject::GenericName ( const char *  aLocale = nullptr) const

Creates a generic name for a map object, using the supplied locale if possible. For example "restaurant", "fuel station" or "minor road".

Note: locales are not yet implemented. All category names are in English.

◆ GeoCodeItem()

CartoTypeCore::GeoCodeItem CartoTypeCore::MapObject::GeoCodeItem ( const char *  aLocale) const

Returns information used when geocoding a map object.

◆ GeoCodeType()

CartoTypeCore::GeoCodeType CartoTypeCore::MapObject::GeoCodeType ( ) const

Returns the geocode type of a map object.

◆ GeometryInDegrees()

Geometry CartoTypeCore::MapObject::GeometryInDegrees ( Result aError) const

Returns the geometry of a map object in degrees.

◆ GetHeight()

bool CartoTypeCore::MapObject::GetHeight ( Point  aPoint,
bool  aHaveMetres,
const AffineTransform aInverseTransform,
int32_t &  aHeight 
) const

Gets the height of a point in metres if this map object contains terrain heights. The argument aPoint is in map coordinates. The return value is true if a height is successfully obtained.

There is no check for the validity or sanity of the data. The argument aHaveMetres indicates whether the object contains 16-bit metre values, or bytes encoding feet.

Feet are encoded as follows: 0 for unknown heights (sea or unspecified); 1...15 for -1400ft to sea level in intervals of 100ft; 16...195 for 100ft to 18,000ft in intervals of 100ft; and 196...255 for 18,200ft to 30,000ft in intervals of 200ft.

If aInverseTransform is supplied, it is the inverse of the transform used to convert from bitmap coordinates to map coordinates. If it is not supplied, it is calculated from the bitmap.

◆ Id()

uint64_t CartoTypeCore::MapObject::Id ( ) const
inline

Returns the identifier of this object. Identifiers are opaque 64-bit numbers that are specific to a database. The value zero is reserved and means 'no identifier'.

◆ Interpolate()

std::unique_ptr< MapObject > CartoTypeCore::MapObject::Interpolate ( int32_t  aGranularity) const

Creates a new map object, interpolating extra points so that the maximum difference between coordinates doesn't exceed aGranularity. Chooses the points to be interpolated using the coordinate modulo aGranularity, so that adjacent polygons have the same interpolated points and thus meet without gaps.

◆ Label()

virtual Text CartoTypeCore::MapObject::Label ( ) const
pure virtual

Returns the default label or name of the object: the first, unnamed, string attribute.

◆ LayerName()

const MString & CartoTypeCore::MapObject::LayerName ( ) const
inline

Returns the name of the layer this object belongs to.

◆ LayerRef()

RefCountedString CartoTypeCore::MapObject::LayerRef ( ) const
inline

Returns the reference-counted name of the layer.

◆ LengthOrPerimeter()

double CartoTypeCore::MapObject::LengthOrPerimeter ( Result aError) const

Calculates the length or perimeter of a map object in meters, using the projection stored in the map object. Returns 0 if the object is a point object.

◆ Match()

MapObjectMatch CartoTypeCore::MapObject::Match ( const MString aText,
StringMatchMethod  aMatchMethod,
const MString aAttributes = nullptr,
bool  aPhrase = true 
) const

Finds the first string attribute matching aText, using aMatchMethod, and returns information about it. If aAttributes is non-null, examines only attributes in the supplied comma-separated list, otherwise examines all attributes except those starting with an underscore, which by convention are non-textual. Attribute names may contain the wild cards ? and *. If aPhrase is true (the default), allows matches of phrases within the attribute.

◆ MatchType()

StringMatchType CartoTypeCore::MapObject::MatchType ( const MString aText,
const AbbreviationDictionary aAbbreviationDictionary = nullptr 
) const

Finds out whether a map object is a partial or full match for some text. If aAbbreviationDictionary is non-null, attributes are abbreviated using it before being compared with aText.

If the text matches the whole of a name attribute, or the whole of a sub-part of a name attribute (using spaces, hyphens, single quotes, colons, semicolons and slashes as separators) ignoring case and accents, it's a phrase match or a fuzzy match.

If it matches part of the attribute it's a phrase match.

◆ Mergeable()

bool CartoTypeCore::MapObject::Mergeable ( const MapObject aOther) const

Returns true if this map object can be merged with aOther.

◆ NextStringAttribute()

bool CartoTypeCore::MapObject::NextStringAttribute ( size_t &  aPos,
Text aName,
Text aValue 
) const

Gets the next string attribute, starting at character position aPos in the string attributes, and updates aPos. Returns true if an attribute is found.

This function can be used to enumerate string attributes by passing 0 as aPos and repeating until a value of false is returned.

◆ Normalize()

virtual void CartoTypeCore::MapObject::Normalize ( )
virtual

Normalizes a map object if possible by removing point contours with no points, polygon contours with fewer than 3 points, and line contours with fewer than 2 points. The base implementation does nothing.

◆ Offset()

void CartoTypeCore::MapObject::Offset ( int32_t  aDx,
int32_t  aDy 
)

Offsets all points in the map object by the specified amounts.

◆ operator=()

MapObject & CartoTypeCore::MapObject::operator= ( const MapObject aOther)
protecteddefault

The assignment operator.

◆ Project() [1/2]

void CartoTypeCore::MapObject::Project ( const CartoTypeCore::Projection &  aProjection)

Projects all the points in a map object using the specified projection.

◆ Project() [2/2]

void CartoTypeCore::MapObject::Project ( const MapTransform &  aMapTransform)

Projects all the points in a map object to 64ths of pixels using the specified projection.

◆ Projection()

virtual std::shared_ptr< CartoTypeCore::Projection > CartoTypeCore::MapObject::Projection ( ) const
inlinevirtual

Returns the projection used to convert from degrees of latitude and longitude to the map units used by this object, or null if the projection is not known.

◆ SetFeatureInfo()

void CartoTypeCore::MapObject::SetFeatureInfo ( CartoTypeCore::FeatureInfo  aFeatureInfo)
inline

Sets the feature information, which contains the road type if the object is a road.

◆ SetId()

void CartoTypeCore::MapObject::SetId ( uint64_t  aId)
inline

Sets the ID.

◆ SetLayer()

void CartoTypeCore::MapObject::SetLayer ( RefCountedString  aLayer)
inline

Sets the layer.

◆ SetSubType()

Result CartoTypeCore::MapObject::SetSubType ( uint32_t  aSubType)

Sets the integer sub-type of a non-route object. Returns an error if the sub-type is outside the legal range 0...2047, or if this object is a route object.

◆ SetType()

void CartoTypeCore::MapObject::SetType ( MapObjectType  aType)
inline

Sets the map object type.

◆ SetUserData()

void CartoTypeCore::MapObject::SetUserData ( int64_t  aData)
inline

Sets the user data to a 64-bit integer.

◆ SetUserDataToPointer()

void CartoTypeCore::MapObject::SetUserDataToPointer ( void *  aData)
inline

Sets the user data to a pointer.

◆ SetUserDataToUnion()

void CartoTypeCore::MapObject::SetUserDataToUnion ( CartoTypeCore::UserData  aUserData)
inline

Sets the user data to a union

◆ Simplify()

virtual void CartoTypeCore::MapObject::Simplify ( int32_t  aResolution)
virtual

Simplifies a map object, if possible, by re-sampling it at a specified resolution. The base implementation does nothing.

◆ Smooth()

void CartoTypeCore::MapObject::Smooth ( )

Smooths a map object by converting sequences of straight lines to curves.

◆ SpeedLimit() [1/2]

double CartoTypeCore::MapObject::SpeedLimit ( ) const

Returns the speed limit in kph for this object if it is a route object. Returns 0 if it is not a route object or if the speed limit is unknown or if there is no speed limit.

◆ SpeedLimit() [2/2]

static double CartoTypeCore::MapObject::SpeedLimit ( const MString aStringAttribute)
static

Gets the speed limit in kph from the string attribute _s, if it exists in aStringAttribute.

◆ StringAttribute() [1/2]

Text CartoTypeCore::MapObject::StringAttribute ( const MString aName) const
inline

Returns the value of the string attribute with name aName.

◆ StringAttribute() [2/2]

Text CartoTypeCore::MapObject::StringAttribute ( const String aName) const
inline

Returns the value of the string attribute with name aName.

◆ StringAttributeForLocale() [1/2]

Text CartoTypeCore::MapObject::StringAttributeForLocale ( const MString aName,
const char *  aLocale 
) const

Returns a string attribute for a given locale by appending a colon then the locale to aName. If no such attribute is available, uses the locale truncated to two letters if it was longer, then tries the plain name. The empty attribute name is changed to 'name' if a locale is added.

◆ StringAttributeForLocale() [2/2]

Text CartoTypeCore::MapObject::StringAttributeForLocale ( const String aName,
const char *  aLocale 
) const
inline

Returns a string attribute for a given locale by appending a colon then the locale to aName. If no such attribute is available, uses the locale truncated to two letters if it was longer, then tries the plain name. The empty attribute name is changed to 'name' if a locale is added.

◆ StringAttributeMap()

std::map< String, String > CartoTypeCore::MapObject::StringAttributeMap ( ) const

Returns all the string attributes as a std::map from names to values.

◆ StringAttributes()

virtual Text CartoTypeCore::MapObject::StringAttributes ( ) const
pure virtual

Returns all the string attributes, null-separated, as key-value pairs separated by an equals sign. The first key must be empty, and means the label or name.

◆ StringAttributeUsingPath()

Text CartoTypeCore::MapObject::StringAttributeUsingPath ( const MString aPath,
const MString aDefault,
Font aFont = nullptr 
) const

Returns a string attribute from a list of semi-colon-separated names in aPath. Replaces empty names with aDefault (as for example if aPath is empty and aDefault is 'name:es'). Returns the first non-empty result.

If aFont is non-null, string attributes that are not drawable (have missing glyphs) using aFont are not returned.

◆ SubType()

uint32_t CartoTypeCore::MapObject::SubType ( ) const
inline

Returns the integer sub-type if this is a non-route object. Returns 0 for route objects.

◆ Top()

double CartoTypeCore::MapObject::Top ( ) const

Gets the top of an object in metres by reading it from the _t attribute. Returns 0 if no top is specified. The _t attribute is a copy of the OpenStreetMap 'height' attribute.

◆ Type()

MapObjectType CartoTypeCore::MapObject::Type ( ) const
inline

Returns the type of the object.

◆ UserData()

int64_t CartoTypeCore::MapObject::UserData ( ) const
inline

Returns the user data as a 64-bit integer.

◆ UserDataAsPointer()

void * CartoTypeCore::MapObject::UserDataAsPointer ( ) const
inline

Returns the user data as a pointer.

◆ UserDataAsUnion()

CartoTypeCore::UserData CartoTypeCore::MapObject::UserDataAsUnion ( ) const
inline

Returns the user data as a union.

◆ VerboseDescription()

std::string CartoTypeCore::MapObject::VerboseDescription ( ) const

Creates a verbose English-language description of a map object as a UTF-8 string.

◆ WritableContour()

virtual WritableContourView CartoTypeCore::MapObject::WritableContour ( size_t  aIndex)
pure virtual

Returns a writable interface to the contour indexed by aIndex.

◆ WritableStringAttributes()

virtual MString * CartoTypeCore::MapObject::WritableStringAttributes ( )
inlinevirtual

Returns a pointer to writable string attributes if possible; used by makemap.

◆ Write()

Result CartoTypeCore::MapObject::Write ( OutputStream aOutput,
const CartoTypeCore::Projection *  aProjectionFromLatLong = nullptr 
) const

Writes a map object to an output stream in serialized form. Writes the geometry as degrees lat/long. (For internal use only : if the map object doesn't store its projection, which is true of stack-allocated CTM1 objects, the projection must be supplied.)

◆ WriteInMapCoords()

void CartoTypeCore::MapObject::WriteInMapCoords ( OutputStream aOutput) const

(For internal use only) Writes a map object to an output stream in serialized form. Writes the geometry in map coordinates. Writes the user data.

Member Data Documentation

◆ iFeatureInfo

CartoTypeCore::FeatureInfo CartoTypeCore::MapObject::iFeatureInfo
protected

The feature type, level, road direction, etc., packed into a 32-bit value.

◆ iId

uint64_t CartoTypeCore::MapObject::iId = 0
protected

The object's identifier.

◆ iLayer

RefCountedString CartoTypeCore::MapObject::iLayer
protected

The layer this object belongs to.

◆ iType

MapObjectType CartoTypeCore::MapObject::iType
protected

The type of the object: point, line, polygon, etc.

◆ iUserData

CartoTypeCore::UserData CartoTypeCore::MapObject::iUserData
protected

User data; can hold an integer or a pointer; can be used to associate any value with a map object.


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