Skip to content

Instantly share code, notes, and snippets.

View talllguy's full-sized avatar
🎯
Focusing

Elliott Plack talllguy

🎯
Focusing
View GitHub Profile
@talllguy
talllguy / GDBdomainsToXLSX.py
Created July 18, 2018 03:41
Python script that outputs Excel (XLSX) files for all domains in a geodatabase. It is designed to run at the ArcGIS Pro command line.
## Specify the File Geodatabase workspace
gdb = "C:\\Users\\XXXXXXXX\\Documents\\ArcGIS\\Projects\\XXXX.gdb"
## Get a list of domains
desc = arcpy.Describe(gdb)
domains = desc.domains
## Loop over the list of domains
for domain in domains:
## Create an object that represents the name of the Excel file to be created
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@talllguy
talllguy / park-n-ride-popup.html
Created April 1, 2020 18:52
added popup config for MDOT SHA Park and Ride popup
Refer to the MDOT SHA Park &amp; Ride Field Guide for more information on this data. <b>The survey team does not update lot information but if anything appears to be different from this data, make a note in the <i>Attribute Updates Needed per Survey</i> field</b><br /> <br />
<font size="5">General Lot Information</font><br />
General information about the park &amp; ride. This information is maintained by DGD and RIPD.
<table>
<tbody>
<tr>
<td><font color="#808080" face="Arial, Helvetica, sans-serif"><b>Common Name</b></font></td>
<td><font color="#000000" face="Arial, Helvetica, sans-serif"><b>{COMMON_NAME}</b></font></td>
</tr>
<tr>
@talllguy
talllguy / explorer_arcade.js
Last active October 5, 2019 00:58
Arcade function to call CONNECTExplorer URL of a point in web map that is projected in meters.
function MetersToLatLon(x, y) {
// Converts XY point from Spherical Mercator EPSG:900913 to lat/lon in WGS84 Datum
// Source: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
// Source: https://community.esri.com/thread/222695-latlong-unit-conversion-with-arcade#comment-806053
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (x / originShift) * 180.0;
var lat = (y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
@talllguy
talllguy / mapillary_arcade_url.js
Last active July 31, 2019 03:13
Arcade JS to return Mapillary map for given point
function MetersToLatLon(x, y) {
// Converts XY point from Spherical Mercator EPSG:900913 to lat/lon in WGS84 Datum
// Source: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
// Source: https://community.esri.com/thread/222695-latlong-unit-conversion-with-arcade#comment-806053
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (x / originShift) * 180.0;
var lat = (y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
@talllguy
talllguy / apple_arcade_URL_gen.js
Created June 4, 2019 12:29
Arcade expression for generating an Apple Maps directions link at a point
function MetersToLatLon(x, y) {
// Converts XY point from Spherical Mercator EPSG:900913 to lat/lon in WGS84 Datum
// Source: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
// Source: https://community.esri.com/thread/222695-latlong-unit-conversion-with-arcade#comment-806053
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (x / originShift) * 180.0;
var lat = (y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
@talllguy
talllguy / waze_arcade_URL_gen.js
Created June 4, 2019 12:23
Arcade expression for generating a Waze directions link at a point
function MetersToLatLon(x, y) {
// Converts XY point from Spherical Mercator EPSG:900913 to lat/lon in WGS84 Datum
// Source: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
// Source: https://community.esri.com/thread/222695-latlong-unit-conversion-with-arcade#comment-806053
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (x / originShift) * 180.0;
var lat = (y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
@talllguy
talllguy / index.html
Last active May 24, 2019 19:03
Facilities popup with explorer URL
<div style="text-align: right;"><font size="2"><img alt="MDOT Logo" src="https://geo.sha.maryland.gov/images/maryland_MDOT_logo_CMYK_croppedtran75.png" /><br />
</font></div>
<div style="text-align: center;"><font size="2"><font face="Arial, Helvetica, sans-serif">
{Address}<br />
{City}, {State}  {ZIP_Code}<br />
<font color="#8b0000" style=""><a href="{expression/expr0}" style="font-weight: bold;"><font color="#8b0000">View in Connect Explorer Imagery</font><br /></a>(</font></font><a href="mailto:GIS@mdot.maryland.gov?subject=Request%20for%20Oblique%20Imagery%20Access" target="_blank"><font color="#8b0000">Request Access</font></a><font face="Arial, Helvetica, sans-serif" style=""><font color="#8b0000" style="">)<br /><b> </b></font></font></font></div><font face="Arial, Helvetica, sans-serif"><font size="2">
</font><font face="Arial, Helvetica, sans-serif" style=""><font size="2">
<u>MDOT SHA ID#</u>: {SHA_ID_Number}<br />
<u>FMIS ID#</u>:{ID_Number}<br />
<u>MDOT SHA District</u>: {SHA_District}<br />
@talllguy
talllguy / ogr2ogr_multiple_shapes_to_fgdb.bat
Created April 11, 2019 12:31
Batch ogr2ogr script that combines multiple shapefiles in a folder into one geodatabase layer
REM Replace `gdb_name.gdb` and `name_of_layer` with your own names
REM Citation: https://gis.stackexchange.com/a/283981/15499
for %f in (*.shp) do (if not exist test.gdb (ogr2ogr -progress --config shape_encoding "UTF-8" -f "filegdb" gdb_name.gdb %f -nln name_of_layer -lco encoding="UTF-8") Else (ogr2ogr --config shape_encoding "UTF-8" -progress -f "filegdb" -update -append gdb_name.gdb %f -nln name_of_layer -lco encoding="UTF-8"))