You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code posted in the description on 2018/05/15 appears to have calculations for a sphere, which is a fast approximation, but not entirely accurate, for an oblate spheroid such as the Earth.
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.hive.serde2.io.DoubleWritable;
import com.esri.core.geometry.ogc.OGCGeometry;
import com.esri.core.geometry.ogc.OGCPoint;
import com.esri.hadoop.hive.GeometryUtils;
import com.esri.core.geometry.Point;
public class ST_Project extends UDF {
final DoubleWritable resultDouble = new DoubleWritable();
static double EARTH_RADIUS = 6378137.0;
static double degToRad(double deg) {
return (deg * Math.PI) / 180.0;
}
static double radToDeg(double rad) {
return (rad * 180.0) / Math.PI;
}
static double x;
static double y;
public static BytesWritable evaluate(BytesWritable geom, double distance, double bearing) {
The text was updated successfully, but these errors were encountered: