This file contains hidden or 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
| create function st_invert(geometry) returns setof geometry as | |
| 'SELECT st_difference(st_geomfromtext(''POLYGON((-20037508.3427892 147730758.194568, | |
| 20037508.3427892 147730758.194568, | |
| 20037508.3427892 -147730762.669922, | |
| -20037508.3427892 -147730762.669922, | |
| -20037508.3427892 147730758.194568))'', 900913), $1)' | |
| language sql; |
This file contains hidden or 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
| psql -d pri -c 'select st_asgeojson(st_transform(st_union(geometry), 4326)) as geometry from osm_suburbs' | awk '/coordinates/ {print $1}' > result.geojson |
This file contains hidden or 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 | |
| red=`tput setaf 1` | |
| green=`tput setaf 2` | |
| reset=`tput sgr0` | |
| for subject in 'AMU' 'CHU' 'KAM' 'KHA' 'MAG' 'PRI' 'SA' 'SAK' 'YEV' | |
| do | |
| filename="RU-$subject.osm.pbf" | |
| url="http://be.gis-lab.info/data/osm_dump/dump/latest/$filename" |
This file contains hidden or 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 | |
| red=`tput setaf 1` | |
| green=`tput setaf 2` | |
| reset=`tput sgr0` | |
| # --- SET UP THIS --- | |
| PROJECT=OSMBright | |
| EXPORTNAME=osm-bright |
This file contains hidden or 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
| library(XML) | |
| library(httr) | |
| GOST_7_67_2003 <- (function() { | |
| url <- "https://ru.wikipedia.org/wiki/%D0%93%D0%9E%D0%A1%D0%A2_7.67" | |
| content <- content(GET(url), as="text") | |
| html <- htmlParse(content, asText=TRUE) | |
| tables <- readHTMLTable(html) | |
| table <- tables[[1]] | |
| table[complete.cases(table),] |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'pg' | |
| require 'colorize' | |
| require 'translit' | |
| # Output a table of current connections to the DB | |
| conn = PG.connect( dbname: 'astrakhan' ) | |
| # conn.exec( "ALTER TABLE planet_osm_line ADD COLUMN name_en text;" ) |
This file contains hidden or 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 | |
| green=`tput setaf 2` | |
| reset=`tput sgr0` | |
| dt=`date '+%Y.%m.%d_%H-%M-%S'` | |
| backup_path=$HOME/backup/$dt | |
| db_backup=$backup_path/astrakhan_production.sql | |
| uploads_backup=$backup_path/uploads.tar.bz2 |
This file contains hidden or 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
| // ./osrm-routed --max-table-size 1000000 moscow_russia.osrm | |
| var turf = require('turf') | |
| var request = require('request') | |
| // var extent = [37.35,55.56,37.87,55.94], // moscow | |
| var extent = [37.606,55.731,37.640,55.752], | |
| cellWidth = 0.1, | |
| units = 'kilometers', | |
| url = 'http://127.0.0.1:5000/table?' |
This file contains hidden or 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
| START cmd /k "npm start" | |
| start cmd /k "TIMEOUT /T 15 /NOBREAK && "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk http://localhost:3333" |
This file contains hidden or 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
| formatInt = (str) -> | |
| reducer = (acc, item, index) -> | |
| acc.push(' ') if index % 3 == 0 | |
| acc.push(item) | |
| acc | |
| str.toString() | |
| .split('') | |
| .reverse() | |
| .reduce(reducer, []) |