[Talk-us] US map rendering (Was: Re: Spot elevations collected as natural=peak and name=Point (height in feet))

Kevin Kenny kevin.b.kenny at gmail.com
Sat Mar 9 03:37:37 UTC 2019


On Fri, Mar 8, 2019 at 5:46 PM Phil! Gold <phil_g at pobox.com> wrote:
> I started work last year on a better system that generates SVGs on the fly
> from OSM data, so it doesn't need the pregeneration step.  I got bogged
> down with other things before I quite finished, but it's mostly there.
It's really great hearing from you!  I had tried to message you a few
times through OSM and tried to find a working email for you, but never
heard anything back. I definitely had things I wanted to pick your
brain about!

> (There are just a few Canadian routes left to convert; I was having
> difficulty finding official specs for their signs.)

I think that between Minh and me, we have the signs for all ten Canadian
provinces, and a lot of Ontario counties. (The other provinces use a standard
'county highway' sign.)

I'll have a look at your code, but frankly, we've diverged an awful
lot at this point. I got kind of bogged down in the stored procedures,
because the requirement that the PostgreSQL filesystem be visible at
Mapnik's runtime was getting tangled up in the chroot jail on my
server, and the fact that a stock Mapnik now makes a read-only
connection to the database was also a stumbling block. (Even a trigger
firing from a read-only connection cannot update the database.) Rather
than running from forks, I wound up reworking things so that the SVG
generation happens when osmosis runs, rather than when the tile is
built, and that went a lot smoother.

I also pretty much totally reworked the stored procedures for better
readability, and to make them compatible with the GroupSymbolizer.
(Your shield clusters are gorgeous, but I found them to be a bridge
too far and decided to try out Mapnik's stock support.) Could I get
your opinion of
https://github.com/kennykb/osm-shields/blob/master/queryprocs.sql.in ?
 I think that might be a more maintainable starting point, and it also
appears to be faster - it's pretty zippy at render time.
>
> I don't think this is really documented yet, but I now support four
> different sign styles, passed as the `style` parameter to the Python
> rendering functions:
>
>  * "generic" uses a standard, generic style for every US state and county,
>    disregarding their individual styles.
>  * "guide" matches the styles used on highway guide signs.  This is now
>    the default, since it seems most fitting to map rendering.
>  * "sign" looks like the roadside reassurance markers.
>  * "cutout" is a modification of the "sign" style to remove dark
>    background areas.  This used to be the default with my old system.

Sounds reasonable. I'm making more use of pictorial shields than I
think you were, but in some cases that's a bad idea. I'd like to have
the 'guide' style, for instance, in place of all the pictorial shields
for the NY state parkways - the NY highway shield, but white-on-green
instead of black and white, with the parkway's initials.

> Anyway, the code is here:
>
>   https://gitlab.com/asciiphil/osm-shields
>
> Hopefully at some point I'll find time to finish up my changes.  (And,
> ideally, merge in all of the extra shields you and Minh have put
> together.)

Thanks, I'll have a look!



More information about the Talk-us mailing list