Giter Site home page Giter Site logo

mapnik-reference's Introduction

mapnik-reference

mapnik-reference is a parse-able spec of what Mapnik can do - what main structures it supports (like layers, styles, and symbolizers) and the properties they can contain. It's useful for building parsers, tests, compilers, and syntax highlighting/checking for languages.

Versioning

The version of this repository indicates the schema of the reference.json file. Schema changes of any type are expected to change the implementation requirements of a parser, so they will increment the major version of this repository in semver style.

The directories in this repository directly correspond to released versions of Mapnik and the next targeted release of Mapnik. The latest reference, usually targeted toward a pre-release, is copied into /latest for convenience.

Meaning

The structure of the file is as such:

  • version: the version of Mapnik targeted. Same as the containing directory.
  • style: properties of the Style XML element
  • layer: properties of the Layer XML element
  • symbolizers/*: properties that apply to all symbolizers
  • symbolizers/symbolizer: properties that apply to each type of symbolizer
  • colors: named colors supported by Mapnik. see include/mapnik/css_color_grammar.hpp

Using

This is a valid npm module and therefore can easily be used with node.js.

npm install mapnik-reference

Once installing it as a dependency (like it's used in Carto), it can be included and used for a specific version of Mapnik:

var mapnik_reference = require('mapnik-reference');
var data = mapnik_reference.version['2.1.0'];

Other implementations will want to simply copy the JSON file from the desired implementation, like 2.0.1/reference.json. For python we could consider uploading to pypi if there is interest.

The file can then be parsed with any of the many json parsers.

Testing

Tests require python:

make test

Users

  • carto.js
  • Mapnik itself (the util/validate-mapnik-instance.py is used to check binding consistency like in #1427)

mapnik-reference's People

Contributors

gravitystorm avatar kkaefer avatar migurski avatar misterboo avatar rundel avatar sk1p avatar thomasg77 avatar tmcw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.