Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo for SharedStreets API #1

Open
DenisCarriere opened this issue Mar 12, 2018 · 1 comment
Open

Demo for SharedStreets API #1

DenisCarriere opened this issue Mar 12, 2018 · 1 comment
Labels

Comments

@DenisCarriere
Copy link
Contributor

Demo for SharedStreets API

CC: @kpwebb

Figured we would could have a nice central location for any API requests to the SharedStreets Server, for example @migurski had an internal request to fetch/download tiles.

Many more features to add, but the first one implemented is an easy way to download a single tile directly from the SharedStreets server.

Install

$ npm install sharedstreets-api

CLI

This should be able to work as a Python wrapper, or can easily be implemented in native Python.

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"

Downloading a single tile outputs to STDOUT (at the moment)

Using Javascript/NodeJS

import * as sharedstreetsApi from "sharedstreets-api";

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

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

sjb3 commented Oct 25, 2018

Team!

Quick question; was following your demo/instruction above, but keep getting
'''
TypeError: Cannot read property 'downloadTile' of undefined
'''
indicating right after sharedstreetsApi.

Feel like i forgot to install something before start it off.

Any words of advices?

Cheers!

J

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants