GeographicCoordinate
Typedefs
-
typedef struct impl_GeographicCoordinate *GeographicCoordinateRef
Opaque type for geographic coordinate.
Functions
-
GeographicCoordinateRef GeographicCoordinateCreate(SIScalarRef latitude, SIScalarRef longitude, SIScalarRef altitude, OCDictionaryRef metadata, OCStringRef *outError)
Create a GeographicCoordinate with required latitude and longitude, optional altitude, and metadata.
- Parameters:
latitude – Required latitude (° north positive)
longitude – Required longitude (° east positive)
altitude – Optional altitude (m above sea level), NULL for unspecified
metadata – Optional application-specific metadata, NULL for none
outError – Optional output for error message
-
GeographicCoordinateRef GeographicCoordinateCreateFromDictionary(OCDictionaryRef dict, OCStringRef *outError)
Create a copy from a serialized dictionary (round-trip)
- Parameters:
dict – Dictionary representation of a GeographicCoordinate
outError – Optional output for error message
- Returns:
New GeographicCoordinateRef or NULL on error
-
GeographicCoordinateRef GeographicCoordinateCreateFromJSON(cJSON *json, OCStringRef *outError)
-
OCDictionaryRef GeographicCoordinateCopyAsDictionary(GeographicCoordinateRef gc)
Serialize to a dictionary for JSON conversion
- Parameters:
gc – GeographicCoordinateRef to serialize
- Returns:
Newly created dictionary (caller must release)
-
cJSON *GeographicCoordinateCopyAsJSON(GeographicCoordinateRef gc, bool typed, OCStringRef *outError)
Convert a GeographicCoordinateRef to cJSON representation.
- Parameters:
gc – The GeographicCoordinate to convert.
typed – Whether to include type information in the JSON.
outError – Optional output parameter for error messages (may be NULL).
- Returns:
cJSON object or NULL on error.
-
SIScalarRef GeographicCoordinateGetLatitude(GeographicCoordinateRef gc)
Getters.
Latitude
-
SIScalarRef GeographicCoordinateGetLongitude(GeographicCoordinateRef gc)
Longitude.
-
SIScalarRef GeographicCoordinateGetAltitude(GeographicCoordinateRef gc)
Altitude or NULL.
-
OCDictionaryRef GeographicCoordinateGetApplicationMetaData(GeographicCoordinateRef gc)
User metadata (never NULL)
-
bool GeographicCoordinateSetLatitude(GeographicCoordinateRef gc, SIScalarRef latitude)
Setters.
-
bool GeographicCoordinateSetLongitude(GeographicCoordinateRef gc, SIScalarRef longitude)
-
bool GeographicCoordinateSetAltitude(GeographicCoordinateRef gc, SIScalarRef altitude)
-
bool GeographicCoordinateSetApplicationMetaData(GeographicCoordinateRef gc, OCDictionaryRef metadata)
-
GeographicCoordinateRef GeographicCoordinateCreateCopy(GeographicCoordinateRef gc)
Deep copy.
-
OCTypeID GeographicCoordinateGetTypeID(void)
Type identification.