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
#!/bin/bash | |
set -e | |
function die { | |
echo -e "ERROR: $@" 1>&2 | |
exit 1 | |
} | |
for prog in awk curl xsltproc osm2pgsql; do |
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
#include "prime_server/prime_server.hpp" | |
#include "prime_server/http_protocol.hpp" | |
#include "prime_server/logging.hpp" | |
#include <boost/variant.hpp> | |
#include <thread> | |
struct http_server { | |
using work_function_t = prime_server::worker_t::work_function_t; |
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
import json | |
from shapely.geometry import mapping, shape | |
import sys | |
from mapbox_vector_tile import encode | |
geojson = json.load(open(sys.argv[1])) | |
layers = [] | |
for name, featurecollection in geojson.iteritems(): | |
features = [] |
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
from osgeo import gdal | |
import numpy as np | |
import sys | |
xsize = 266 | |
ysize = 276 | |
drv = gdal.GetDriverByName("MEM") | |
ds = drv.Create('', xsize, ysize, 1, gdal.GDT_Float32) | |
band = ds.GetRasterBand(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
BEGIN; | |
CREATE OR REPLACE FUNCTION mz_calculate_is_landuse( | |
landuse_val text, leisure_val text, natural_val text, highway_val text, | |
amenity_val text, aeroway_val text, tourism_val text, man_made_val text, | |
power_val text, boundary_val text) | |
RETURNS BOOLEAN AS $$ | |
BEGIN | |
RETURN | |
landuse_val IN ('park', 'forest', 'residential', 'retail', 'commercial', |
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
BEGIN; | |
CREATE OR REPLACE FUNCTION mz_calculate_poi_level( | |
aerialway_val text, | |
aeroway_val text, | |
amenity_val text, | |
barrier_val text, | |
craft_val text, | |
highway_val text, | |
historic_val text, |
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
BEGIN; | |
DROP FUNCTION IF EXISTS mz_calculate_road_level(text, text, text, text, text, text, text, text, geometry); | |
CREATE OR REPLACE FUNCTION mz_calculate_man_made_level(man_made_val text) | |
RETURNS SMALLINT AS $$ | |
BEGIN | |
RETURN CASE | |
WHEN man_made_val IN ('pier') THEN 13 | |
ELSE NULL |
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
BEGIN; | |
-- IF YOU UPDATE THIS, PLEASE UPDATE mz_calculate_landuse_kind | |
-- BELOW! | |
CREATE OR REPLACE FUNCTION mz_calculate_is_landuse( | |
landuse_val text, leisure_val text, natural_val text, highway_val text, | |
amenity_val text, aeroway_val text, tourism_val text, man_made_val text, | |
power_val text, boundary_val text) | |
RETURNS BOOLEAN AS $$ | |
BEGIN |
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
{ | |
"node_id": { | |
"id": 1118, | |
"level": 2, | |
"tile_id": 752471 | |
}, | |
"input_lon": 17.959406, | |
"node": { | |
"type": "street_intersection", | |
"traffic_signal": false, |
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
BEGIN; | |
DROP FUNCTION IF EXISTS mz_calculate_poi_level(text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, way_area real); | |
CREATE OR REPLACE FUNCTION mz_calculate_poi_level( | |
aerialway_val text, | |
aeroway_val text, | |
amenity_val text, | |
barrier_val text, |