This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pts = // my point featurecollection | |
var polys = // my poly featurecollection | |
var tree = rbush() | |
polys.features.forEach(function(poly, i){ | |
var bbox = turf.bbox(poly) | |
var idx = { | |
minX: bbox[0], | |
minY: bbox[1], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pts = // my point featurecollection | |
var polys = // my poly featurecollection | |
pts.features = pts.features.filter(function(pt){ | |
var isInside = false | |
polys.features.forEach(function(poly){ | |
if(turf.inside(pt, poly)) isInside = true | |
}) | |
return isInside | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var geojson2svg = require('geojson2svg'); | |
var turf = require('turf'); | |
var fs = require('fs') | |
var polys = require('polygons.json') // a featurecollection of geojson polygons with a name property | |
polys.features.forEach(function(poly){ | |
var extent = turf.bbox(poly) | |
var options = { | |
viewportSize: {width: 200, height: 100}, | |
mapExtent: {left: extent[0], bottom: extent[1], right: extent[2], top: extent[3]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tileReduce = require('tile-reduce'); | |
var path = require('path'); | |
tileReduce({ | |
zoom: 14, | |
map: path.join(__dirname, '/process.js'), | |
sources: [ | |
{name: 'ways', mbtiles: 'ways.mbtiles')} | |
] | |
}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ogr2ogr -f KML /full/path/a.kml /full/path/b.geojson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var turf = require('turf') | |
var tilebelt = require('tilebelt') | |
// put your own data here | |
var stargazers = [<list of lat lons>] | |
// this sets the size of your grid cells; each grid cell is a map tile at the given zoom | |
var zoom = 12 | |
// tiles is a hash we can quickly add new tiles too and increment counts | |
var tiles = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var turf = require('turf') | |
var polys = //my polygon featurecollection | |
var edges = [] | |
polys.features.forEach(function(poly){ | |
for(var i = 0; i < poly.geometry.coordinates[0].length-1; i++){ | |
edges.push({ | |
start: turf.point(poly.geometry.coordinates[0][i]), | |
stop: turf.point(poly.geometry.coordinates[0][i+1]) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
../wgrib2 000 -s | grep "TMP:surface" | ../wgrib2 -i 000 -csv out.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var poly = { | |
"type": "Feature", | |
"properties": {}, | |
"geometry": { | |
"type": "Polygon", | |
"coordinates": [ | |
[ | |
[ | |
51.17431640625, | |
47.025206001585396 |