Geospatiale

Geospatiale

The namespace for all UF/Geospatiale utility functions, typically for static methods.

Source:

Classes

maptalks_GeoKMZ

Methods

(static) convertMaptalksToTurf(arg0_geometry) → {turf.Geometry}

Converts a maptalks.Geometry into a turf.Geometry.

Source:
Parameters:
Name Type Description
arg0_geometry maptalks.Geometry
Returns:
Type:
turf.Geometry

(static) convertTurfToMaptalks(arg0_geometry) → {maptalks.Geometry}

Converts a turf.Geometry into a maptalks.Geometry

Source:
Parameters:
Name Type Description
arg0_geometry turf.Geometry
Returns:
Type:
maptalks.Geometry

(static) getCoordsType(arg0_format) → {String}

Returns the coords/geometry format the variable represents.

Source:
Parameters:
Name Type Description
arg0_format *

The coords/geometry format to input.

Returns:
Type:
String
  • Either 'geojson_coords'/'geojson_geometry'/'leaflet_coords'/'leaflet_geometry'/'maptalks_coords'/'maptalks_geometry'/'naissance_coords'/'naissance_geometry'/'turf_coords'/'turf_geometry'.

(static) getEquirectangularCoordsPixel(arg0_latitude, arg1_longitude, arg2_optionsopt) → {Array.<number, number>|Object}

Fetches the x, y coordinate pair for a given pixel given latitude and longitude coordinates for WGS84 Equirectangular.

Source:
Parameters:
Name Type Attributes Description
arg0_latitude number
arg1_longitude number
arg2_options Object <optional>
Name Type Attributes Default Description
return_object boolean <optional>
false

Whether to return a structured object instead.

Returns:
Type:
Array.<number, number> | Object

(static) getEquirectangularPixelCoords(arg0_x, arg1_y, arg2_widthopt, arg3_heightopt) → {Array.<number>}

Returns a [lat, lng] array for a given pixel coordinate.

Source:
Parameters:
Name Type Attributes Default Description
arg0_x number
arg1_y number
arg2_width number <optional>
4320
arg3_height number <optional>
2160
Returns:
Type:
Array.<number>

(static) getGoogleMapsCityCoords(arg0_city_name, arg1_optionsopt) → {Array.<number>}

Geolocates a city on Google Maps if possible.

Source:
Parameters:
Name Type Attributes Description
arg0_city_name string
arg1_options Object <optional>
Name Type Attributes Description
google_maps_api_key string <optional>
Returns:
Type:
Array.<number>

(static) getOSMCityCoords(arg0_city_name) → {Array.<number>}

Geolocates a city using OSM if possible.

Source:
Parameters:
Name Type Description
arg0_city_name string
Returns:
Type:
Array.<number>

(static) getPoleOfInaccessibility(arg0_feature, arg1_precisionopt) → {Array.<number>|null}

Finds the pole of inaccessibility for a GeoJSON feature. Depends on npm polylabel.

Source:
Parameters:
Name Type Attributes Default Description
arg0_feature Object
arg1_precision number <optional>
0.0001
Returns:
Type:
Array.<number> | null
  • [lat, lng]

(static) hashGeometry(arg0_geometry, arg1_optionsopt) → {string}

Hashes a geometry to detect duplicates and ensure uniqueness.

Source:
Parameters:
Name Type Attributes Description
arg0_geometry Geometry
arg1_options Object <optional>
Name Type Attributes Default Description
precision number <optional>
6

The precision to use when checking the hash.

Returns:
Type:
string

(static) haversineDistance(arg0_coords, arg1_coords) → {number}

Calculates the haversine distance in km between two [lng, lat] coords.

Source:
Parameters:
Name Type Description
arg0_coords Array.<number>
arg1_coords Array.<number>
Returns:
Type:
number

(static) isGeoJSONCoords(arg0_coords) → {boolean}

Whether the coords type being tested are loosely GeoJSON compatible.

Source:
Parameters:
Name Type Description
arg0_coords *
Returns:
Type:
boolean

(static) splitFeature(arg0_feature, arg1_divisor_layer) → {Array.<Feature>}

Splits a feature into multiple sections based on a divisor layer.

Source:
Parameters:
Name Type Description
arg0_feature Feature
arg1_divisor_layer FeatureCollection
Returns:
Type:
Array.<Feature>

(static) translatePoint(arg0_coords, arg1_x, arg2_y) → {Object}

Translates a point by X, Y in metres.

Source:
Parameters:
Name Type Description
arg0_coords maptalks.Coordinate | Array.<number>
arg1_x number
arg2_y number
Returns:
Type:
Object