Skip to content

Instantly share code, notes, and snippets.

module.js:477
process.dlopen(filename, module.exports);
^
Error: Unable to load shared library /home/aj/src/tm-master/node_modules/mapnik/lib/_mapnik.node
at Object..node (module.js:477:11)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object.<anonymous> (/home/aj/src/tm-master/node_modules/mapnik/lib/mapnik.js:18:14)
(06:47:06 PM) aj: ok ian_v have you recruited others for foos
(06:47:26 PM) yh: you can COALESCE me into this game of foos
(06:47:29 PM) yh: if you have some null values
#layer [zoom>5] {
polygon-fill:#006;
line-width: 0.5;
line-opacity: 0.1;
::label[zoom>8] {
text-name: "[name]";
text-face-name: "Arial Regular";
text-size:11;
}
}
4279249 'beach' 'White Beach'
5007372 'water' 'Flachsee'
4919254 'university' 'Bucknell University'
7979562 'park' 'Ambury Regional Park'
8015884 'water' 'Hurdalssj\xf8en'
8037686 'forest' 'Bois du Gast'
8050640 'water' 'Tisj\xf8en'
13704178 'train_station' 'Centralhuset'
13794650 'water' 'Rio Capoma'
8015884 'water' 'Hurdalssj\xf8en'
text-placement-type: simple;
text-placements: "S,N,E,W";
text-dx: 5;
text-dy: 5;
text-allow-overlap: false;
way[!boundary],
way[!admin_level] {
casing-width: +4;
casing-color: #FF00FF;
}
way[boundary][admin_level] {
casing-width: +4;
casing-color: #00FF00;
}

TileMill/Carto painting order hierarchy

Mapnik draws shapes using a painter's algorithm. Objects that are drawn first may be visually obstructed by objects that are painted later.

The paint order of objects is first controlled by the order of the layers - in a TileMill project, layers at the bottom of the list are drawn first and layers at the top of the list are drawn last.

Within each layer, you can control the order of group of styles via Carto attachments. If you don't explicitly create any attachments in Carto, a single default group will be created behind the scenes for all the rules in a layer.

Within each style rule the paint order of objects is defined by the order they are pulled from the datasource. For example, the first result from a database query is painted first, the second result is painted second, and so on. For file-based sources such as GeoJSON or Shapefiles you would have to edit the file in an external program to control this or

@ajashton
ajashton / gist:1673402
Created January 24, 2012 23:14
Bridges from ImpOSM
( SELECT geometry, type, bridge, access, render, layer, 0 as tunnel,
CASE
WHEN type IN ('motorway', 'trunk') THEN 'motorway'
WHEN type IN ('primary', 'secondary') THEN 'mainroad'
WHEN type IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclassified', 'road', 'living_street') THEN 'minorroad'
WHEN type IN ('service', 'track') THEN 'service'
WHEN type IN ('path', 'cycleway', 'footway', 'pedestrian', 'steps', 'bridleway') THEN 'noauto'
WHEN type IN ('light_rail', 'subway', 'narrow_guage', 'rail', 'tram') THEN 'railway'
ELSE 'other' END AS stylegroup
FROM (
@1: #DEB147;
@2: #D68A5A;
@3: #D5796B;
@4: #BE6291;
@5: #93639E;
@nodata:#a4abaf;
#tmsch1[all_gradrate09 < .6][all_gradrate09 > 0]::data {
[all_gradrate09 < .6][all_gradrate09 > 0] {marker-fill: @2;}
marker-height:1;
#city[type='suburb'] {
marker-width: 0.2;
marker-fill: #fc0;
marker-line-width: 0;
marker-allow-overlap: true;
}
#city[type='hamlet'] {
marker-width: 0.4;
marker-fill: #f90;