0.0.2 • Published 10 years ago

mapbox-dataset-sdk v0.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
10 years ago

Build Status

mapbox-dataset-sdk

A JavaScript SDK for the Mapbox Dataset API

Usage

var Mapbox = require('mapbox-dataset-sdk');

var datasets = Mapbox.dataset({
  user: 'my-mapbox-user'
});

var features = Mapbox.dataset({
  user: 'my-mapbox-user',
  dataset: 'my-dataset-id'
});

Configuration

Set these environment variables, or pass them as configuration options to the clients as shown above:

environment variableconfigdescription
MapboxUseruserrequired Mapbox user name
-datasetrequired for feature client Dataset ID
MapboxAccessTokenaccessTokenrequired Mapbox access token with dataset:read and dataset:write scopes
MapboxAPImapboxMapbox API endpoint

API overview

datasets

methodargumentsdescription
datasets.list-List available datasets
datasets.getidGet information about a dataset
datasets.createoptionsCreate a dataset, optionally specifying name and description.
datasets.updateid, optionsUpdate a dataset's name or description
datasets.deleteidDelete a dataset

features

methodargumentsdescription
features.list-List features
features.getidGet a feature
features.insertfeatureInsert or update a GeoJSON Feature
features.deleteidDelete a feature
features.bulkinserts, deletesPerform bulk feature inserts, updates, and/or deletes
features.replacecollectionDelete all the existing features in a dataset and replace it with the provided GeoJSON FeatureCollection

Tests

You must set MapboxUser and MapboxAccessToken environment variables to run the tests. These tests will create and destroy datasets and features in your account.

0.0.2

10 years ago

0.0.1

10 years ago