CartoType iOS API 8.8-13-g03c6f7017
for development in Swift and Objective C for iOS and Mac OS
Instance Methods | Class Methods | List of all members
CartoTypeGeometry Class Reference

#import <CartoTypeBase.h>

Inheritance diagram for CartoTypeGeometry:

Instance Methods

(id) - initWithCoordType:
 
(id) - initWithMapObject:
 
(id) - initWithGeometryContour:contourIndex:
 
(id) - initWithRect:coordType:
 
(void) - dealloc
 
(CartoTypeCoordType- coordType
 
(void) - appendX:andY:
 
(void) - appendX:andY:andPointType:
 
(void) - beginContour
 
(int) - contourCount
 
(bool) - contourIsOuter:
 
(int) - pointCount:
 
(CartoTypePathPointFP- point:pointIndex:
 
(bool) - isEmpty
 
(bool) - isClosed
 
(void) - setClosed:
 
(void) - reverse
 
(CTResult- convertLinesToGreatCircles:
 
(CartoTypePathIntersectionType- intersectionType:
 
(CartoTypePathIntersectionInfo *) - intersectionInfo:
 
(NSArray< NSNumber * > *) - intersectionTypes:
 
(NSArray< CartoTypePathIntersectionInfo * > *) - intersectionInfos:
 
(bool) - intersects:
 
(bool) - contains:
 
(bool) - contained:
 
(CartoTypeGeometry *) - clip:mapObject:
 
(NSArray< CartoTypeGeometry * > *) - clip:mapObjects:
 
(id) - initWithGeometry:
 
(void *) - geometry
 

Class Methods

(CartoTypeGeometry *) + envelope:offsetInMeters:
 

Detailed Description

Geometry: a point, polyline or poly-polygon with a coordinate type.

Method Documentation

◆ appendX:andY:

- (void) appendX: (double)  aX
andY: (double)  aY 

Adds a new point.

◆ appendX:andY:andPointType:

- (void) appendX: (double)  aX
andY: (double)  aY
andPointType: (CartoTypePointType aPointType 

Adds a new point, specifying the point type as well as the coordinates.

◆ beginContour

- (void) beginContour

Starts a new contour.

◆ clip:mapObject:

- (CartoTypeGeometry *) clip: (CartoTypeClipOperation aClipOperation
mapObject: (CartoTypeMapObject *)  aMapObject 

Returns the result of clipping a map object using this geometry, which must be closed. Supports intersection, union, difference and exclusive-or operations. All operations except difference are commutative. The difference operation subtracts this geometry from aMapObject.

The returned geometry object is in degrees.

◆ clip:mapObjects:

- (NSArray< CartoTypeGeometry * > *) clip: (CartoTypeClipOperation aClipOperation
mapObjects: (NSArray< CartoTypeMapObjectGroup * > *)  aMapObjectArray 

Returns the results of clipping an array of map objects using this geometry, which must be closed. Supports intersection, union, difference and exclusive-or operations. All operations except difference are commutative. The difference operation subtracts this geometry from the map objects.

The returned geometry objects are in degrees.

◆ contained:

- (bool) contained: (CartoTypeMapObject *)  aMapObject

Returns true if this geometry is contained by the map object aMapObject.

◆ contains:

- (bool) contains: (CartoTypeMapObject *)  aMapObject

Returns true if this geometry contains the map object aMapObject.

◆ contourCount

- (int) contourCount

Returns the number of contours.

◆ contourIsOuter:

- (bool) contourIsOuter: (int)  aContourIndex

Returns true if a contour is an outer contour, defined as being anti-clockwise, that is, having a positive area when treating all points as on-curve. Useful only for closed geometries.

◆ convertLinesToGreatCircles:

- (CTResult) convertLinesToGreatCircles: (double)  aMaxDistanceInMeters

Interpolates points at a maximum distance apart to convert lines to great circles. Works only with degree coordinates, and with on-curve points.

◆ coordType

- (CartoTypeCoordType) coordType

Returns the coordinate type.

◆ dealloc

- (void) dealloc

Destroys the geometry object.

◆ envelope:offsetInMeters:

+ (CartoTypeGeometry *) envelope: (CartoTypeMapObject *)  aMapObject
offsetInMeters: (double)  aOffsetInMeters 

Returns a geometry that is the envelope of a map object, created by offsetting the path by aOffset. The offset may be negative if the subject path is made of polygons only.

The returned geometry object is in degrees.

◆ geometry

- (void *) geometry

(for internal use) Gets a pointer to the underlying C++ geometry object.

◆ initWithCoordType:

- (id) initWithCoordType: (CartoTypeCoordType aCoordType

Initializes the geometry object with the coordinate type to be used when adding points.

◆ initWithGeometry:

- (id) initWithGeometry: (void *)  aGeometry

(for internal use) Initializes the geometry object with an underlying C++ geometry object.

◆ initWithGeometryContour:contourIndex:

- (id) initWithGeometryContour: (CartoTypeGeometry *)  aGeometry
contourIndex: (int)  aContourIndex 

Creates a geometry object from a single contour of another geometry object.

◆ initWithMapObject:

- (id) initWithMapObject: (CartoTypeMapObject *)  aMapObject

Creates a geometry object from a map object.

◆ initWithRect:coordType:

- (id) initWithRect: (CartoTypeRect aRect
coordType: (CartoTypeCoordType aCoordType 

Creates a geometry object from a rectangle.

◆ intersectionInfo:

- (CartoTypePathIntersectionInfo *) intersectionInfo: (CartoTypeMapObject *)  aMapObject

Returns information about the intersection of this geometry with a map object. The nearest positions are in degrees (X = longitude, Y = latitude) and the the distance is in meters.

◆ intersectionInfos:

- (NSArray< CartoTypePathIntersectionInfo * > *) intersectionInfos: (NSArray< CartoTypeMapObjectGroup * > *)  aMapObjectArray

Returns information about the intersection of this geometry with a sequence of map objects returned by a function. The nearest positions are in degrees (X = longitude, Y = latitude) and the the distances are in meters.

◆ intersectionType:

- (CartoTypePathIntersectionType) intersectionType: (CartoTypeMapObject *)  aMapObject

Returns the intersection type of this geometry with a map object.

◆ intersectionTypes:

- (NSArray< NSNumber * > *) intersectionTypes: (NSArray< CartoTypeMapObjectGroup * > *)  aMapObjectArray

Returns the intersection types of this geometry with an array of map objects. The types are returned as integers because of the difficulty of returning an array of enumeration values in Objective C.

◆ intersects:

- (bool) intersects: (CartoTypeMapObject *)  aMapObject

Returns true if this geometry intersects, contains or is contained by the map object aMapObject.

◆ isClosed

- (bool) isClosed

Returns true if the geometry is made from closed paths.

◆ isEmpty

- (bool) isEmpty

Returns true if the geometry has no points.

◆ point:pointIndex:

- (CartoTypePathPointFP) point: (int)  aContourIndex
pointIndex: (int)  aPointIndex 

Returns a point, given a contour index and a point index.

◆ pointCount:

- (int) pointCount: (int)  aContourIndex

Returns the number of points in a contour.

◆ reverse

- (void) reverse

Reverses the order of the points in each contour.

◆ setClosed:

- (void) setClosed: (bool)  aClosed

Sets the closed state.


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