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
{{ message }}
Repository navigation
program hangs while calling geodesicDistanceOnWGS84 #75
Hi Experts,
I have a classification program in spark that uses ESRI Geometry library. However my spark program hangs at this stage. Looking at stack dump it seems there is a set of points for which geodesicDistanceOnWGS84 hangs.
Is there such a pair of points for which I am expected to see such behavior?
I just ran a test in Spark using the above GeometryEngine.geodesicDistanceOnWGS84 method and could not get it to hang. It seems strange that it's happening in native Java code. What operating system are you using? Java Version?
Hi @climbage . Sorry for the delayed response.
My java version is Oracle JDK 7.45. Centos 6.6
This behaviour of hanging only happens for certain value of geometry Point.
My work around was to print the Point before calling geodesicDistanceOnWGS84 function.
The value of Point that hangs geodesicDistanceOnWGS84 causes printing of the same to crash.
I catch the exception and don't call geodesicDistanceOnWGS84 for those odd Point values.
What I have not been able to figure out is in which case I end up creating a Point that manifests this behaviour.
I have what I believe is a reproducible test case in #100.
When trying to compute the distance between a pair of points (using geometry-api-java, 1.2.1), this pair of points seems to hang the library. Here is the code I used (Scala 2.10.5):
import com.esri.core.geometry.{GeometryEngine, Point, SpatialReference}
object testDistanceFailure {
val p1 = new Point(-60.668485,-31.996013333333334)
val p2 = new Point(119.13731666666666,32.251583333333336)
GeometryEngine.geodesicDistanceOnWGS84(p1,p2)
}
Activity
stolstov commentedon Feb 2, 2015
@manasdebashiskar I am not aware of such behavior. Do you have a repro case to debug?
climbage commentedon Feb 2, 2015
I just ran a test in Spark using the above
GeometryEngine.geodesicDistanceOnWGS84method and could not get it to hang. It seems strange that it's happening in native Java code. What operating system are you using? Java Version?manasdebashiskar commentedon Feb 7, 2015
Hi @climbage . Sorry for the delayed response.
My java version is Oracle JDK 7.45. Centos 6.6
This behaviour of hanging only happens for certain value of geometry Point.
My work around was to print the Point before calling geodesicDistanceOnWGS84 function.
The value of Point that hangs geodesicDistanceOnWGS84 causes printing of the same to crash.
I catch the exception and don't call geodesicDistanceOnWGS84 for those odd Point values.
What I have not been able to figure out is in which case I end up creating a Point that manifests this behaviour.
climbage commentedon Feb 7, 2015
Interesting... It seems like there is an issue with a
doublevalue in your point. I'm not sure how that's even possible.Do you have the stack trace for when it crashes on print? Also, what is the name of the exception it throw?
randallwhitman commentedon Feb 9, 2015
Another thing you could try is, what happens if you call
getXandgetYrather thantoString(which I assume is being called to print the point)?movermeyer commentedon Dec 21, 2015
I have what I believe is a reproducible test case in #100.
When trying to compute the distance between a pair of points (using geometry-api-java, 1.2.1), this pair of points seems to hang the library. Here is the code I used (Scala 2.10.5):
alocke commentedon Dec 21, 2015
I can reproduce this on Windows using native Java code. We will get this fixed. Thanks!
movermeyer commentedon Dec 21, 2015
Here are some other examples of pairs of points:
Notice that the absolute value of the x values sum to near 180, and the y values are nearly * -1 of each other.
IDK if you needed more examples or not.
alocke commentedon Dec 21, 2015
Good observation. I will add these cases to my test suite.
stolstov commentedon Dec 21, 2015
@daburrows The issue is in the GeoDist.java. It has bad termination condition.
The sin_azeq-prev is stuck around 2e-14, while tol is 1e-14.
movermeyer commentedon Dec 22, 2015
Is there any estimate for how long this will take to fix?
I've got a workaround (for my use case) that simply doesn't attempt to call your code if the difference in longitudes is too great.
Obviously, this means that I'm unable to do 100% of the computations, but thankfully my use case is OK with some data loss.
stolstov commentedon Jan 7, 2016
fixed