NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Is there maybe any new easy way or api to get the BBOX of the city to use in mapnik to generate tiles?

For example if I have Paris, London, Hong-Kong etc.

How can I automatically or semiautomatically from some API get the BBOX of those cities, and then use it in mapnik's generate_tiles.py ????

asked 22 Aug '13, 07:37

Gevork's gravatar image

Gevork
234121422
accept rate: 0%

edited 22 Aug '13, 09:37

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866

1

I have found out that Yahoo Geo Api gives exactly what I want! You search for a city, and it gives you bounding box points!

(07 Sep '13, 17:50) Gevork

There are numerous ways to find a bbox manually: Overpass Turbo and the BBBike site are two which enable one to draw a box.

You, however, ask for an automated way. Probably the easiest way is to use Nominatim which returns a bounding box as part of its XML format. Care needs to taken with this because you may find yourself getting the node which marks the centre of a city rather than its administrative extent. Also, if by Paris, you mean the Parisian Metropolitan area then I think you can't get this from Nominatim.

Lastly, do not think of then using the bbox returned for direct API queries. The amount of data contained in the areas of large cities is very large, and this is not appropriate usage of the API: consider Overpass or similar methods.

permanent link

answered 22 Aug '13, 09:24

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

I don't want to draw anything. Each city has a polygonal outlined relations. There should be some way to request those and on basis of that calculate the quadrate. No?

(22 Aug '13, 10:21) Gevork
1

Do please read the answer, which is in the second paragraph (i.e., Nominatim).

Your question did not emphasise your desire for an automated approach, and at first glance seemed to ask how to find a bbox for a city.

(22 Aug '13, 10:24) SK53 ♦

You could also take a look at http://maposmatic.org/ 's code to see how they implemented the feature you describe, as part of a nice user interface.

(22 Aug '13, 12:22) Vincent de P... ♦

If you know the coordinates, you can download the data with

http://overpass-api.de/api/map?bbox=lower_lon,lower_lat,upper_lon,upper_lat

Other options for larger cities are downloads from the Geofabrik. Or setting a larger timeout on the respective Overpass API map query.

permanent link

answered 22 Aug '13, 07:55

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489
accept rate: 36%

1

The problem is that i don't know the BBOX itself. I need to generate tiles myself and not to download.

(22 Aug '13, 08:14) Gevork

You can go to openstreetmap.org, select "export", and then "manually select a different area". Shift-drag the box to the size that you want. Don't click export - just use those numbers in generate_tiles.py (making sure that you've commented out any areas already in generate_tiles.py).

Another helpful site is http://osm.duschmarke.de/bbox.html - use alt-drag, and you'll see bbox examples suitable for lots of programs.

permanent link

answered 22 Aug '13, 09:23

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

edited 22 Aug '13, 09:25

http://osm.duschmarke.de/bbox.html is perfect, but it has to be done again manually. If there was city search on it would be much easier.

(22 Aug '13, 10:19) Gevork

Also have a look at the XAPI Query Builder:

http://harrywood.co.uk/maps/uixapi/xapi.html

but it also has no search feature for a place name.

(22 Aug '13, 17:47) stephan75
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×30

question asked: 22 Aug '13, 07:37

question was seen: 7,015 times

last updated: 07 Sep '13, 19:28

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum