Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Document to allow for validation of datasource parameters #1656

Closed
springmeyer opened this issue Dec 17, 2012 · 1 comment
Closed

JSON Document to allow for validation of datasource parameters #1656

springmeyer opened this issue Dec 17, 2012 · 1 comment
Labels
Milestone

Comments

@springmeyer
Copy link
Member

Mapnik-reference could provide additional data about what exact parameters mapnik datasources accept and require. This way calling applications could more easily validate datasources via their parameters without having to instantiate the actual mapnik objects (which may throw if resources are not available or which might incur unnecessary overhead).

A document could look like:

{
  "variables": {
    "encoding": {
      "type": "string",
      "doc": "The encoding value for the datasource attributes",
      "default-value": "utf-8",
      "default-meaning": "UTF8 will be the assumed encoding for string attribute values",
      "required": false
    },
    "row_limit": {
      "type": "integer",
      "doc": "Max amount of features to read from the datasource",
      "default-value": "0",
      "default-meaning": "All features will be read from the datasource (unless row_limit is > 1)",
      "required": false
    },
    "file": {
      "type": "string",
      "doc": "Path to the file for the datasource",
      "default-value": "",
      "default-meaning": "",
      "required": true
    }
  },
  "datasources": {
    "csv": {
      "file":"<@(file)",
      "row_limit":"<@(row_limit)"
    }
  }
}
springmeyer pushed a commit that referenced this issue Dec 17, 2012
Remove bind option for datasources closes #962, reverts #622, refs #1655 and #1656
@springmeyer
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant