long binId = PrimitiveObjectInspectorUtils.getLong(args[1].get(), oiBinId);
bins.queryEnvelope(binId, env);
} else {
// argument 1 is a geometry, attempt to get the envelope with a point
OGCPoint point = binPoint.getPoint(args);
if (point == null) {
return null;
}
bins.queryEnvelope(point.X(), point.Y(), env);
}
return GeometryUtils.geometryToEsriShapeBytesWritable(env, 0, OGCType.ST_POLYGON);
}