use of org.apache.pig.backend.executionengine.ExecException in project pigeon by aseldawy.
the class IsValid method exec.
@Override
public Boolean exec(Tuple input) throws IOException {
Geometry geom = null;
try {
Object v = input.get(0);
geom = geometryParser.parseGeom(v);
return geom.isValid();
} catch (ExecException ee) {
throw new GeoException(geom, ee);
}
}
use of org.apache.pig.backend.executionengine.ExecException in project pigeon by aseldawy.
the class IsEmpty method exec.
@Override
public Boolean exec(Tuple input) throws IOException {
OGCGeometry geom = null;
try {
Object v = input.get(0);
geom = geometryParser.parseGeom(v);
return geom.isEmpty();
} catch (ExecException ee) {
throw new GeoException(geom, ee);
}
}
use of org.apache.pig.backend.executionengine.ExecException in project pigeon by aseldawy.
the class Overlaps method exec.
@Override
public Boolean exec(Tuple input) throws IOException {
OGCGeometry geom1 = null, geom2 = null;
try {
geom1 = geometryParser.parseGeom(input.get(0));
geom2 = geometryParser.parseGeom(input.get(1));
return geom1.overlaps(geom2);
} catch (ExecException ee) {
throw new GeoException(geom1, geom2, ee);
}
}
use of org.apache.pig.backend.executionengine.ExecException in project pigeon by aseldawy.
the class Touches method exec.
@Override
public Boolean exec(Tuple input) throws IOException {
OGCGeometry geom1 = null, geom2 = null;
try {
geom1 = geometryParser.parseGeom(input.get(0));
geom2 = geometryParser.parseGeom(input.get(1));
return geom1.touches(geom2);
} catch (ExecException ee) {
throw new GeoException(geom1, geom2, ee);
}
}
use of org.apache.pig.backend.executionengine.ExecException in project pigeon by aseldawy.
the class XMin method exec.
@Override
public Double exec(Tuple input) throws IOException {
Object v = input.get(0);
Geometry geom = geometryParser.parseGeom(v);
Coordinate[] coords = geom.getEnvelope().getCoordinates();
if (coords.length == 0)
throw new ExecException("XMin cannot work on empty geometires");
if (coords.length == 1)
return coords[0].x;
if (coords.length == 2)
return Math.min(coords[0].x, coords[1].x);
return Math.min(coords[0].x, coords[2].x);
}
Aggregations