Skip to content

Instantly share code, notes, and snippets.

View talllguy's full-sized avatar
🎯
Focusing

Elliott Plack talllguy

🎯
Focusing
View GitHub Profile
@brambow
brambow / arcpy_data_dictionary.py
Created May 22, 2018 13:58
Create a Data Dictionary for ArcGIS Pro Feature Classes
# generate a data dictionary from an ArcGIS feature class
# tested with ArcGIS Pro/Python3
# Run from command prompt in ArcGIS Pro environment
# Takes 2 arguments: 1) path to feature class 2) path for output CSV file
# Example: python C:\arcpy_data_dictionary.py C:\yourgeodatabase.gdb\featureclassname C:\output.csv
import arcpy
import sys
import csv
require 'rubygems'
require 'mechanize'
require 'google_drive'
agent = Mechanize.new
@base_url = "https://www.baltimorecitibuy.org"
page = agent.get("#{@base_url}/bso/external/publicContracts.sdo")
page.css('td[class="inputs-01"][align="center"]').first.text[/ of (\d+)/]
item_count = $1.to_i
puts "item 1 of #{item_count}"
@amarinelli
amarinelli / agol_backup_utility.py
Created March 31, 2015 22:11
Python utility to backup (batch or single) hosted feature services in ArcGIS Online. Requires ArcGIS Desktop 10.2+
from __future__ import print_function
import time
import json
import os
import tortilla
from requests.packages import urllib3
import arcpy
@dalekunce
dalekunce / mapillary_setup.md
Last active May 13, 2017 09:57
Mapillary Setup and Tools

#merge gpx files

gpsbabel -i gpx -f file1.gpx -f file2.gpx -o gpx -F merged.gpx

#attach GPX to photo get needed libs first

pip install gpxpy
brew install pyexiv2 exiftool
git clone https://github.com/mapillary/mapillary_tools.git
python geotag_from_gpx.py path/to/photos gpx_track.gpx timeoffset
@oconnoat
oconnoat / SimpleHTTPChrome.sh
Created April 18, 2014 09:17
start a python SimpleHTTPServer on port 8000 in this directory and open chrome to the root
python -m SimpleHTTPServer & open -a "Google Chrome" http://localhost:8000
<?php
header('Content-type: text/plain');
# Grab URL
$ch = curl_init($_GET['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$urlin = curl_exec($ch);
curl_close($ch);
@benbalter
benbalter / geojson-conversion.sh
Last active April 23, 2024 13:16
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
@rclark
rclark / L.TopoJSON.js
Last active December 7, 2022 00:23
TopoJSON-aware Leaflet layer
/*
You'll need something like this in your HTML:
<script src="http://d3js.org/topojson.v1.min.js"></script>
*/
L.TopoJSON = L.GeoJSON.extend({
addData: function(jsonData) {
if (jsonData.type === "Topology") {
for (key in jsonData.objects) {
geojson = topojson.feature(jsonData, jsonData.objects[key]);
@nsbingham
nsbingham / tidy-config.txt
Created March 31, 2013 15:56
Clean up a HTML generated by Word with HTML Tidy on OSX
# Install tidy
brew install tidy
# Export the Word doc as HTML
# Create a config file named tidy-config.txt like below
# Find more at http://tidy.sourceforge.net/
tidy -config tidy-config.txt -o cleaned.html -i dirty.htm
@calvinmetcalf
calvinmetcalf / streetType.json
Created December 6, 2012 20:42
street types
{
"types":[
"ABBOTTSWOOD",
"ACCESS",
"ACRES",
"AFIELD",
"ALLEY",
"ANNEX",
"APPROACH",
"ARBORWAY",