Skip to content

Instantly share code, notes, and snippets.

View matkoniecz's full-sized avatar

Mateusz Konieczny matkoniecz

View GitHub Profile
@matkoniecz
matkoniecz / count.py
Created August 20, 2014 21:41
bicycle_parking_statistics (GNU GPLv3 license)
# coding=utf-8
import urllib2
import os.path
import argparse
import decimal
from lxml import etree
import sys
@matkoniecz
matkoniecz / test.rb
Last active August 29, 2015 14:08
find bad text-dy
# encoding: UTF-8
require 'fileutils'
def main
style_filenames = Dir[get_style_path+"*.mss"]
for style_filename in style_filenames
puts style_filename
style_file = open(style_filename)
style = style_file.read()
matched = style.scan(/\[feature = '(man_made|[^_]+)_([^']+)'\]/)
tag = nil
@matkoniecz
matkoniecz / footpathway.md
Last active September 21, 2015 19:25 — forked from gravitystorm/footpathway.md
highway=path vs highway=footway

"path is only needed when footway, cycleway or bridleway are misleading"

"There's no clear default for path, footway or every cycleway about surface. The obvious answer is that surface tags should be used."

"without any further access tags, path is neutral and open to all unmotorized means of transport (unlike footway, cycleway etc.)"

"highway=footway is meant to be the same as highway=path and foot=designated"

"But =footway and =path mean different things in different regions"

#!/usr/bin/ruby
require 'net/http'
require 'json'
require 'pp'
url = URI.parse('http://taginfo.openstreetmap.org/api/4/key/values?key=shop&sortname=count&sortorder=desc')
req = Net::HTTP::Get.new(url.to_s)
res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)
new = ['accessories', 'agrarian', 'anime', 'antiques', 'appliance', 'art', 'auto_parts', 'baby_goods', 'bathroom', 'bathroom_furnishing', 'bed', 'boat', 'bookmaker', 'boutique', 'builder', 'building_materials', 'cafe', 'camera', 'candy', 'car_service', 'carpet', 'catalogue', 'charity', 'cheese', 'chocolate', 'coffee', 'communication', 'craft', 'curtain', 'dairy', 'deli', 'discount', 'doors', 'e-cigarette', 'electrical', 'energy', 'erotic', 'estate_agent', 'fabric', 'fishing', 'fishmonger', 'flooring', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'gallery', 'games', 'gas', 'general', 'glass', 'glaziery', 'grocery', 'haberdashery', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hobby', 'household', 'houseware', 'hunting', 'interior_decoration', 'kitchen', 'lamps', 'leather', 'lighting', 'locksmith', 'lottery', 'market', 'marketplace', 'massage', 'medical', 'medical_supply', 'money_lender', 'motorcycle_repair', 'music', 'nutrition_supplements', 'office_supplies', 'organic', 'paint', 'p
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<style>
body {
From fd5b6a7152d326e0b01d8f6b5ca29be904c92752 Mon Sep 17 00:00:00 2001
From: Mateusz Konieczny <matkoniecz@gmail.com>
Date: Sat, 22 Apr 2017 06:58:58 +0200
Subject: [PATCH] PIL is dead, recommend pillow directly
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
Slovakia (SK), Austria (AT), Hungary (HU), Poland (PL), Germany (DE), Czechia (CZ), Switzerland (CH), Belgium (BE), Sweden (SE), Brazil (BR), Russia (RU), United Kingdom (GB), Ireland (IE), Lithuania (LT), Australia (AU), United States of America (US), Argentina (AR), Italy (IT), Singapore (SG), New Zealand (NZ), Spain (ES), France (FR), The Netherlands (NL), Spain (ES),
Albania (AL), Ukraine (UA), Portugal (PT),
--------
Slovakia (SK)
tactile_paving on [highway=crossing]
yes: 43%
{"semi"=>7, "no"=>804, "yes"=>625, "partial"=>1, "incorrect"=>10}
Poland (PL), Germany (DE), Switzerland (CH), Russia (RU), United Kingdom (GB), Ireland (IE), Australia (AU), United States of America (US), Argentina (AR), Italy (IT), Japan (JP), Spain (ES), France (FR), The Netherlands (NL), Spain (ES),
Brazil (BR), Portugal (PT),
--------
Slovakia (SK)
tactile_paving on [highway=bus_stop]
yes: 8%
{"no"=>759, "yes"=>75, "incorrect"=>1}
whitelist:
Slovakia (SK), Austria (AT), Hungary (HU), Poland (PL), Denmark (DK), Germany (DE), Czechia (CZ), Switzerland (CH), Belgium (BE), Sweden (SE), Albania (AL), Macedonia (MK), Finland (FI), Belarus (BY), Brazil (BR), Russia (RU), Ukraine (UA), United Kingdom (GB), Ireland (IE), Lithuania (LT), Australia (AU), South Africa (ZA), Ecuador (EC), Mexico (MX), Colombia (CO), United States of America (US), Chile (CL), Turkey (TR), Bulgaria (BG), Greece (GR), Burkina Faso (BF), Croatia (HR), Slovenia (SI), China (CN), Argentina (AR), Uruguay (UY), Peru (PE), Portugal (PT), Iceland (IS), India (IN), Indonesia (ID), South Korea (KR), Italy (IT), Japan (JP), Philippines (PH), Taiwan (TW), Singapore (SG), New Zealand (NZ), Liechtenstein (LI), Spain (ES), Canada (CA), Israel (IL), Thailand (TH), Malaysia (MY), Luxembourg (LU), France (FR), The Netherlands (NL), Bosnia and Herzegovina (BA), Norway (NO),
blacklist:
Georgia (GE), Romania (RO), Venezuela (VE), Brunei (BN),
["cycleway:both", "cycleway", "cycleway:l