Closed fragrantic closed 3 years ago
On what input? What is the expected result? What is the actual result?
If you are familiar white postgis which is a spatial extension of postgres, it comes with a lot of spatial function one of them being ST_Project, ST_Project — Returns a POINT projected from a start point using a distance in meters and bearing (azimuth) in radians. Now if I were to execute this function like this : select st_astext(st_project(st_point(0,0), 100000, radians(45))) I get this as a result: Point(0.63523085373227,0.6351918164606) And if you were to do the same thing in postgres I get this : Point(0.635231029125537,0.639472334729198)
The code posted in the description on 05/14 appears to have calculations for a sphere, which is a fast approximation, but not entirely accurate, for an oblate spheroid such as the Earth.
So what am I supposed to do ?
If the question is how to use a Geometry API to apply a geodesic displacement, you might try asking under the Esri Geometry API for Java or at a general programming Q&A forum.
Thank you I will do so
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();