Search code examples
openstreetmaposmdroidmapquest

OSM Data on Barcelona, Spain


We are using osmbonuspack's API on Android to get a geocordinate from an address in Barcelona. We are calling org.osmdroid.bonuspack.location.GeocoderNominatim class and method getFromLocationName()

When we search for address Desemparats 18, it returns no result. But if we search for Desemparats then we get 1 result. From the JSON response:

{  
    "place_id":"9805611",
    "licence":"Data © OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright",
    "osm_type":"node",
    "osm_id":"961073607",
    "boundingbox":[  
        "41.3705229",
        "41.3706229",
        "2.1225643",
        "2.1226643"
    ],
    "lat":"41.3705729",
    "lon":"2.1226143",
    "display_name":"Mare de Déu dels Desemparats, Carrer Mossèn Jaume Busquets, la Torrassa, l'Hospitalet de Llobregat, BCN, Catalonia, 08094, Spain",
    "class":"amenity",
    "type":"place_of_worship",
    "importance":0.101,
    "icon":"http:\/\/nominatim.openstreetmap.org\/images\/mapicons\/place_of_worship_unknown3.p.20.png",
    "address":{  
        "place_of_worship":"Mare de Déu dels Desemparats",
        "pedestrian":"Carrer Mossèn Jaume Busquets",
        "suburb":"la Torrassa",
        "town":"l'Hospitalet de Llobregat",
        "county":"BCN",
        "state":"Catalonia",
        "postcode":"08094",
        "country":"Spain",
        "country_code":"es"
    }
}

It seems that the service does not have street address data for this one and so it only gave a random point on the street. And the reason Desemparats 18 returned without result is because it tried to match 18 with the post code.

Is there something we can do to get a more accurate response? i.e., be able to search for an address with a street/house number?

Or a question to MapQuest, is it really that Barcelona data is not rich enough? Because this address is really not remote.

Any thought and experience by anybody will be appreciated.


Solution

  • It is true that OSM only has very few addresses in this area. There is not much you can do about it except from improving it yourself. You could use a second geocoding service as fallback in case the preferred geocoder fails to return a valid result.