I have a Tilemill project the size of europe. I developed my style-sheet by using a smaller dataset (size auf Austria) and everything was perfect. But now I did apply the same styles to my big europe dataset which is in a PostgreSQL database and it's not rendering anything.

I had a look at what takes so long and it seems as if it is PostgreSQL. I already added all kinds of indexes to my tables, but that doesn't seem to help.

As a starting point I used OSM-Bright and that added a layer called landuse-gen0. It pulls in all the polygons of a certain size.

SELECT way, way_area AS area, COALESCE(landuse, leisure, "natural", highway, amenity, tourism) AS type
  FROM planet_osm_polygon
  WHERE way_area > 100000
  ORDER BY way_area DESC;

This query result in 3,4M rows. Each has about 10k... which would result in about 34 GB of data just for this one query. But Tilemill is doing a lot of those queries.... And tilemill seems to also be limiting the Bounding-Box AFTER my query... which is pretty inefficient, isn't it?

Any way I can improve my performance? Cause right now nothing is rendered... even if I wait one hour... not even one tile...

Btw. the computer it's running on has 16 cores and 120GB RAM... so hardware shouldn't be the big problem here...

Thanks for any tip!

  • 1
    System is not tuned for the requested map scale if it selects 3,4M polygons for rendering. Imagine a map of Europe or look at some examples worldatlas.com/webimage/countrys/eu.htm. Your landuse-gen0 layer contains all the polygons which are more than 10 hectars. In a scale that shows the whole Europe it would be enough to select about 100 biggest lakes as in openstreetmap.org/#map=4/59.69/9.76&layers=Q. The solution to your problem is to create new rules for low zoom levels. Hardware may be your problem, a poor computer could make you think even harder.
    – user30184
    Sep 2, 2014 at 20:53
  • 2
    Hm... I did some more research yesterday and found that the number in way_area seems to be odd... The OSM-Bright Template (which I started from) used a > 100000 WHERE clausal. But it seems as that's a super small size. I have no idea which unit osm2pgsql was using here. A lake in Austria, 13km2 big, has 28.000.000 units... So I guess the problem should be there? Do you have any idea which unit way_area is and how to change it to like sqare meters/kilometers?
    – Georg
    Sep 3, 2014 at 4:40
  • Have you found a good solution for using a Europe dataset with OSM-Bright? I am having the same issue that it does render with The Netherlands, but not with Europe. Wondering if I can optimize queries/styles to let TileMill handle it. Here is the question I made about the subject: gis.stackexchange.com/questions/120701/… Nov 5, 2014 at 8:24
  • Hello Thermometer, i ended up using adopted way_area size clauses and i added smaller way-fields to the database to display at lower zoom levels. I used PostGis to create them (ST_simplify). That helps speed up things A LOT! Would be interested what other things you do to display your map efficiently :)
    – Georg
    Nov 8, 2014 at 16:32


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.