BajoSpatial

BajoSpatial class definition

Constructor

new BajoSpatial()

Creates an instance of BajoSpatial.

Members

config

Properties
NameTypeDescription
configobject

Configuration object

Methods

(async) buildBboxQuery(params) → {object}

Builds a bounding box query for a given model.

Parameters:
NameTypeDescription
paramsobject

Parameters for building the query.

Properties
NameTypeAttributesDefaultDescription
bboxstring

Bounding box coordinates.

queryobject<optional>
{}

Existing query object to merge with.

modelobject

Dobo model to apply the query to.

optionsobject<optional>
{}

Additional options for query building.

Properties
NameTypeAttributesDefaultDescription
bboxLatFieldstring<optional>
'lat'

Latitude field name in the model.

bboxLngFieldstring<optional>
'lng'

Longitude field name in the model.

Returns:
  • The modified query object with bounding box conditions.
Type: 
object

(async) getCountryBbox(item) → {Promise.<(string|undefined)>}

Gets the bounding box for a given country ID. Requires the bajoCommonDb and dobo plugins to be available. Otherwise, it will return undefined.

Parameters:
NameTypeDescription
itemstring

Country ID.

Returns:
  • The bounding box string or undefined if not found.
Type: 
Promise.<(string|undefined)>

(async) parseBbox(input) → {Promise.<(Array.<number>|undefined)>}

Parses a bounding box input.

Parameters:
NameTypeDescription
inputstring

The bounding box input, either a country ID or coordinates.

Returns:
  • The parsed bounding box coordinates or undefined if not found.
Type: 
Promise.<(Array.<number>|undefined)>