@terascope/utils / geo
geo
Variables
geoJSONTypes
const
geoJSONTypes:string
[]
Source
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Source
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
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
geoDisjoint()
geoDisjoint(
firstGeoEntity
,secondGeoEntity
):boolean
Returns true if both geo entities have no overlap
Parameters
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Source
geoDisjointFP()
geoDisjointFP(
queryGeoEntity
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Source
geoIntersectsFP()
geoIntersectsFP(
queryGeoEntity
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
geoPointWithinRange()
geoPointWithinRange(
startingPoint
,distanceValue
,point
):boolean
Parameters
Parameter | Type |
---|---|
startingPoint | GeoPointInput |
distanceValue | string |
point | GeoPointInput |
Returns
boolean
Source
geoPointWithinRangeFP()
geoPointWithinRangeFP(
startingPoint
,distanceValue
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
startingPoint | GeoPointInput |
distanceValue | string |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
geoPolyHasPoint()
geoPolyHasPoint<
G
>(polygon
): (fieldData
) =>boolean
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
Source
geoRelationFP()
geoRelationFP(
geoShape
,relation
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
geoShape | GeoInput |
relation | GeoShapeRelation |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Source
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
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
inGeoBoundingBox()
inGeoBoundingBox(
top_left
,bottom_right
,point
):boolean
Parameters
Parameter | Type |
---|---|
top_left | GeoPointInput |
bottom_right | GeoPointInput |
point | GeoPointInput |
Returns
boolean
Source
inGeoBoundingBoxFP()
inGeoBoundingBoxFP(
top_left
,bottom_right
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
top_left | GeoPointInput |
bottom_right | GeoPointInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
isGeoJSON()
isGeoJSON(
input
): input is GeoShape | ESGeoShape
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is GeoShape | ESGeoShape
Source
isGeoPoint()
isGeoPoint(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
isGeoShapeMultiPolygon()
isGeoShapeMultiPolygon(
input
):input is GeoShapeMultiPolygon
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is GeoShapeMultiPolygon
Source
isGeoShapePoint()
isGeoShapePoint(
input
):input is GeoShapePoint
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is GeoShapePoint
Source
isGeoShapePolygon()
isGeoShapePolygon(
input
):input is GeoShapePolygon
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is GeoShapePolygon
Source
lookupTimezone()
lookupTimezone(
input
):string
Takes in a geo point like entity and returns the timezone of its location
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
makeCoordinatesFromGeoPoint()
makeCoordinatesFromGeoPoint(
point
):CoordinateTuple
Parameters
Parameter | Type |
---|---|
point | GeoPoint |
Returns
CoordinateTuple
Source
makeGeoBBox()
makeGeoBBox(
point1
,point2
):Feature
<Polygon
,GeoJsonProperties
>
Parameters
Parameter | Type |
---|---|
point1 | GeoPoint |
point2 | GeoPoint |
Returns
Feature
<Polygon
, GeoJsonProperties
>
Source
makeGeoCircle()
makeGeoCircle(
point
,distance
,unitVal
?):Feature
<Polygon
> |undefined
Parameters
Parameter | Type |
---|---|
point | GeoPoint |
distance | number |
unitVal ? | GeoDistanceUnit |
Returns
Feature
<Polygon
> | undefined
Source
makeGeoFeature()
makeGeoFeature(
geoShape
):Feature
<any
> |undefined
Converts a geoJSON object to its turf geo feature counterpart
Parameters
Parameter | Type |
---|---|
geoShape | unknown |
Returns
Feature
<any
> | undefined
Source
makeGeoFeatureOrThrow()
makeGeoFeatureOrThrow(
geoShape
):Feature
<any
>
Converts a geoJSON object to its turf geo feature counterpart, will throw if not valid
Parameters
Parameter | Type |
---|---|
geoShape | unknown |
Returns
Feature
<any
>
Source
parseGeoDistance()
parseGeoDistance(
str
):GeoDistanceObj
Parameters
Parameter | Type |
---|---|
str | string |
Returns
GeoDistanceObj
Source
parseGeoDistanceUnit()
parseGeoDistanceUnit(
input
):GeoDistanceUnit
Parameters
Parameter | Type |
---|---|
input | string |
Returns
GeoDistanceUnit
Source
parseGeoPoint()
parseGeoPoint(point)
parseGeoPoint(
point
):GeoPoint
Convert an input into a Geo Point object with lat and lon
Parameters
Parameter | Type |
---|---|
point | unknown |
Returns
GeoPoint
Source
parseGeoPoint(point, throwInvalid)
parseGeoPoint(
point
,throwInvalid
):GeoPoint
Parameters
Parameter | Type |
---|---|
point | unknown |
throwInvalid | true |
Returns
GeoPoint
Source
parseGeoPoint(point, throwInvalid)
parseGeoPoint(
point
,throwInvalid
):GeoPoint
|null
Parameters
Parameter | Type |
---|---|
point | unknown |
throwInvalid | false |
Returns
GeoPoint
| null
Source
polyHasHoles()
polyHasHoles(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | GeoShape |
Returns
boolean
Source
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
Parameter | Type |
---|---|
input | unknown |
Returns
GeoShape
| undefined
Source
toGeoJSONOrThrow()
toGeoJSONOrThrow(
input
):GeoShape
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
GeoShape
Source
tzCacheLoaded()
tzCacheLoaded():
boolean
Returns
boolean
Source
validateListCoords()
validateListCoords(
coords
):any
[]
Parameters
Parameter | Type |
---|---|
coords | CoordinateTuple [] |
Returns
any
[]