Some idea about geolocalization with Solr

Geolocalization has made a great improvement in the last few years in every kind of user experience. The process of placing and visualizing data on a map has been generally a very useful, and it is also best suited for mobile applications. Providing geolocalization means at least finding out what coordinates should be used to link our data at some point in the geographic space; when we are using a smartphone these coordinates can be taken from its sensors, but if we are developing a search application, this data should be chosen more carefully.

In our paintings example, it's simple to imagine performing searches over the geographical location where a painting is actually located, as this can be an additional way to see the data. Unfortunately, the data we have used so far does not contain the information about coordinates. The best we can find is only the name (the English name, to be precise) of the city where a painting is actually stored, probably the city of the museum or private collection where it is located. Assuming that there are lot of services that provide coordinates for a specific city name on the Internet, a common task is to retrieve this kind of information from one of those services, and simply add them to our index. Some of the most well-known services, probably at the moment, providing geocoding information are as follows:

  • The Google Maps API
  • The OpenStreetMap API
  • Geonames downloadable dataset
  • The Linked Geo Data API and downloadable dataset

I only cited here some of the most used, but there are many others. A good one is, for example, the Nominatim API, provided by Open Street Map: http://wiki.openstreetmap.org/wiki/Nominatim

If you look at the information they collect for Paris from http://nominatim.openstreetmap.org/search?city=Paris&dedupe=1&format=json, you will see that there are many matches, but the first is indeed the Paris we are thinking about, and we have then the chance to retrieve its latitude and longitude, to be able to use them later for constructing a map of how our data should be geographically disposed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.98.14