Skip to content

Instantly share code, notes, and snippets.

<?php
$x = (string)filter_input(INPUT_GET, 'x');
$y = (string)filter_input(INPUT_GET, 'y');
$z = (string)filter_input(INPUT_GET, 'z');
$text = '';
$pattern = '/^\d+$/';
if(preg_match($pattern, $x) > 0 && preg_match($pattern, $y) > 0 &&
preg_match($pattern, $z) > 0){
$text = $z . '/' . $x . '/' . $y;
}
def transformLayer(layer = None, crs = None, addToCanvas = False):
"""
QGIS 3.x で、参照系を変換した一時レイヤを作成する。
Parameters
----------
layer : None, str or QgsVectorLayer, default None
変換もとのレイヤ。 None だとアクティブレイヤが選択される。
文字列を指定すると、レイヤ名あるいはソース名で検索し
最初にみつかったレイヤが選択される。
@tohka
tohka / index.html
Last active November 4, 2016 07:48
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
<style>
@tohka
tohka / numdot
Last active December 23, 2015 19:39
#!/usr/local/bin/ruby
# CodeIQ のナムドット問題
# https://codeiq.jp/ace/yuki_hiroshi/q468
# 12345 => 00000
# 1234.5 => 00001
# 1235.4 => 00010