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/local/bin/ruby | |
# CodeIQ のナムドット問題 | |
# https://codeiq.jp/ace/yuki_hiroshi/q468 | |
# 12345 => 00000 | |
# 1234.5 => 00001 | |
# 1235.4 => 00010 |
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
<!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> |
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
def transformLayer(layer = None, crs = None, addToCanvas = False): | |
""" | |
QGIS 3.x で、参照系を変換した一時レイヤを作成する。 | |
Parameters | |
---------- | |
layer : None, str or QgsVectorLayer, default None | |
変換もとのレイヤ。 None だとアクティブレイヤが選択される。 | |
文字列を指定すると、レイヤ名あるいはソース名で検索し | |
最初にみつかったレイヤが選択される。 |
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
<?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; | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/ruby | |
def read_data(io, type, bo, label = '') | |
data = nil | |
bytes = nil | |
value = nil | |
if type == :int | |
data = io.read(4) |
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
from qgis.core import * | |
from qgis.gui import * | |
""" | |
使い方: | |
getFeatureAttribute(対象レイヤID, 空間関係, 取得したい属性名) | |
例: | |
getFeatureAttribute('ポリゴンレイヤ_7dff1692_ba18_4bd1_bf46_63785338b050' , 'intersects', 'name') |
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
{ | |
"common_fields" : [ | |
["gml_id", "String"], | |
["fid", "String"], | |
["lfSpanFr", "Date"], | |
["lfSpanTo", "Date"], | |
["devDate", "Date"], | |
["orgGILvl", "String"], | |
["orgMDId", "String"], | |
["vis", "String"] |
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/ruby | |
class NumberPlace | |
def initialize(ary=nil) | |
init(ary) | |
end | |
def init(ary=nil) | |
@cells = Array.new(81) do | |
[1, 2, 3, 4, 5, 6, 7, 8, 9] |
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
# 図郭コードから [xmin, ymin, xmax, ymax] を求める | |
# 図郭コードは平面直角座標系の系を除外したコードとする | |
# 例) 09LD352 → LD352 | |
def zukaku(code, output_wkt=false) | |
level = nil | |
if code =~ /^[A-T][A-H]$/ | |
level = 50000 | |
elsif code =~ /^[A-T][A-H]\d\d$/ | |
level = 5000 | |
elsif code =~ /^[A-T][A-H]\d\d[1-4]$/ |
OlderNewer