CartoType .NET API 9.6-4-g79291b60b
for development in C#, Visual Basic and other .NET languages
Static Public Member Functions | List of all members
CartoType::Util Class Referenceabstract

General utility functions More...

#include <CartoTypeWrapper.h>

Static Public Member Functions

static String ^ Description ()
 Returns a Git description of the current CartoType version as a string of the form MAJOR.MINOR-BUILD-COMMIT.
 
static String ^ Version ()
 Returns the current CartoType version as a string of the form MAJOR.MINOR.
 
static String ^ Build ()
 Returns the current CartoType build as a string.
 
static double SphericalPolygonArea (array< double >^ aX, array< double >^ aY)
 Returns the area of a spherical polygon in square metres. The polygon is defined in degrees of latitude (y) and longitude (x).
 
static double Length (array< double >^ aX, array< double >^ aY)
 Returns the length of a line, in meters, defined by points of latitude (y) and longitude (x), using great-circle distances.
 
static double GreatCircleDistanceInMeters (double aLong1, double aLat1, double aLong2, double aLat2)
 Returns the great-circle distance in meters between (aLong1,aLat1) and (aLong2,aLat2). This function uses the WGS84 ellipsoid.
 
static double AzimuthInDegrees (double aLong1, double aLat1, double aLong2, double aLat2)
 Returns the azimuth (direction along a great circle) in degrees from (aLong1,aLat1) to (aLong2,aLat2). More...
 
static PointPointAtAzimuth (double aLong, double aLat, double aDir, double aDistanceInMeters)
 Finds the point in degrees at a certain distance and azimuth direction from a starting point. This function uses the WGS84 ellipsoid.
 
static double DistanceFromPoint (array< double >^ aX, array< double >^ aY, bool aIsPolygon, double aPointX, double aPointY, Point^ aNearestPoint)
 Returns the distance from a line of points (if aPolygon is false) or a polygon (if aPolygon is true) to the point (aPointX,aPointY) and puts the nearest point in the line or polygon in aNearestPoint.
 
static String ^ SetAttribute (String^ aString, String^ aKey, String^ aValue)
 Sets an attribute in a string to be used when creating a map object. More...
 
static String ^ ErrorString (Result aError)
 Returns a short description of an error, given its code.
 
static String ^ UKGridReferenceFromDegrees (PointValue aPointInDegrees, int aDigits)
 Converts a point in degrees longitude (x) and latitude (y) (WGS84) into a UK Ordnance Survey national grid reference. More...
 
static PointValue PointInDegreesFromUKGridReference (String^ aGridReference)
 Converts a UK Ordnance Survey national grid reference (two capital letters followed by an even number of digits) into a point in degrees longitude (x) and latitude (y) (WGS84). More...
 

Detailed Description

General utility functions

Member Function Documentation

◆ AzimuthInDegrees()

static double CartoType::Util::AzimuthInDegrees ( double  aLong1,
double  aLat1,
double  aLong2,
double  aLat2 
)
static

Returns the azimuth (direction along a great circle) in degrees from (aLong1,aLat1) to (aLong2,aLat2).

This function uses the WGS84 ellipsoid. North is 0 and angles increase clockwise.

◆ PointInDegreesFromUKGridReference()

static PointValue CartoType::Util::PointInDegreesFromUKGridReference ( String^  aGridReference)
static

Converts a UK Ordnance Survey national grid reference (two capital letters followed by an even number of digits) into a point in degrees longitude (x) and latitude (y) (WGS84).

The point returned is the center of the square defined by the grid reference. Returns the point (0,0) if the grid reference is invalid.

◆ SetAttribute()

static String ^ CartoType::Util::SetAttribute ( String^  aString,
String^  aKey,
String^  aValue 
)
static

Sets an attribute in a string to be used when creating a map object.

Treating a string as a set of map object attributes of the form label|key1=value1|key2=value2| ... |keyN=valueN, where | is character code 0, set a named attribute. An empty or zero-length name sets the label. An empty or zero-length value deletes a name-value pair.

Returns the new string, with the attribute set.

◆ UKGridReferenceFromDegrees()

static String ^ CartoType::Util::UKGridReferenceFromDegrees ( PointValue  aPointInDegrees,
int  aDigits 
)
static

Converts a point in degrees longitude (x) and latitude (y) (WGS84) into a UK Ordnance Survey national grid reference.

aDigits is the number of digits per coordinate, which is clamped to the range 0...5. Five-digit references are accurate to a meter. Returns null if the point is outside the UK national grid bounds.


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