If you application is written in Java with the embedded API, then Neo4j
Spatial has all the tools you need because it maked use of JTS internally
and so you can perform any JTS query you want. However, to benefit from the
RTree index to make the query fast will require that you also limit the
search scope somewhat. If you have an idea of a maximum distance you wish
to search you could solve this in two ways:

   1. Either - do an initial distance search finding all geometries within
   the maximum distance, and then perform a refinement on the resulting
   dataset to get only geometries that intersect the line of sight.
   2. Or - create the LineString for the line of sight, with a length
   matching your max distance, then perform an intersections search for all
   geometries that intersect this LineString, and select the closest.

This second option would only work in the Java API, but would be the
fastest since the search will only consider objects along the line of sight
in the RTree, so the index search is more selective than the distance
search option (which will search in all directions).

What API are you planning to use? That will restrict your options here a
lot.

On Thu, Nov 6, 2014 at 8:25 PM, Janobia Julka <[email protected]>
wrote:

> I'm trying to develop an application that accepts the latitude, longitude
> and direction (the direction that the phone is pointing in) from the user.
> I need to use the coordinates to find the first object (most likely a
> building) that is in the user's line of sight. This building will be stored
> as a polygon in the database. Is there a Neo4j query for this? I'm trying
> to answer a question similar to "Find all countries that are intersected by
> the Line of Capricon".
>
> Thanks for reading. I appreciate the help.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to