Spatial functions
Use the spatial functions to transform data so it can be used to create map charts.
If the map information is included in a shapefile or GeoJSON file, you do not need to use the spatial functions. However, if you have geographic information in some other type of BLOB column containing WKB (Well-Known Binary) data, then this information needs to be extracted into seven different columns
- Geometry
- XMax
- XMin
- YMax
- YMin
- XCenter
- YCenter
The bounding box for a geometry is called the envelope. It is
specified by the four coordinates XMax, XMin, YMax and YMin. The center of the
geometry is specified by the two coordinates XCenter and YCenter. These
coordinate columns can be calculated from the binary WKB column using the
spatial functions with the binary WKB column as an argument. In order for the
map chart to identify these columns, they must also have the required property
values (the same as the column names listed above) set on the
mapchart.columntypeid
property. This is automatically
done when the spatial functions below are applied.
Function | Description |
---|---|
GreatCircleDistance(Arg1,
Arg2,
Arg3,
Arg4)
|
Returns the shortest distance between two
points, calculated on the surface of a unit sphere. The arguments are the
latitude and longitude of the coordinates (lat1, long1, lat2, long2), expressed
in degrees.
To obtain the result in a certain unit, multiply the result
from the
Examples:
|
WKBEnvelopeXCenter(Arg1)
|
Calculates the X center of the geometry
envelope and sets the XCenter value on the
mapchart.columntypeid property. The argument is
a binary WKB column.
Example:
|
WKBEnvelopeXMin(Arg1)
|
Calculates the X min of the geometry
envelope and sets the XMin value on the
mapchart.columntypeid property. The argument is
a binary WKB column.
Example:
|
WKBEnvelopeXMax(Arg1)
|
Calculates the X max of the geometry
envelope and sets the XMax value on the
mapchart.columntypeid property. The argument is
a binary WKB column.
Example:
|
WKBEnvelopeYCenter(Arg1)
|
Calculates the Y center of the geometry
envelope and sets the YCenter value on the
mapchart.columntypeid property. The argument is
a binary WKB column.
Example:
|
WKBEnvelopeYMin(Arg1)
|
Calculates the Y min of the geometry
envelope and sets the YMin value on the
mapchart.columntypeid property. The argument is
a binary WKB column.
Example:
|
WKBEnvelopeYMax(Arg1)
|
Calculates the Y max of the geometry
envelope and sets the YMax value on the
mapchart.columntypeid property. The argument is
a binary WKB column.
Example:
|