Skip to content

Instantly share code, notes, and snippets.

View smellman's full-sized avatar

Taro Matsuzawa aka. btm smellman

View GitHub Profile
@smellman
smellman / get_dem_from_gsimap.html
Created June 9, 2017 05:29
Get dem from GSI dem tile example
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Get dem from GSI dem tile</title>
<!-- leaflet.js -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css"
integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"
@smellman
smellman / overpass.geojson
Created March 4, 2017 06:42 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smellman
smellman / overpass.geojson
Created March 3, 2017 00:19 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smellman
smellman / osm-liberty.json
Created February 3, 2017 08:19
osm-liberty + migmix font
{
"version": 8,
"name": "OSM Liberty",
"metadata": {
"mapbox:type": "template"
},
"sources": {
"natural_earth_shaded_relief": {
"maxzoom": 6,
"tileSize": 256,
@smellman
smellman / index.html
Created December 30, 2016 15:30
wellknown.js demo
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GSI Tiles on Leaflet</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.2/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.0.2/dist/leaflet.js"></script>
<script src="https://cdn.rawgit.com/mapbox/wellknown/master/wellknown.js"></script>
<style>
@smellman
smellman / poly2bbox.py
Created December 3, 2016 09:55
Get BBOX value from poly file
import re
def parse(input_file):
f = open(input_file)
lines = f.readlines()
f.close()
longitudes = []
latitudes = []
for line in lines:
r = re.match("\s+([\w\.\+]+)\s+([\w\.\+]+)", line)
{
"version": 8,
"name": "GSI ORT Raster Tiles",
"glyphs": "https://smellman.github.io/creating_tiles_with_global_map_support_files/2015/mapbox_vector_tile_demo/demosites/fonts/{fontstack}/{range}.pbf",
"sprite": "https://smellman.github.io/creating_tiles_with_global_map_support_files/2015/mapbox_vector_tile_demo/demosites/maki-sprites/sprite",
"sources": {
"gsi-ort": {
"type": "raster",
"tiles": [
"https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"
@smellman
smellman / qgis-configdialog.py.diff
Created November 2, 2016 13:33
QGIS ConfigDialog error patch
--- tmp/ConfigDialog.py 2016-11-02 21:53:40.000000000 +0900
+++ /Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ConfigDialog.py 2016-11-02 22:15:03.000000000 +0900
@@ -248,8 +248,9 @@
try:
setting.setValue(unicode(self.items[setting].text()))
except ValueError as e:
+ msg = 'Wrong value for parameter "%s"\n\n%s' % (setting.description, unicode(e))
QMessageBox.warning(self, self.tr('Wrong value'),
- self.tr('Wrong value for parameter "%s":\n\n%s' % (setting.description, unicode(e))))
+ msg)
@smellman
smellman / preview-key-down.scpt
Created September 1, 2016 10:46
Preview page up/down by Keyboard Option+Up/Down
tell application "System Events"
set frontmostProcess to name of first process where it is frontmost
end tell
tell application "Preview" to activate
tell application "System Events"
key code 125
end tell
@smellman
smellman / index.html
Created July 13, 2016 13:37
leaflet + template tag
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>leaflet + template tag</title>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" href="https://npmcdn.com/leaflet@1.0.0-rc.1/dist/leaflet.css" />
<script src="https://npmcdn.com/leaflet@1.0.0-rc.1/dist/leaflet.js"></script>
<script type="riot/tag" src="my-popup.tag"></script>