public class GeoOperator extends Object
Here are some examples:
// compute the distance between two points
[distance] = geo().distance([source], [dest]);
// compute the area of a geoshape
[area] = geo().area([surface]);
For this to work, your tuple must contain valid geo-json data.
You can explicitly check your tuples are geo-tuple using :
[surface] = [input].asGeoShape();
This will throw a PunchRuntimeException
should your input data be invalid.Constructor and Description |
---|
GeoOperator() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Tuple t1,
Tuple t2)
Return if the geoFeatureTuple T1 geometry contains geoFeatureTuple T2
|
Double |
distance(Tuple t1,
Tuple t2)
Return a distance between two tuples.
|
double |
getArea(Tuple t)
Get Area of Geometry of GeoFeatureTuple
|
Boolean |
intersect(Tuple t1,
Tuple t2)
Return if the geometries of T1 geoFeatureTuple have a least one pint in common with Geometry of T2
geoFeatureTuple
|
public Double distance(Tuple t1, Tuple t2)
t1
- first tuplet2
- second tuplepublic boolean contains(Tuple t1, Tuple t2)
t1
- : the first geoFeatureTuple t1t2
- : the first geoFeatureTuple t2public double getArea(Tuple t)
t
- : GeoFeature tuplepublic Boolean intersect(Tuple t1, Tuple t2)
t1
- : the first geoFeatureTuple t1t2
- : the first geoFeatureTuple t2Copyright © 2022. All rights reserved.