[OSM-talk] simplifying mapnik layout definition

Tom Hughes tom at compton.nu
Tue May 27 20:58:25 BST 2008


Martijn van Oosterhout wrote:
> On Tue, May 27, 2008 at 7:29 PM, Robert (Jamie) Munro <rjmunro at arjam.net> wrote:
>> Here's some working code that simplifies the file:
>> sed "s/(\[bridge] = 'yes' or \[bridge]='true')/isBridge/g" osm.xml
>>
>> And the reverse:
>> sed "s/isBridge/([bridge] = 'yes' or [bridge]='true')/g"
> 
> I'm thinking of teaching osm2pgsql and Mapnik about booleans at some
> point so that all the comparisons against yes/no/1/0/on/off/etc all
> get done during import. For this to work Mapnik needs to be able to
> handle comparing different types, I sent a patch to Jon to do this so
> hopefully at some point we can simplify at least that portion...

I've already taught mapnik about booleans - if you have a postgresql 
boolean column called 'bridge' then you can use '[bridge]' or 'not 
[bridge]' as filters.

Tom

-- 
Tom Hughes (tom at compton.nu)
http://www.compton.nu/




More information about the talk mailing list