Hi,

I have exactly the same problem. Is there solution for that? I'm using 
OrientDB 2.0.5

In database, nodes are related as Country -> Region -> City -> Location 
where Location contains columns "lat" and "lon"

When I try to select 

   select from ( select expand(out('IN_REGION').out('IN_CITY')[category=1]) 
from #32:3) 
          where  [lat, lon, $spatial] NEAR [44.9060941, 12.0265446, 
{"maxDistance":15}]

No results returned, but when selecting directly from "Location" everything 
works as expected.

     select from Location  where  [lat, lon, $spatial] NEAR [45.9060941, 
17.0265446, {"maxDistance":15}]

Thanks,
Tom


Dana srijeda, 11. lipnja 2014. u 23:37:03 UTC+2, korisnik Jonathan Rosen 
napisao je:
>
> Is it possible to query a geospatial index through related nodes with the 
> lucene geospatial plugin? here is an example of what i'm trying to do.
>
> Let's say you have a simple database with real estate agents and the 
> houses they have shown over time. The db structure looks like this:
>
> Vertices:
> Agent (name, phone)
> House (address, lat, long)
>
> Edge:
> showed_house (property: date_shown)
>
> So, for example {#12:1 Rita} --showed_house(12/1/2014)--> {#13:1 1554 
> Treeline Ave}
>                                 
> Now, let's say I want to find all the houses that Rita has shown in the 
> last week, along with the date they were shown, that are near the current 
> user, Mark's, geolocation. For purposes of the example Mark's location is 
> lat: 40.312233, long: -71.2555
>
> This query does not seem to work:
>
> select out_showed_house.in, $distance from #12:1 where 
> [out_showed_house.in.latitude, out_showed_house.in.longitude, $spatial] 
> near [40.312233, -71.2555, {"maxDistance":22}] 
>
> However, if you turn it around, and do this query:
>
> select from house where [house.latitude, house.longitude, $spatial] near 
> [40.312233, -71.2555, {"maxDistance":22}] and #12:1 in in_showed_house.out
>
> that query works fine.
>
> I assume the reason for this is that the "from" clause of the query must 
> be against the class where you created the index. 
>
> Is there any way to make my first query work, so that I can pull only the 
> related edges I want from the target vertex? (in the scenario that works, I 
> have to pull all edges into each house, instead of only getting the 
> vertices from the real estate agent i'm interested in).
>
> Thanks,
>
> Jonathan
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" 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