PGMapCSS is a library for PostgreSQL/PostGIS which works between an osm2pgsql based database and Mapnik (and maybe other renderers). It processes database (usually OpenStreetMap) objects according to MapCSS rules and calculates resulting colors, widths and other properties for Symbolizers, even geometric modifications.
It would be great if it would be possible to use (global) variables. Similar to less these could be prefixed by '@'. So that a variable gets global, it should first be used in global space. Example (similar to #77, but rather extending it):
/* initialize variable @list with an empty list, making it global */
@list: list();
/* process all peaks ordered by elevation downward */
node[natural=peak]:order-numerical-desc(ele) {
/* to @list append the name of the current map feature */
@list: append(@list, tag("name"));
}
/* print current @list to stderr, which should be the names of all peaks
* in current bounding box, ordered by elevation downward */
debug(@list);
The following things need to be implemented:
[x] variables, which are names prepended by @
[ ] check reserved names
[ ] statements in global space, even without destination where the result should go to (like the debug() in the last row).
[x] use variables inside of eval statements
[x] delay execution of map features if rules after a global statement use/modify a global variable
How to do?
save block of global statements as if they are a normal rule
compile as a function similar to check_X, execute from main loop with list of other objects
It would be great if it would be possible to use (global) variables. Similar to less these could be prefixed by '@'. So that a variable gets global, it should first be used in global space. Example (similar to #77, but rather extending it):
The following things need to be implemented:
debug()
in the last row).How to do?