Transforms the Ordnance Survey "Code-Point Open" data.
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-codepoint-open-transform --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-codepoint-open-transform');
In your project's Gruntfile, add a section named codepoint_open_transform
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
codepoint_open_transform: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: Number
Default value: 1
Indicates which row of headers to use (object keys in JSON files)
Type: Boolean
Default value false
Include Latitude & Longitude conversions in output.
Type: Boolean
Default value: false
Include only minimal data in output.
Type: Boolean
Default value: true
Include whitespace in output to assist when reading the output files directly.
File format is determined by the destination file suffix.
Destinations ending in ooa.json will output JSON along the following form:
{
"foo": [
"foo 1",
"foo 2",
"foo 3"
],
"bar": [
"bar 1",
"bar 2",
"bar 3"
]
}
Presently this output method will generate a file that appears valid, ** however, the output file will likely trigger memory constraints** ** due to the 1.47 million objects in the array.** Destinations ending in aoo.json will output JSON along the following form:
[
{
"foo": "foo 1",
"bar": "bar 1"
},
{
"foo": "foo 2",
"bar": "bar 2"
},
{
"foo": "foo 3",
"bar": "bar 3"
}
]
Destinations ending in .sqlite will output SQLite databases.
Destinations ending in .sql will output SQL scripts.
grunt.initConfig({
codepoint_open_transform: {
default: {
files: {
'dist/codepoint-open-test.ooa.json': 'lib/codepo_gb.zip'
}
}
},
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
- SQL Support
- SQLite Support
- JSON Support