CartoType .NET API 7.8.2, 2022-03-25
for development in C#, Visual Basic and other .NET languages
Classes | Public Member Functions | List of all members
CartoType::MapObject Class Reference

A map object: a point, linear object, polygon object, or array (texture). More...

#include <CartoTypeWrapper.h>

Inheritance diagram for CartoType::MapObject:
CartoType::Path

Classes

class  Match
 Information returned by GetMatch. More...
 

Public Member Functions

String ^ GetLabel ()
 Gets the label or name of the object.
 
int GetIntegerAttribute ()
 Gets the integer attribute of the map object.
 
String ^ GetStringAttribute (String^ aName)
 Gets a string attribute. If aName is empty this function is the same as GetLabel.
 
SortedDictionary< String^, String^> ^ GetStringAttributes ()
 Gets all the string attributes as key-value pairs; an empty key refers to the label attribute.
 
Int64 GetId ()
 Gets the ID of the object.
 
MapObjectType GetType ()
 Gets the type of the object.
 
String ^ GetLayerName ()
 Gets the name of the object's layer.
 
double GetArea ()
 Gets the area of the map object in square meters. Returns 0 if it is a point or a line.
 
double GetLengthOrPerimeter ()
 Gets the length or perimeter of the map object in meters. Returns 0 if it is a point.
 
Result GetCenter (Point^ aPoint)
 Returns the center of a map object in map coordinates. More...
 
Result GetCenterInDegrees (Point^ aPoint)
 Returns the center of a map object in degrees. More...
 
Result GetBoundsInDegrees (Rect^ aRect)
 Returns the bounding box of a map object in degrees.
 
Result GetGeometryInDegrees (Geometry^ aGeometry)
 Returns the bounding box of a map object in degrees.
 
Result GetBounds (Rect^ aRect)
 Returns the axis-aligned bounding box of a map object, in map coordinates.
 
Result GetMatch (Match^ aMatch, String^ aText, StringMatchMethod aMatchMethod, String^ aAttributes, bool aPhrase)
 Finds the first string attribute matching aText, using aMatchMethod, and returns information about it in aMatch. More...
 
virtual int ContourCount ()
 Gets the number of contours in the path. More...
 
virtual int PointCount (int aContourIndex)
 Gets the number of points in a contour. More...
 
virtual void GetPoint (int aContourIndex, int aPointIndex, PathPoint^ aPoint)
 Gets a point, specifying it by contour index and point index, and places it in aPoint. More...
 
int ContourCount ()
 Gets the number of contours (sub-paths). More...
 
int PointCount (int aContourIndex)
 Gets the number of points in a contour. More...
 
void GetPoint (int aContourIndex, int aPointIndex, PathPoint^ aPoint)
 Gets a point given its contour and point indexes. More...
 

Detailed Description

A map object: a point, linear object, polygon object, or array (texture).

Member Function Documentation

◆ ContourCount()

virtual int CartoType::MapObject::ContourCount ( )
virtual

Gets the number of contours in the path.

Implements CartoType::Path.

◆ GetCenter()

Result CartoType::MapObject::GetCenter ( Point aPoint)

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.

◆ GetCenterInDegrees()

Result CartoType::MapObject::GetCenterInDegrees ( Point aPoint)

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.

◆ GetMatch()

Result CartoType::MapObject::GetMatch ( Match aMatch,
String^  aText,
StringMatchMethod  aMatchMethod,
String^  aAttributes,
bool  aPhrase 
)

Finds the first string attribute matching aText, using aMatchMethod, and returns information about it in aMatch.

If aAttributes is non-null this function examines only attributes in the supplied comma-separated list, otherwise it 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, matches of phrases within the attribute are allowed.

◆ GetPoint()

virtual void CartoType::MapObject::GetPoint ( int  aContourIndex,
int  aPointIndex,
PathPoint aPoint 
)
virtual

Gets a point, specifying it by contour index and point index, and places it in aPoint.

Implements CartoType::Path.

◆ PointCount()

virtual int CartoType::MapObject::PointCount ( int  aContourIndex)
virtual

Gets the number of points in a contour.

Implements CartoType::Path.


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