This file contains 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
# #!/bin/bash | |
convert_to_snake_sep() { | |
echo "$1" | tr -s ' ' ' ' | tr '[:upper:]' '[:lower:]' | sed 's/-/_/g' | |
} | |
# Getting source directory | |
echo "Specify the path to the boilerplate directory (e.g. /home/projects/fastapi-poetry-boilerplate)": | |
read src_dir | |
if [ ! -d "$src_dir" ]; then |
This file contains 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
_latLong2Merc = (_lat, _lon) => { | |
/* | |
_lat => Latitude in decimal degree (Number) | |
_lon => Longitude in decimal degree (Number) | |
*/ | |
var r_major = 6378137.000 | |
var lon_rad = (_lon / 180.0 * Math.PI) | |
var x = r_major * lon_rad | |
var scale = x / _lon | |
var y = 180.0 / Math.PI * Math.log(Math.tan(Math.PI / 4.0 + _lat * (Math.PI / 180.0) / 2.0)) * scale |
This file contains 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 os | |
import arcpy | |
def mxdToKMZ(url): | |
if os.path.exists(path): | |
mxd_dir = os.path.split(path)[0] | |
kmz_dir = mxd_dir + "/kml" | |
os.mkdir(kmz_dir) | |
mxd = arcpy.mapping.MapDocument(r"path\to\mxd\file\name.mxd") |