Wrong boundingbox coordinates for some cities?

I played around with the nominatim API to geocode some addresses. I take the boundingbox coordinates the API gives me and use google maps to set the bounds. So that if I enter “London” the map gets centered to London. This works for most cities but there are some exceptions like Berlin. It will not center the map showing Berlin but a specific place in Berlin. If I look to the boundings I see that lat1/lat2 and lng1/lng2 are nearly the same:


["52.5170364379883","52.5170402526855","13.3888597488403","13.3888607025146"]

...

"display_name":"Berlin, Deutschland, Europ\u00e4ische Union","class":"place","type":"city"

So is there a better way to achieve what I like to do or are the bounding box coordinates just wrong. If yes how can I help correcting them?

please tell us your api-call and the results.

Bad boy :wink:

regards
walter

I use the following API call:

http://nominatim.openstreetmap.org/search?q=Berlin&format=json

And always use the first result of the response (highest importance).

For Berlin is this the admin_centre in the boundary-relation. London and other cities doesn’t have admin_centres set.

Christian

Okay… so is there any possbility to get a boundingbox which let me display the whole city as large as possible on the map?

In a first step I would ignore entries with

"osm_type":"node"

Georg

Wow that did the trick! Googled for osm_type description but I haven’t found clear information what’s this exactly… may you explain what this attribute is used for?

http://wiki.openstreetmap.org/wiki/Elements

for boundaries you should also take a look at: http://wiki.openstreetmap.org/wiki/Relation:boundary