latitude and longitude for Geographical Bounding Box Search

2 views
Skip to first unread message

Go S

unread,
Aug 2, 2018, 11:02:21 AM8/2/18
to Europeana API forum
Hello folks,

Can anybody explain how to specify latitude and longitude for Geographical Bounding Box Search?
I try to set a range for North-South and East-West, but the query syntax (and think globally)
is a bit confusing partly because + is used to specify a range.

1) How to specify from 50 North to 10 South, and from 30 West to 10 East, for example? Is it something like the following?
pl_wgs84_pos_lat:[-10+TO+50]
pl_wgs84_pos_long:[-30+TO+10]
Is is always this order? Can we go another way?
pl_wgs84_pos_lat:[50+TO+-10]
pl_wgs84_pos_long:[10+TO+-30]

2) What about specifying a longitude range from Vietnam (say 105 E) to California (say 120 W) (across Pacific, or the other way round)?
pl_wgs84_pos_long:[105+TO+-120]?

On the documentation website, this is the example:
http://www.europeana.eu/api/v2/search.json?wskey=xxxx&query=pl_wgs84_pos_lat:[45+TO+47]+AND+pl_wgs84_pos_long:[7+TO+8]

Many thanks!
Go

Fred Leeflang

unread,
Aug 2, 2018, 11:51:22 AM8/2/18
to Europeana API forum
It looks like Europeana staff is no longer responding to questions here :(

James Morley

unread,
Aug 2, 2018, 4:58:45 PM8/2/18
to europe...@googlegroups.com
Good questions!  I don't know the answers for sure, so you might have to just play around to test it.

That said, I think the answer to Q1 is that it will always interpret the order as moving west-east or south to north. That makes sure that e.g. lat:[45 TO 47] will be 2 degrees, as opposed to [47 to 45] which will actually be 358 degrees.  This also suggests that it will handle the date line issue OK.

I agree about the confusion with the + but that's just using that character to symbolise a space in the url. 
&query=pl_wgs84_pos_lat:[45%20TO%2047]%20AND%20pl_wgs84_pos_long:[7%20TO%208] works equally well.

By the way, if it's of any use there's a clunky old php code snippet of mine that makes a BBOX request using this method and returns simplified geojson - see 

Best, James

---
James Morley


--
Visit Europeana Labs for API Documentation, Open Datasets, and our Apps Showcase - http://labs.europeana.eu
---
You received this message because you are subscribed to the Google Groups "Europeana API forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to europeanaAPI...@googlegroups.com.
To post to this group, send email to europe...@googlegroups.com.
Visit this group at https://groups.google.com/group/europeanaAPI.
For more options, visit https://groups.google.com/d/optout.

Hugo Manguinhas

unread,
Aug 2, 2018, 5:25:37 PM8/2/18
to europe...@googlegroups.com
Dear Go and James,

Thank you for your email!

The  pl_wgs84_pos_lat field is being indexed as string in Solr. This means that the range will be done in lexicographic order. Also a note that since there may be more than one Place associated to a record and since the fields will be therefore flattened, it may be that the query matches a latitude of a Place vs a longitude of another.

We are planning to make a revision of all the fields that we presently support so that we can offer a better support for such use cases.

Kind regards,
The API team


Hugo Manguinhas

unread,
Aug 2, 2018, 5:26:39 PM8/2/18
to europe...@googlegroups.com
Dear Fred,

Thank you for raising to our attention Go's email.

Sincerely,
The API team

--
Reply all
Reply to author
Forward
0 new messages