wiki:Styles/MapillaryDetections
meta
{
  title: "Mapillary Object Detections";
  description: "Paint style for Mapillary point objects";
  author: "Taylor Smock";
  version: "1.6_2022-08-24";
  icon: "mapillary-logo.svg";
}
/*----------------------------------------------------------------------------*/
/* Pixel per metre (on average)                                               */
/* Copied from Lane_and_Road_Attributes                                       */
/*----------------------------------------------------------------------------*/
*|z16  { pixel_per_metre: 0.625; }
*|z17  { pixel_per_metre: 1.25; }
*|z18  { pixel_per_metre: 2.5; }
*|z19  { pixel_per_metre: 5; }
*|z20  { pixel_per_metre: 10; }
*|z21  { pixel_per_metre: 20; }
*|z22  { pixel_per_metre: 40; }
*|z23  { pixel_per_metre: 80; }
*|z24  { pixel_per_metre: 160; }
*|z25  { pixel_per_metre: 320; }
*|z26- { pixel_per_metre: 640; }

setting::show_detection_value {
    type: boolean;
    label: tr("Show detection values (zoom dependent)");
    default: true;
}

setting::hide_detections_with_no_known_image {
    type: boolean;
    label: tr("Hide detections with no known image");
    default: true;
}

setting::halo_color {
    type: color;
    label: tr("Mapillary Object Detections Halo Color");
    default: mapillaryPointObjectHaloColor#C80BC7;
}

node[layer=traffic_sign] {
    imagepath: "package_signs";
}

node[layer=point] {
    imagepath: "package_objects";
}

/* Avoid trying to show images for detections when the image does not exist */
node[value=general--traffic-sign--g1],
node[value=complementary--texts-three-lines--g1],
node[value=complementary--texts-two-lines--g1],
node[value=information--general-directions--g1],
node[value=marking--discrete--symbol--wheelchair],
node[value=marking--discrete--text--other],
node[value=marking--discrete--text--stop],
node[value=object--sign--back],
node[value=object--sign--other],
node[value=object--traffic-light--cyclists-front],
node[value=object--traffic-light--general-horizontal-back],
node[value=object--traffic-light--general-horizontal-front],
node[value=object--traffic-light--general-single-front],
node[value=object--traffic-light--general-upright-back],
node[value=object--traffic-light--general-upright-front],
node[value=object--traffic-light--general-upright-side],
node[value=object--traffic-light--pedestrians-back],
node[value=object--traffic-light--pedestrians-front],
node[value=object--traffic-light--pedestrians-side],
node[value=object--traffic-sign--back],
node[value=object--traffic-sign--back],
node[value=object--traffic-sign--direction-back],
node[value=object--traffic-sign--direction-front],
node[value=object--traffic-sign--front],
node[value=object--traffic-sign--information-parking],
node[value=object--traffic-sign--temporary-back],
node[value=object--traffic-sign--temporary-front],
node[value=regulatory--texts-four-lines--g1],
node[value=regulatory--texts-one-line--g1],
node[value=regulatory--texts-three-lines--g1],
node[value=regulatory--texts-two-lines--g1] {
    noimage: true;
}

node|z15-[value][is_prop_set(imagepath)][!is_prop_set(noimage)] {
    icon-image: concat(prop(imagepath), "/", tag("value"));
}

node|z18-[value][!setting(hide_detections_with_no_known_image)][is_prop_set(noimage)] {
    symbol-shape: square;
    symbol-fill-color: white;
    symbol-size: 16;
}

node|z18-[value][setting(hide_detections_with_no_known_image)][is_prop_set(noimage)] {
    symbol-shape: square;
    symbol-size: 1;
    symbol-fill-opacity: 0;
}

node|z20-[value][is_prop_set(noimage)][setting("show_detection_value")][!setting(hide_detections_with_no_known_image)],
node|z24-[value][setting("show_detection_value")] {
    text: value;
}

node[layer=~/trafficsigns|points/]:selected::selected_layer {
    symbol-shape: square;
    symbol-size: +4;
    symbol-stroke-color: red;
    symbol-stroke-opacity: 0.7;
}

node|z18-[value][!is_prop_set(noimage, default)]::magenta,
node|z18-[value][is_prop_set(noimage, default)][!setting(hide_detections_with_no_known_image)]::magenta {
    symbol-shape: circle;
    symbol-fill-color: setting(halo_color);
    symbol-fill-opacity: 0.25;
    symbol-size: 28;
}

Styles_MapillaryDetections-style.mapcss, Styles_MapillaryDetections.zip

Last modified 21 months ago Last modified on 2022-08-25T00:41:50+02:00

Attachments (2)

Note: See TracWiki for help on using the wiki.