cquest / osmfr-cartocss

Une adaptation "FR" de la ré-implémentation du style Mapnik d'OpenStreetMap en CartoCSS
http://tile.openstreetmap.fr/
Other
46 stars 16 forks source link

project .mml cannot be parsed by carto due to json formatting error #23

Closed elacour closed 7 years ago

elacour commented 8 years ago

carto project.mml > osmfr.xml carto: Unexpected token }

Using jsonlint3, I found the small typo. Attached patch fixes this. jsonlint.patch.txt

MaelREBOUX commented 7 years ago

I met this too.

We need a carto version >= 0.16.3 to compile this style project. The debian package install a 0.9.5.

To solve :

# en tant que root
sudo -s

# npm
apt-get install -y npm

# carto via npm, -g = globally
npm install -g carto

/usr/local/bin/carto -> /usr/local/lib/node_modules/carto/bin/carto /usr/local/lib └─┬ carto@0.16.3

/usr/bin/carto -v
carto 0.9.5 (Carto map stylesheet compiler)

nodejs /usr/local/bin/carto -v
carto 0.16.3 (Carto map stylesheet compiler)

So to compile :

nodejs /usr/local/bin/carto project.mml > style.xml 
pir1981 commented 7 years ago

Hi, although I am using gravitystorm/openstreetmap-carto, I had a similar issue as above carto: Unexpected token s

Hopefully you might be able to help further. I would very much appreciate any input.

The fix from MaelREBOUX worked and made it start, but do you happen to have an idea how to solve the follow up error.

Error: placenames.mss:29:6 Unrecognized rule: text-margin
placenames.mss:29:6 Unrecognized rule: text-margin
placenames.mss:23:6 Unrecognized rule: text-margin
placenames.mss:17:6 Unrecognized rule: text-margin
placenames.mss:12:4 Unrecognized rule: text-margin
placenames.mss:96:6 Unrecognized rule: shield-margin
placenames.mss:96:6 Unrecognized rule: shield-margin
placenames.mss:78:4 Unrecognized rule: shield-margin
placenames.mss:78:4 Unrecognized rule: shield-margin
placenames.mss:125:6 Unrecognized rule: text-margin
placenames.mss:119:6 Unrecognized rule: text-margin
placenames.mss:111:4 Unrecognized rule: text-margin
placenames.mss:96:6 Unrecognized rule: shield-margin
placenames.mss:96:6 Unrecognized rule: shield-margin
placenames.mss:78:4 Unrecognized rule: shield-margin
placenames.mss:78:4 Unrecognized rule: shield-margin
placenames.mss:125:6 Unrecognized rule: text-margin
placenames.mss:119:6 Unrecognized rule: text-margin
placenames.mss:111:4 Unrecognized rule: text-margin
placenames.mss:96:6 Unrecognized rule: shield-margin
placenames.mss:96:6 Unrecognized rule: shield-margin
placenames.mss:78:4 Unrecognized rule: shield-margin
placenames.mss:125:6 Unrecognized rule: text-margin
placenames.mss:119:6 Unrecognized rule: text-margin
placenames.mss:111:4 Unrecognized rule: text-margin
placenames.mss:96:6 Unrecognized rule: shield-margin
placenames.mss:96:6 Unrecognized rule: shield-margin
placenames.mss:78:4 Unrecognized rule: shield-margin
placenames.mss:125:6 Unrecognized rule: text-margin
placenames.mss:119:6 Unrecognized rule: text-margin
placenames.mss:111:4 Unrecognized rule: text-margin
placenames.mss:61:6 Unrecognized rule: text-margin
placenames.mss:51:4 Unrecognized rule: text-margin
placenames.mss:290:8 Unrecognized rule: text-margin
placenames.mss:284:8 Unrecognized rule: text-margin
placenames.mss:278:8 Unrecognized rule: text-margin
placenames.mss:273:6 Unrecognized rule: text-margin
placenames.mss:213:6 Unrecognized rule: shield-margin
placenames.mss:213:6 Unrecognized rule: shield-margin
placenames.mss:256:8 Unrecognized rule: text-margin
placenames.mss:250:8 Unrecognized rule: text-margin
placenames.mss:244:8 Unrecognized rule: text-margin
placenames.mss:238:8 Unrecognized rule: text-margin
placenames.mss:233:6 Unrecognized rule: text-margin
placenames.mss:213:6 Unrecognized rule: shield-margin
placenames.mss:213:6 Unrecognized rule: shield-margin
placenames.mss:256:8 Unrecognized rule: text-margin
placenames.mss:250:8 Unrecognized rule: text-margin
placenames.mss:244:8 Unrecognized rule: text-margin
placenames.mss:238:8 Unrecognized rule: text-margin
placenames.mss:233:6 Unrecognized rule: text-margin
placenames.mss:213:6 Unrecognized rule: shield-margin
placenames.mss:256:8 Unrecognized rule: text-margin
placenames.mss:250:8 Unrecognized rule: text-margin
placenames.mss:244:8 Unrecognized rule: text-margin
placenames.mss:238:8 Unrecognized rule: text-margin
placenames.mss:233:6 Unrecognized rule: text-margin
placenames.mss:213:6 Unrecognized rule: shield-margin
placenames.mss:256:8 Unrecognized rule: text-margin
placenames.mss:250:8 Unrecognized rule: text-margin
placenames.mss:244:8 Unrecognized rule: text-margin
placenames.mss:238:8 Unrecognized rule: text-margin
placenames.mss:233:6 Unrecognized rule: text-margin
placenames.mss:161:8 Unrecognized rule: shield-margin
placenames.mss:161:8 Unrecognized rule: shield-margin
placenames.mss:143:6 Unrecognized rule: shield-margin
placenames.mss:143:6 Unrecognized rule: shield-margin
placenames.mss:192:8 Unrecognized rule: text-margin
placenames.mss:186:8 Unrecognized rule: text-margin
placenames.mss:178:6 Unrecognized rule: text-margin
placenames.mss:161:8 Unrecognized rule: shield-margin
placenames.mss:161:8 Unrecognized rule: shield-margin
placenames.mss:143:6 Unrecognized rule: shield-margin
placenames.mss:192:8 Unrecognized rule: text-margin
placenames.mss:186:8 Unrecognized rule: text-margin
placenames.mss:143:6 Unrecognized rule: shield-margin
placenames.mss:178:6 Unrecognized rule: text-margin
placenames.mss:161:8 Unrecognized rule: shield-margin
placenames.mss:161:8 Unrecognized rule: shield-margin
placenames.mss:143:6 Unrecognized rule: shield-margin
placenames.mss:192:8 Unrecognized rule: text-margin
placenames.mss:186:8 Unrecognized rule: text-margin
placenames.mss:178:6 Unrecognized rule: text-margin
placenames.mss:161:8 Unrecognized rule: shield-margin
placenames.mss:161:8 Unrecognized rule: shield-margin
placenames.mss:143:6 Unrecognized rule: shield-margin
placenames.mss:192:8 Unrecognized rule: text-margin
placenames.mss:186:8 Unrecognized rule: text-margin
placenames.mss:178:6 Unrecognized rule: text-margin
placenames.mss:393:6 Unrecognized rule: text-margin
placenames.mss:387:6 Unrecognized rule: text-margin
placenames.mss:393:6 Unrecognized rule: text-margin
placenames.mss:387:6 Unrecognized rule: text-margin
placenames.mss:393:6 Unrecognized rule: text-margin
placenames.mss:387:6 Unrecognized rule: text-margin
placenames.mss:393:6 Unrecognized rule: text-margin
placenames.mss:387:6 Unrecognized rule: text-margin
placenames.mss:393:6 Unrecognized rule: text-margin
placenames.mss:387:6 Unrecognized rule: text-margin
placenames.mss:366:8 Unrecognized rule: text-margin
placenames.mss:360:8 Unrecognized rule: text-margin
placenames.mss:354:8 Unrecognized rule: text-margin
placenames.mss:346:8 Unrecognized rule: text-margin
placenames.mss:325:6 Unrecognized rule: text-margin
placenames.mss:317:6 Unrecognized rule: text-margin
placenames.mss:311:6 Unrecognized rule: text-margin
placenames.mss:306:4 Unrecognized rule: text-margin
    at Object.env.error (/usr/local/lib/node_modules/carto/lib/carto/parser.js:241:55)
    at Rule.tree.Rule.toXML (/usr/local/lib/node_modules/carto/lib/carto/tree/rule.js:56:20)
    at Definition.tree.Definition.symbolizersToXML (/usr/local/lib/node_modules/carto/lib/carto/tree/definition.js:139:46)
    at Definition.tree.Definition.toXML (/usr/local/lib/node_modules/carto/lib/carto/tree/definition.js:203:33)
    at /usr/local/lib/node_modules/carto/lib/carto/tree/style.js:31:27
    at Array.map (native)
    at Object.tree.StyleXML (/usr/local/lib/node_modules/carto/lib/carto/tree/style.js:30:29)
    at Renderer.render (/usr/local/lib/node_modules/carto/lib/carto/renderer.js:138:43)
    at compileMML (/usr/local/lib/node_modules/carto/bin/carto:87:31)
    at Object.<anonymous> (/usr/local/lib/node_modules/carto/bin/carto:178:9)
MaelREBOUX commented 7 years ago

Sorry : no idea. Here we work on the french rendering style.

see gravitystorm/openstreetmap-carto for a specific issue.

jnachtigall commented 7 years ago

@pir1981 Did you find a solution to this? I have this same problem with the German style (https://github.com/giggls/openstreetmap-carto-de/issues/27) and it seems to be caused by openstreetmap-carto requring a newer mapnik version now (more in the linked issue)

jnachtigall commented 7 years ago

@pir1981 Ok, found a solution. I had to update mapnik from version 2.2 to mapnik version 3.