Skip to content

Latest commit

 

History

History
74 lines (47 loc) · 2.24 KB

README.md

File metadata and controls

74 lines (47 loc) · 2.24 KB

SharedStreets Tile Downloader (JavaScript)

npm version Build Status

Interact directly with SharedStreet's tile API.

Install

In Node.js

$ yarn add sharedstreets-api

CommonJS

const sharedstreetsApi = require('sharedstreets-api');

Typescript

import * as sharedstreetsApi from 'sharedstreets-api';

In Browser

For a full list of web examples, check out SharedStreets examples.

CLI

Usage:
  $ sharedstreets-download-tile

Options:
  --tile                  tile [x,y,zoom]
  --layer                 layer (geometry|intersection|metadata|reference)

Examples:
  $ sharedstreets-download-tile --tile [1186,1466,12] --layer "geometry" > "12-1186-1466.geometry.pbf"

API

Table of Contents

downloadTile

Download Tile

Parameters

  • tile Array<number> Tile [x, y, z]
  • layer string Layer (geometry|intersection|metadata|reference)
  • options Object Optional parameter (optional, default {})
    • options.output string Output (json|pbf) (optional, default "pbf")

Examples

const tile = [1186, 1466, 12];
const layer = "geometry";

sharedstreetsApi.downloadTile(tile, layer).then(data => {
  data // => PBF Buffer
})

Returns Promise<Buffer> PBF Buffer