grunt-codepoint-open-transform
Transforms the Ordnance Survey "Code-Point Open" data.
Getting Started
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;
The "codepoint_open_transform" task
Overview
In your project's Gruntfile, add a section named codepoint_open_transform
to the data object passed into grunt.initConfig()
.
grunt;
Options
options.headers
Type: Number
Default value: 1
Indicates which row of headers to use (object keys in JSON files)
options.latlng
Type: Boolean
Default value false
Include Latitude & Longitude conversions in output.
options.minimal
Type: Boolean
Default value: false
Include only minimal data in output.
options.whitespace
Type: Boolean
Default value: true
Include whitespace in output to assist when reading the output files directly.
Output Formats
File format is determined by the destination file suffix.
JSON, Object of Arrays
Destinations ending in ooa.json will output JSON along the following form:
JSON, Array of Objects
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:
SQLite
Destinations ending in .sqlite will output SQLite databases.
SQL
Destinations ending in .sql will output SQL scripts.
Usage Example
grunt;
Contributing
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.
Release History
0.3.0
- SQL Support
0.2.0
- SQLite Support
0.1.0
- JSON Support