MapQuest / MapQuest-Mapnik-Style

MapQuest Branded style for use with Mapnik and OSM
open.mapquest.co.uk
93 stars 25 forks source link

Externalizing SQL, Increased Road Labeling and Reorganizing Street Text Layers #6

Closed stellaraccident closed 13 years ago

stellaraccident commented 13 years ago

Hi there, Could you have a look at this commit: https://github.com/stellaeof/MapQuest-Mapnik-Style/commit/1eefe592718737f8031a81eaf6128b069eae643e

There are three things going on here. The first one, I think should definitely be finished and make it into your repo. The other two have helped me out but you may or may not want them. Sorry to have committed them in one go:

  1. Start externalizing sql. I created a sql entity referencing individual sql files and then include the sql by name in the layers. I have done this (mostly) to the transportation and streetnames layers in the us. Having the SQL broken out helped me understand what was going on and made sure that it was consistent between layers
  2. Increased road labeling. In the 'street text' style, I added a rule to render tertiary street names at zoom level 15. Level 15 is a pretty useful scale and needed more labels in my opinion. I have it as a separate rule because I am still playing with options to get the density I'm after. I used a hack that adds spaces as prefix and suffix to the name via an expression to simulate padding and keep things from scrunching up to closely.
  3. Reorganize street text layers. I added the columns required for the street name styles to each of the SQL queries for street1,2,3, etc. This will create no overhead on layers that do not have styles that reference these columns and allows us to have that many fewer sql statements. I also expanded the labeling layers so that instead of just doing one "big dip" into the database to get everything that is "road-ish", it discretely renders the text for each road classification separately.

Several of these changes were motivated by a tool I am using that discovers commonalities in the map data and coalesces it on disk. It works better if you have less arbitrary sql running around since it can clearly determine that different layers are referencing the same data. The tool also can be used to generate different detail level batches by simplifying all of the data in one go for higher scale rendering. With that said, even if you are not using this optimization tool, I think these changes are in line with good map file design and should be taken.

zerebubuth commented 13 years ago

I like the idea of moving the SQL into separate files - anything that can be done to reduce duplication. I've reverted the bit that's adding spaces around road names for the moment, but I'd be interested in seeing what the result of your experiments with name density are.

I've also pulled in a bunch of changes we had staged (sorry, should have pushed them earlier and not in a big lump like this) which I hope won't have too much of a knock-on effect on what you're working on.

Thanks again!