carto-uploader
Upload a stream into CartoDB
Last updated 6 years ago by cwmma .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install carto-uploader 
SYNC missed versions from official npm registry.

cartodb-uploader

streaming upload to cartodb, arguemnts are

  • credentials object with user and api members
  • filename, in the format of desired_table_name.fileExt
  • callback (optional) to be called when the table ends up being created

returns a writable stream that accepts the file, acceptable file extensions are (accourding to cartodb)[http://docs.cartodb.com/cartodb-editor.html#supported-file-formats]

  • csv
  • tab
  • shp
  • kml
  • kmz
  • xls
  • xlsx
  • geojson
  • gpx
  • osm
  • bz2
  • ods

also has a geojson method which just takes a destination table instead of a filename and is a writable object stream taking geojson features

var cartodbUploader = require('cartodb-uploader');

var featureStream = getFeatureStreamSomehow();
featureStream.pipe(cartodbUploader.geojson({
  user: 'username',
  key: 'apikey'
}, 'destination_table_name', function (err, resp) {
  // optional callback when done
}));

var binaryCSVstream = fs.createReadStream('./something.csv')

featureStream.pipe(cartodbUploader({
  user: 'username',
  key: 'apikey'
}, 'something.csv', function (err, resp) {
  // optional callback when done
}));

CLI API

npm install -g cartodb-uploader

Upload a file named foo.geojson

cartodb -f foo.geojson -a apikey -u username

or you can set the apikey as an enviromental variable

export CARTODB_API_KEY=apikey
export CARTODB_USER_NAME=uername
cartodb foo.geojson

or give it a different name

cartodb TEMP_BLAH -n foo.geojson

the name can be combined with stdin

curl some/url | cartodb -n foo.geojson

Current Tags

  • 1.1.1                                ...           latest (6 years ago)

3 Versions

  • 1.1.1                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (8)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |