Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dianashk
dianashk / streetcred_map_tiles.html
Last active December 4, 2018 20:55
example of a mapbox map with custom vector tile data source
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.css' rel='stylesheet' />
</head>
<body>
@dianashk
dianashk / README.md
Last active July 23, 2016 17:27 — forked from jsanz/README.md
Geocode with Mapzen search and Google Spreadsheets

How to set up a quick geocoding system on google spreadsheets.

  1. Create a new spreadsheet
  2. Open the Scripts editor and paste the script attached
  3. Use on your spreadsheet this new formula
=searchMapzen(place_cell,mapzen_api_key)

Mapzen Search

Changes

  • Switched from Quattroshapes to WhosOnFirst as the canonical source for administrative hierarchies and corresponding geometries.
  • No longer importing Quattroshapes data since WhosOnFirst contains all those records and more. Going forward, any use of quattroshapes or qs in queries will resolve to whosonfirst or wof automatically.
  • New bbox property has been added to individual results, for which geometry was available in the original source. This does not affect POI and address data.
  • Drastic improvements have been made to the label generation logic.
  • id and gid format has changed to make the ids more unique.
  • New id format resolves previously outstanding bugs related to geonames ids being invalid for lookup via the /place endpoint.
  • Addition place types have been introduced, such as macroregion, macrocounty, and burough.
var fs = require('fs');
var _ = require('lodash');
var data = JSON.parse(fs.readFileSync(process.argv[2]));
var results = [];
Object.keys(data).forEach(function (key) {
var item = data[key];
@dianashk
dianashk / locmux.js
Created September 18, 2015 17:19
Run search against multiple focus points with the same input text.
/**
* To run do as follows:
*
* $ npm install request
* $ node locmux.js 'text i want to search for'
*
* If you'd like more locations to be searched just add them to the list below.
*
*/
var fs = require('fs-extra');
var fileName = process.argv[2];
var extend = require('extend');
var path = require('path');
// config mapping of old names to new ones
var NAME_MAP = {
'layer': 'type',
'number': 'housenumber',
'zip': 'postalcode',
@dianashk
dianashk / api-benchmark.js
Created April 24, 2015 21:20
quick api benchmark test
var apiBenchmark = require('api-benchmark');
var services = {
server1: "http://localhost:3100/"
};
var routes = {
route1: {
method: 'get',
route: 'reverse?lat=40.744243&lon=-73.990342&size=40&categories=food,education,entertainment'