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 python | |
############################################################################### | |
# $Id$ | |
# | |
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 | |
# Global Map Tiles Classes | |
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, | |
# generate a simple HTML viewers based on Google Maps and OpenLayers | |
# Author: Klokan Petr Pridal, klokan at klokan dot cz | |
# Web: http://www.klokan.cz/projects/gdal2tiles/ |
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
#全国地方公共団体コードにおける「検査数字」について | |
#https://www.j-lis.go.jp/spd/code-address/cms_1750514.html#cd | |
# | |
#方式(モジュラス11): | |
#第1桁から第5桁までの数字に、それぞれ6.5.4.3.2を乗じて算出した積の和を求め、 | |
#その和を11で除し、商と剰余(以下「余り数字」という。)を求めて、11と余り数字との差の下1桁の数字を検査数字とする。 | |
#ただし、積の和が11より小なるときは、検査数字は、11から積の和を控除した数字とする。 | |
#注) | |
#余り数字が「0」のとき検査数字は「1」。余り数字が「1」のとき検査数字は「0」。余り数字が「10」のとき検査数字は「1」。 | |
# |
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
# https://wiki.openstreetmap.org/wiki/Mercator からPythonでの実装を持ってきてクラスにしたもの | |
import math | |
from typing import List | |
from typing import Tuple | |
class WebMercatorUtils(): | |
R = 6378137.0 | |
@staticmethod | |
def lnglat_to_xy(lon :float, lat :float) -> Tuple[float, float]: | |
"""longitude(経度), latitude(緯度) をもとに WebメルカトルのX, Y座標を計算して返す | |
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
class DegreeDecimalUtil(): | |
# 十進度→度分秒へ変換 | |
@staticmethod | |
def convert_to_decimal(dd :float, mm :float, ss :float): | |
dd_decimal = dd + mm/60.0 + ss/3600.0 | |
return dd_decimal | |
# 十進度→度分秒へ変換 | |
@staticmethod | |
def convert_to_ddmmss(dd_decimal :float): | |
# 度の整数値を取り出します |
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 http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta | |
name="viewport" | |
content="initial-scale=1, maximum-scale=1,user-scalable=no" | |
/> | |
<title> | |
PopupTemplate - use functions to set content | Sample | ArcGIS API for |
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 python | |
# Sample Usage | |
# python bulk_update_details.py -u https://www.arcgis.com -o username -s password -p 'path/to/details.csv' | |
import argparse | |
import json | |
import csv | |
import requests |
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
import pandas as pd | |
import arcpy | |
def validate_df_names(dataframe,output_feature_class_workspace): | |
"""Returns pandas dataframe with all col names renamed to be valid arcgis table names.""" | |
new_name_list=[] | |
old_names=dataframe.columns.names | |
for name in old_names: | |
new_name=arcpy.ValidateFieldName(name,output_feature_class_workspace) | |
new_name_list.append(new_name) | |
rename_dict={i:j for i,j in zip(old_names,new_name_list)} |
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 write_geojson_to_records(geojson): | |
"""Will write geojson to a list of dictionaries with geometry keys holding coordinates and storing the properties | |
to dictionaries. | |
@param: geojson- geojson file to write to records.""" | |
gjson_data = json.load(geojson, encoding='utf-8') | |
records = [] | |
arcpy.AddMessage("Geojson being read by row...") | |
for feature in gjson_data["features"]: | |
try: | |
row = {} |