Skip to main content

@terascope/utils / geo

geo

Variables

geoJSONTypes

const geoJSONTypes: string[]

Source

packages/utils/src/geo.ts:49

Functions

geoContains()

geoContains(firstGeoEntity, secondGeoEntity): boolean

Returns true if the second geometry is completely contained by the first geometry. The interiors of both geometries must intersect and, the interior and boundary of the secondary geometry must not intersect the exterior of the first geometry.

Parameters

ParameterType
firstGeoEntityGeoInput
secondGeoEntityGeoInput

Returns

boolean

Source

packages/utils/src/geo.ts:340


geoContainsFP()

geoContainsFP(queryGeoEntity): (input) => boolean

When provided with geoInput that acts as the argument geo-feature, it will return a function that accepts any geoInput and checks to see if the new input contains the argument geo-feature

Parameters

ParameterType
queryGeoEntityGeoInput

Returns

Function

Parameters
ParameterType
inputunknown
Returns

boolean

Source

packages/utils/src/geo.ts:348


geoDisjoint()

geoDisjoint(firstGeoEntity, secondGeoEntity): boolean

Returns true if both geo entities have no overlap

Parameters

ParameterType
firstGeoEntityGeoInput
secondGeoEntityGeoInput

Returns

boolean

Source

packages/utils/src/geo.ts:576


geoDisjointFP()

geoDisjointFP(queryGeoEntity): (input) => boolean

Parameters

ParameterType
queryGeoEntityGeoInput

Returns

Function

Parameters
ParameterType
inputunknown
Returns

boolean

Source

packages/utils/src/geo.ts:560


geoIntersects()

geoIntersects(firstGeoEntity, secondGeoEntity): boolean

Returns true if both geo entities intersect each other, if one of the input geo entity is a point, it will check if the other geo-entity contains the point

Parameters

ParameterType
firstGeoEntityGeoInput
secondGeoEntityGeoInput

Returns

boolean

Source

packages/utils/src/geo.ts:541


geoIntersectsFP()

geoIntersectsFP(queryGeoEntity): (input) => boolean

Parameters

ParameterType
queryGeoEntityGeoInput

Returns

Function

Parameters
ParameterType
inputunknown
Returns

boolean

Source

packages/utils/src/geo.ts:545


geoPointWithinRange()

geoPointWithinRange(startingPoint, distanceValue, point): boolean

Parameters

ParameterType
startingPointGeoPointInput
distanceValuestring
pointGeoPointInput

Returns

boolean

Source

packages/utils/src/geo.ts:255


geoPointWithinRangeFP()

geoPointWithinRangeFP(startingPoint, distanceValue): (input) => boolean

Parameters

ParameterType
startingPointGeoPointInput
distanceValuestring

Returns

Function

Parameters
ParameterType
inputunknown
Returns

boolean

Source

packages/utils/src/geo.ts:270


geoPolyHasPoint()

geoPolyHasPoint<G>(polygon): (fieldData) => boolean

Type parameters

Type parameter
G extends Polygon | MultiPolygon

Parameters

ParameterType
polygonG | Feature<G, GeoJsonProperties>

Returns

Function

Parameters
ParameterType
fieldDataunknown
Returns

boolean

Source

packages/utils/src/geo.ts:239


geoRelationFP()

geoRelationFP(geoShape, relation): (input) => boolean

Parameters

ParameterType
geoShapeGeoInput
relationGeoShapeRelation

Returns

Function

Parameters
ParameterType
inputunknown
Returns

boolean

Source

packages/utils/src/geo.ts:285


geoWithin()

geoWithin(firstGeoEntity, secondGeoEntity): boolean

Returns true if the first geometry is completely within the second geometry. The interiors of both geometries must intersect and, the interior and boundary of the first geometry must not intersect the exterior of the second geometry

Parameters

ParameterType
firstGeoEntityGeoInput
secondGeoEntityGeoInput

Returns

boolean

Source

packages/utils/src/geo.ts:474


geoWithinFP()

geoWithinFP(queryGeoEntity): (input) => boolean

When provided with geoInput that acts as the parent geo-feature, it will return a function that accepts any geoInput and checks to see if the new input is within the parent geo-feature

Parameters

ParameterType
queryGeoEntityGeoInput

Returns

Function

Parameters
ParameterType
inputunknown
Returns

boolean

Source

packages/utils/src/geo.ts:482


inGeoBoundingBox()

inGeoBoundingBox(top_left, bottom_right, point): boolean

Parameters

ParameterType
top_leftGeoPointInput
bottom_rightGeoPointInput
pointGeoPointInput

Returns

boolean

Source

packages/utils/src/geo.ts:207


inGeoBoundingBoxFP()

inGeoBoundingBoxFP(top_left, bottom_right): (input) => boolean

Parameters

ParameterType
top_leftGeoPointInput
bottom_rightGeoPointInput

Returns

Function

Parameters
ParameterType
inputunknown
Returns

boolean

Source

packages/utils/src/geo.ts:221


isGeoJSON()

isGeoJSON(input): input is GeoShape | ESGeoShape

Parameters

ParameterType
inputunknown

Returns

input is GeoShape | ESGeoShape

Source

packages/utils/src/geo.ts:54


isGeoPoint()

isGeoPoint(input): boolean

Parameters

ParameterType
inputunknown

Returns

boolean

Source

packages/utils/src/geo.ts:190


isGeoShapeMultiPolygon()

isGeoShapeMultiPolygon(input): input is GeoShapeMultiPolygon

Parameters

ParameterType
inputunknown

Returns

input is GeoShapeMultiPolygon

Source

packages/utils/src/geo.ts:73


isGeoShapePoint()

isGeoShapePoint(input): input is GeoShapePoint

Parameters

ParameterType
inputunknown

Returns

input is GeoShapePoint

Source

packages/utils/src/geo.ts:63


isGeoShapePolygon()

isGeoShapePolygon(input): input is GeoShapePolygon

Parameters

ParameterType
inputunknown

Returns

input is GeoShapePolygon

Source

packages/utils/src/geo.ts:68


lookupTimezone()

lookupTimezone(input): string

Takes in a geo point like entity and returns the timezone of its location

Parameters

ParameterType
inputunknown

Returns

string

Source

packages/utils/src/geo.ts:657


makeCoordinatesFromGeoPoint()

makeCoordinatesFromGeoPoint(point): CoordinateTuple

Parameters

ParameterType
pointGeoPoint

Returns

CoordinateTuple

Source

packages/utils/src/geo.ts:235


makeGeoBBox()

makeGeoBBox(point1, point2): Feature<Polygon, GeoJsonProperties>

Parameters

ParameterType
point1GeoPoint
point2GeoPoint

Returns

Feature<Polygon, GeoJsonProperties>

Source

packages/utils/src/geo.ts:194


makeGeoCircle()

makeGeoCircle(point, distance, unitVal?): Feature<Polygon> | undefined

Parameters

ParameterType
pointGeoPoint
distancenumber
unitVal?GeoDistanceUnit

Returns

Feature<Polygon> | undefined

Source

packages/utils/src/geo.ts:247


makeGeoFeature()

makeGeoFeature(geoShape): Feature<any> | undefined

Converts a geoJSON object to its turf geo feature counterpart

Parameters

ParameterType
geoShapeunknown

Returns

Feature<any> | undefined

Source

packages/utils/src/geo.ts:308


makeGeoFeatureOrThrow()

makeGeoFeatureOrThrow(geoShape): Feature<any>

Converts a geoJSON object to its turf geo feature counterpart, will throw if not valid

Parameters

ParameterType
geoShapeunknown

Returns

Feature<any>

Source

packages/utils/src/geo.ts:325


parseGeoDistance()

parseGeoDistance(str): GeoDistanceObj

Parameters

ParameterType
strstring

Returns

GeoDistanceObj

Source

packages/utils/src/geo.ts:78


parseGeoDistanceUnit()

parseGeoDistanceUnit(input): GeoDistanceUnit

Parameters

ParameterType
inputstring

Returns

GeoDistanceUnit

Source

packages/utils/src/geo.ts:91


parseGeoPoint()

parseGeoPoint(point)

parseGeoPoint(point): GeoPoint

Convert an input into a Geo Point object with lat and lon

Parameters
ParameterType
pointunknown
Returns

GeoPoint

Source

packages/utils/src/geo.ts:148

parseGeoPoint(point, throwInvalid)

parseGeoPoint(point, throwInvalid): GeoPoint

Parameters
ParameterType
pointunknown
throwInvalidtrue
Returns

GeoPoint

Source

packages/utils/src/geo.ts:149

parseGeoPoint(point, throwInvalid)

parseGeoPoint(point, throwInvalid): GeoPoint | null

Parameters
ParameterType
pointunknown
throwInvalidfalse
Returns

GeoPoint | null

Source

packages/utils/src/geo.ts:150


polyHasHoles()

polyHasHoles(input): boolean

Parameters

ParameterType
inputGeoShape

Returns

boolean

Source

packages/utils/src/geo.ts:644


toGeoJSON()

toGeoJSON(input): GeoShape | undefined

Only able to convert geo-points to either a geo-json point or a simple polygon. There is no current support for creating polygon with holes or multi-polygon as of right now. geoJSON input is made sure to be properly formatted for its type value

Parameters

ParameterType
inputunknown

Returns

GeoShape | undefined

Source

packages/utils/src/geo.ts:590


toGeoJSONOrThrow()

toGeoJSONOrThrow(input): GeoShape

Parameters

ParameterType
inputunknown

Returns

GeoShape

Source

packages/utils/src/geo.ts:624


tzCacheLoaded()

tzCacheLoaded(): boolean

Returns

boolean

Source

packages/utils/src/geo.ts:667


validateListCoords()

validateListCoords(coords): any[]

Parameters

ParameterType
coordsCoordinateTuple[]

Returns

any[]

Source

packages/utils/src/geo.ts:634