@terascope/utils / geo
geo
Variables
geoJSONTypes
const
geoJSONTypes:string
[]
Defined in: packages/utils/src/geo.ts:49
Functions
geoContains()
geoContains(
firstGeoEntity
,secondGeoEntity
):boolean
Defined in: packages/utils/src/geo.ts:340
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
geoContainsFP()
geoContainsFP(
queryGeoEntity
): (input
) =>boolean
Defined in: packages/utils/src/geo.ts:348
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
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
geoDisjoint()
geoDisjoint(
firstGeoEntity
,secondGeoEntity
):boolean
Defined in: packages/utils/src/geo.ts:576
Returns true if both geo entities have no overlap
Parameters
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
geoDisjointFP()
geoDisjointFP(
queryGeoEntity
): (input
) =>boolean
Defined in: packages/utils/src/geo.ts:560
Parameters
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
geoIntersects()
geoIntersects(
firstGeoEntity
,secondGeoEntity
):boolean
Defined in: packages/utils/src/geo.ts:541
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
geoIntersectsFP()
geoIntersectsFP(
queryGeoEntity
): (input
) =>boolean
Defined in: packages/utils/src/geo.ts:545
Parameters
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
geoPointWithinRange()
geoPointWithinRange(
startingPoint
,distanceValue
,point
):boolean
Defined in: packages/utils/src/geo.ts:255
Parameters
Parameter | Type |
---|---|
startingPoint | GeoPointInput |
distanceValue | string |
point | GeoPointInput |
Returns
boolean
geoPointWithinRangeFP()
geoPointWithinRangeFP(
startingPoint
,distanceValue
): (input
) =>boolean
Defined in: packages/utils/src/geo.ts:270
Parameters
Parameter | Type |
---|---|
startingPoint | GeoPointInput |
distanceValue | string |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
geoPolyHasPoint()
geoPolyHasPoint<
G
>(polygon
): (fieldData
) =>boolean
Defined in: packages/utils/src/geo.ts:239
Type Parameters
Type Parameter |
---|
G extends Polygon | MultiPolygon |
Parameters
Parameter | Type |
---|---|
polygon | G | Feature <G , GeoJsonProperties > |
Returns
Function
Parameters
Parameter | Type |
---|---|
fieldData | unknown |
Returns
boolean
geoRelationFP()
geoRelationFP(
geoShape
,relation
): (input
) =>boolean
Defined in: packages/utils/src/geo.ts:285
Parameters
Parameter | Type |
---|---|
geoShape | GeoInput |
relation | GeoShapeRelation |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
geoWithin()
geoWithin(
firstGeoEntity
,secondGeoEntity
):boolean
Defined in: packages/utils/src/geo.ts:474
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
geoWithinFP()
geoWithinFP(
queryGeoEntity
): (input
) =>boolean
Defined in: packages/utils/src/geo.ts:482
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
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
inGeoBoundingBox()
inGeoBoundingBox(
top_left
,bottom_right
,point
):boolean
Defined in: packages/utils/src/geo.ts:207
Parameters
Parameter | Type |
---|---|
top_left | GeoPointInput |
bottom_right | GeoPointInput |
point | GeoPointInput |
Returns
boolean
inGeoBoundingBoxFP()
inGeoBoundingBoxFP(
top_left
,bottom_right
): (input
) =>boolean
Defined in: packages/utils/src/geo.ts:221
Parameters
Parameter | Type |
---|---|
top_left | GeoPointInput |
bottom_right | GeoPointInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
isGeoJSON()
isGeoJSON(
input
): input is GeoShape | ESGeoShape
Defined in: packages/utils/src/geo.ts:54
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is GeoShape | ESGeoShape
isGeoPoint()
isGeoPoint(
input
):boolean
Defined in: packages/utils/src/geo.ts:190
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
isGeoShapeMultiPolygon()
isGeoShapeMultiPolygon(
input
):input is GeoShapeMultiPolygon
Defined in: packages/utils/src/geo.ts:73
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is GeoShapeMultiPolygon
isGeoShapePoint()
isGeoShapePoint(
input
):input is GeoShapePoint
Defined in: packages/utils/src/geo.ts:63
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is GeoShapePoint
isGeoShapePolygon()
isGeoShapePolygon(
input
):input is GeoShapePolygon
Defined in: packages/utils/src/geo.ts:68
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is GeoShapePolygon
lookupTimezone()
lookupTimezone(
input
):string
Defined in: packages/utils/src/geo.ts:657
Takes in a geo point like entity and returns the timezone of its location
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
makeCoordinatesFromGeoPoint()
makeCoordinatesFromGeoPoint(
point
):CoordinateTuple
Defined in: packages/utils/src/geo.ts:235
Parameters
Parameter | Type |
---|---|
point | GeoPoint |
Returns
CoordinateTuple
makeGeoBBox()
makeGeoBBox(
point1
,point2
):Feature
<Polygon
,GeoJsonProperties
>
Defined in: packages/utils/src/geo.ts:194
Parameters
Parameter | Type |
---|---|
point1 | GeoPoint |
point2 | GeoPoint |
Returns
Feature
<Polygon
, GeoJsonProperties
>
makeGeoCircle()
makeGeoCircle(
point
,distance
,unitVal
?):undefined
|Feature
<Polygon
,GeoJsonProperties
>
Defined in: packages/utils/src/geo.ts:247
Parameters
Parameter | Type |
---|---|
point | GeoPoint |
distance | number |
unitVal ? | GeoDistanceUnit |
Returns
undefined
| Feature
<Polygon
, GeoJsonProperties
>
makeGeoFeature()
makeGeoFeature(
geoShape
):undefined
|Feature
<any
,GeoJsonProperties
>
Defined in: packages/utils/src/geo.ts:308
Converts a geoJSON object to its turf geo feature counterpart
Parameters
Parameter | Type |
---|---|
geoShape | unknown |
Returns
undefined
| Feature
<any
, GeoJsonProperties
>
makeGeoFeatureOrThrow()
makeGeoFeatureOrThrow(
geoShape
):Feature
<any
>
Defined in: packages/utils/src/geo.ts:325
Converts a geoJSON object to its turf geo feature counterpart, will throw if not valid
Parameters
Parameter | Type |
---|---|
geoShape | unknown |
Returns
Feature
<any
>
parseGeoDistance()
parseGeoDistance(
str
):GeoDistanceObj
Defined in: packages/utils/src/geo.ts:78
Parameters
Parameter | Type |
---|---|
str | string |
Returns
GeoDistanceObj
parseGeoDistanceUnit()
parseGeoDistanceUnit(
input
):GeoDistanceUnit
Defined in: packages/utils/src/geo.ts:91
Parameters
Parameter | Type |
---|---|
input | string |
Returns
GeoDistanceUnit
parseGeoPoint()
Call Signature
parseGeoPoint(
point
):GeoPoint
Defined in: packages/utils/src/geo.ts:148
Convert an input into a Geo Point object with lat and lon
Parameters
Parameter | Type |
---|---|
point | unknown |
Returns
GeoPoint
Call Signature
parseGeoPoint(
point
,throwInvalid
):GeoPoint
Defined in: packages/utils/src/geo.ts:149
Convert an input into a Geo Point object with lat and lon
Parameters
Parameter | Type |
---|---|
point | unknown |
throwInvalid | true |
Returns
GeoPoint
Call Signature
parseGeoPoint(
point
,throwInvalid
):null
|GeoPoint
Defined in: packages/utils/src/geo.ts:150
Convert an input into a Geo Point object with lat and lon
Parameters
Parameter | Type |
---|---|
point | unknown |
throwInvalid | false |
Returns
null
| GeoPoint
polyHasHoles()
polyHasHoles(
input
):boolean
Defined in: packages/utils/src/geo.ts:644
Parameters
Parameter | Type |
---|---|
input | GeoShape |
Returns
boolean
toGeoJSON()
toGeoJSON(
input
):undefined
|GeoShape
Defined in: packages/utils/src/geo.ts:590
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
Parameter | Type |
---|---|
input | unknown |
Returns
undefined
| GeoShape
toGeoJSONOrThrow()
toGeoJSONOrThrow(
input
):GeoShape
Defined in: packages/utils/src/geo.ts:624
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
GeoShape
tzCacheLoaded()
tzCacheLoaded():
boolean
Defined in: packages/utils/src/geo.ts:667
Returns
boolean
validateListCoords()
validateListCoords(
coords
):any
[]
Defined in: packages/utils/src/geo.ts:634
Parameters
Parameter | Type |
---|---|
coords | CoordinateTuple [] |
Returns
any
[]