CartoType Android API 7.8.2, 2022-03-25
for Java development on Android
Public Member Functions | Static Public Member Functions | List of all members
com.cartotype.Geometry Class Reference
Inheritance diagram for com.cartotype.Geometry:
com.cartotype.Path

Public Member Functions

 Geometry (CoordType aCoordType)
 
 Geometry (Rect aRect, CoordType aCoordType)
 
 Geometry (MapObject aMapObject)
 
 Geometry (Geometry aOther, int aContourIndex)
 
native boolean contourIsOuter (int aContourIndex)
 
void appendPoint (double aX, double aY)
 
native void appendPoint (double aX, double aY, int aPointType)
 
native void beginContour ()
 
CoordType getCoordType ()
 
native int getContourCount ()
 
native int getPointCount (int aContourIndex)
 
native void getPoint (int aContourIndex, int aPointIndex, PathPoint aPoint)
 
native boolean isEmpty ()
 
native boolean isClosed ()
 
native void setClosed (boolean aClosed)
 
native void reverse ()
 
PathIntersectionType intersectionType (MapObject aMapObject)
 
PathIntersectionInfo intersectionInfo (MapObject aMapObject)
 
PathIntersectionType[] intersectionType (MapObject[] aMapObjectArray)
 
PathIntersectionInfo[] intersectionInfo (MapObject[] aMapObjectArray)
 
boolean intersects (MapObject aMapObject)
 
boolean contains (MapObject aMapObject)
 
boolean contained (MapObject aMapObject)
 
Geometry clip (ClipOperation aClipOperation, MapObject aMapObject)
 
Geometry[] clip (ClipOperation aClipOperation, MapObject[] aMapObjectArray)
 
int getContourCount ()
 
int getPointCount (int aContourIndex)
 
void getPoint (int aContourIndex, int aPointIndex, PathPoint aPoint)
 
boolean isClosed ()
 

Static Public Member Functions

static Geometry envelope (MapObject aMapObject, double aOffsetInMeters)
 

Detailed Description

A class containing geometry for creating a map object or other purposes.

Constructor & Destructor Documentation

◆ Geometry() [1/4]

com.cartotype.Geometry.Geometry ( CoordType  aCoordType)

Creates a geometry object using the specified coordinate type.

◆ Geometry() [2/4]

com.cartotype.Geometry.Geometry ( Rect  aRect,
CoordType  aCoordType 
)

Creates a geometry object from a rectangle.

◆ Geometry() [3/4]

com.cartotype.Geometry.Geometry ( MapObject  aMapObject)

Creates a geometry object containing the geometry of a map object.

◆ Geometry() [4/4]

com.cartotype.Geometry.Geometry ( Geometry  aOther,
int  aContourIndex 
)

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

Member Function Documentation

◆ appendPoint() [1/2]

void com.cartotype.Geometry.appendPoint ( double  aX,
double  aY 
)

Appends a point to the current contour.

◆ appendPoint() [2/2]

native void com.cartotype.Geometry.appendPoint ( double  aX,
double  aY,
int  aPointType 
)

Appends a point to the current contour. The point type is one of the constants defined in the PathPoint class.

◆ beginContour()

native void com.cartotype.Geometry.beginContour ( )

Begins a new contour. Use this function when creating a geometry object with more than one contour.

◆ clip() [1/2]

Geometry com.cartotype.Geometry.clip ( ClipOperation  aClipOperation,
MapObject  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() [2/2]

Geometry[] com.cartotype.Geometry.clip ( ClipOperation  aClipOperation,
MapObject[]  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()

boolean com.cartotype.Geometry.contained ( MapObject  aMapObject)

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

◆ contains()

boolean com.cartotype.Geometry.contains ( MapObject  aMapObject)

Returns true if this geometry contains the map object aMapObject.

◆ contourIsOuter()

native boolean com.cartotype.Geometry.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.

◆ envelope()

static Geometry com.cartotype.Geometry.envelope ( MapObject  aMapObject,
double  aOffsetInMeters 
)
static

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.

◆ getContourCount()

native int com.cartotype.Geometry.getContourCount ( )

Returns the number of contours.

Implements com.cartotype.Path.

◆ getCoordType()

CoordType com.cartotype.Geometry.getCoordType ( )

Gets the coordinate type.

◆ getPoint()

native void com.cartotype.Geometry.getPoint ( int  aContourIndex,
int  aPointIndex,
PathPoint  aPoint 
)

Returns a point specified by contour index and point index.

Implements com.cartotype.Path.

◆ getPointCount()

native int com.cartotype.Geometry.getPointCount ( int  aContourIndex)

Returns the number of points in a contour.

Implements com.cartotype.Path.

◆ intersectionInfo() [1/2]

PathIntersectionInfo com.cartotype.Geometry.intersectionInfo ( MapObject  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.

◆ intersectionInfo() [2/2]

PathIntersectionInfo[] com.cartotype.Geometry.intersectionInfo ( MapObject[]  aMapObjectArray)

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

◆ intersectionType() [1/2]

PathIntersectionType com.cartotype.Geometry.intersectionType ( MapObject  aMapObject)

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

◆ intersectionType() [2/2]

PathIntersectionType[] com.cartotype.Geometry.intersectionType ( MapObject[]  aMapObjectArray)

Returns the intersection types of this geometry with an array of map objects.

◆ intersects()

boolean com.cartotype.Geometry.intersects ( MapObject  aMapObject)

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

◆ isClosed()

native boolean com.cartotype.Geometry.isClosed ( )

Returns true if the geometry object is closed.

Implements com.cartotype.Path.

◆ isEmpty()

native boolean com.cartotype.Geometry.isEmpty ( )

Returns true if the geometry object has no points.

◆ reverse()

native void com.cartotype.Geometry.reverse ( )

Reverses the order of the points in each contour.

◆ setClosed()

native void com.cartotype.Geometry.setClosed ( boolean  aClosed)

Sets the geometry object to open or closed.


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