mapbox-dataset-sdk

0.0.2 • Public • Published

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 variable config description
MapboxUser user required Mapbox user name
  • | dataset | required for feature client Dataset ID MapboxAccessToken | accessToken | required Mapbox access token with dataset:read and dataset:write scopes MapboxAPI | mapbox | Mapbox API endpoint

API overview

datasets

method arguments description
datasets.list - List available datasets
datasets.get id Get information about a dataset
datasets.create [options] Create a dataset, optionally specifying name and description.
datasets.update id, [options] Update a dataset's name or description
datasets.delete id Delete a dataset

features

method arguments description
features.list - List features
features.get id Get a feature
features.insert feature Insert or update a GeoJSON Feature
features.delete id Delete a feature
features.bulk [inserts], [deletes] Perform bulk feature inserts, updates, and/or deletes
features.replace collection Delete 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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    2
  • 0.0.1
    0

Package Sidebar

Install

npm i mapbox-dataset-sdk

Weekly Downloads

2

Version

0.0.2

License

ISC

Last publish

Collaborators

  • rclark