mapbox/carto — Issue #110: Wrong generated XML Style/Rule from MSS
Author: andrewharvey
Created: 2011-10-09 01:38:11+00:00
State: open

This could be a dup of issue #20, but

When I use carto to convert the following mss/mml to xml...
```
#amenity[tourism='motel'] {
[zoom = 20] {
point-file: url('/usr/share/icons/sjjb/png/accommodation/motel.glow.0092DA.24.png');
}
[zoom > 20] {
point-file: url('/usr/share/icons/sjjb/png/accommodation/motel.glow.0092DA.32.png');
}
}

#amenity[amenity='bench'] {
[zoom = 20] {
point-file: url('/usr/share/icons/sjjb/png/amenity/bench.glow.8E7409.24.png');
}
[zoom > 20] {
point-file: url('/usr/share/icons/sjjb/png/amenity/bench.glow.8E7409.32.png');
}
}
```

```
{
"bounds": [
-180,
-85.05112877980659,
180,
85.05112877980659
],
"center": [
0,
0,
2
],
"format": "png",
"interactivity": false,
"minzoom": 0,
"maxzoom": 22,
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Stylesheet": [
"style.mss"
],
"Layer": [
{
"geometry": "point",
"name": "amenity",
"id": "amenity",
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"class": "poi",
"Datasource": {
"table": "(\n SELECT way, amenity, tourism\n FROM planet_osm_point\n WHERE (amenity IS NOT NULL OR tourism IS NOT NULL)\n) as amenitypoi",
"key_field": "",
"geometry_field": "way",
"extent": "",
"type": "postgis",
"host": "localhost",
"port": "5432",
"user": "",
"password": "",
"dbname": ""
}
}
]
}
```
I get...

```

amenity

(
SELECT way, amenity, tourism
FROM planet_osm_point
WHERE (amenity IS NOT NULL OR tourism IS NOT NULL)
) as amenitypoi

way

postgis
localhost
5432

```

Notice the XML has rules for ([amenity] = 'bench') and ([tourism] = 'motel') which given my original mss I can't see how these rules should be present.