Alexander Sidorov wrote:
> Hello!
> 
> What is the most efficient way of filtering geomerty objects by
> latitude/longitude? I need to retrieve LinkedGeoData objects inside some
> rectangular boundaries. Here is how I filter objects now :
> 
> where
> {
>   ?entity geo:lat ?lat .
>   ?entity geo:long ?long .
>   FILTER ( ?lat >= 56.4881360279505 && ?lat <= 56.5118226056529 && ?long >=
> 84.9451732635498 && ?long <= 84.9880886077881 )
> }
> 
> One more possible implementation:
> 
> where
> {
>   ?entity geo:geometry ?geo .
>   FILTER ( bif:st_y(?geo) >= 56.4881360279505 && bif:st_y(?geo) <=
> 56.5118226056529 && bif:st_x(?geo) >= 84.9451732635498 && bif:st_x(?geo) <=
> 84.9880886077881 )
> }
> 
> What is the most efficient way?

I would have though st_within [1] would have been fastest, but you could
just run the three versions and time each one to see which is fastest.

http://docs.openlinksw.com/virtuoso/fn_st_within.html

Best,

Nathan

Reply via email to