Giter VIP home page Giter VIP logo

cartodb-uploader's Introduction

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

  • 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

cartodb-uploader's People

Contributors

calvinmetcalf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.