Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st_intersects() distance between points does not match with the precision parameter #34

Open
JoaoAlmeida opened this issue Mar 30, 2020 · 3 comments

Comments

@JoaoAlmeida
Copy link

The LinkedGeoData site has some examples of SPARQL queries. One example says it retrieves all amenities 100m from Leipzig Central Station. However, the SPARQL query results have much more distance than 100m from the Central Station.

The example's text is wrong, or the function is wrong?

Ps: I have verified the distance between the points using the OpenStreetMap site.

@JoaoAlmeida JoaoAlmeida changed the title st_intersects() distance between points does not match with precision parameter st_intersects() distance between points does not match with the precision parameter Mar 30, 2020
@TallTed
Copy link

TallTed commented Oct 8, 2020

There have been numerous improvements in Virtuoso's GeoSPARQL support (among other things) in the 4+ years since version 07.20.3215 built Jan 12 2016, which is backing the LinkedGeoData site.

It would be very helpful if the Virtuoso instance could be updated to a current build of Open Source Edition (as is currently in use), where I believe commits 82326dd and dc1e353 made in January 2020, may resolve the reported issue.

@JoaoAlmeida
Copy link
Author

I believe "st_intersects()" returns the distance in unit degrees. So, I am using the following equation to convert the distance into meters: distance [m] = 6378137.0 [m] * Pi * distance [degree] / 180.0

I am using this equation in my applications, and the results look fine.

@TallTed
Copy link

TallTed commented Oct 28, 2020

@JoaoAlmeida -- Starting with your equation, I compute the intended 100m distance in the cited example should instead be 0.000898315284 degrees.

( 100 * 180.0 ) / ( 6378137.0 * Pi ) = 0.000898315284

Substituting that value into the example query, I get a zero row result set.

Bumping the distance to 500m, inserting the new degree value in the query, I get a reasonably sized result set which may allow you to confirm that the results are as desired/expected ... and if so, that should be a clear enough demonstration that either the documentation should be changed to match (i.e., that the distance is specified in degrees, as calculated by your formula), or the function should be redefined within Virtuoso such that the distance is indeed specified in meters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants