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
{ | |
"directory": "resources", | |
"json": "bower.json" | |
} |
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
// create site object instance for watauga | |
var watauga = new Site('03479000'); | |
// download the data from the USGS | |
watauga.downloadData(); | |
// get the cfs output as JSON (this currently is not working) | |
watauga.getCfs(); |
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
""" | |
name: cadToArcgis.py | |
father: Joel Mccune (jmccune@esri.com) | |
birthdate: 01 Apr 2014 (April Fool!) | |
purpose: Your eternal Pythonistic enlightenment...and something about | |
CAD to ArcGIS conversion as well. | |
""" | |
# import modules | |
import arcpy |
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
#### Python has many built-in functions | |
# len() - Returns the length | |
fc = "Railroads.shp" | |
print len(fc) | |
fields = ["OID", "Shape", "Name"] | |
print len(fields) | |
#max() - Returns the maximum value |
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 modules | |
import arcpy | |
def select_zoom(layer, sql): | |
""" | |
Select from the current map document, a feature in a layer and zoom to the specified feature. | |
""" | |
# select by attributes enforcing new selection method to clear any previous selections | |
SelectLayerByAttribute_management(in_layer_or_view=layer, | |
selection_type='NEW_SELECTION', |
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 modules | |
from ftplib import FTP | |
import os | |
def get_day_one(directory_target): | |
""" | |
Retrieve zero to 30 hour precipitation forecasts | |
""" | |
# ftp url | |
url = 'ftp.hpc.ncep.noaa.gov' |
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
// module imports | |
var request = require('request'); | |
var cheerio = require('cheerio'); | |
// variables | |
var url_root = "http://www.americanwhitewater.org/content/River/detail/id/"; | |
var reach_id_start = 1; | |
var reach_id_end = 20; | |
var river_reaches = []; |
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
''' | |
Name: uagi_calculateViolence.py | |
Purpose: In the spatial statistics chapter of UAGI, it is necessary to | |
create and calculate a violence score field. This script takes care | |
of the heavy lifting for you. It adds and populates the field for | |
you. | |
Author: Joel McCune | |
Created: 05 Sep 2014 | |
''' |
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 minidom module | |
import xml.dom.minidom as DOM | |
def get_feature_service(sddraft): | |
""" | |
Converts the default type of sddraft file from a map service to a feature service for publishing to AGOL. | |
Copied and adaped from http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000006q000000 | |
:param sddraft: | |
:return: sddraft: modified to be a feature service |
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
""" | |
name: test_bon_logins.py | |
author: Joel McCune (jmccune@esri.com) | |
date: 02 Jun 2014 | |
purpose: This script tests all the student credentials used for an ARC4 course. The results are, by default, written | |
to a logfile created in the C:/Student directory. This location can be changed by providing an input for the | |
optional output_dir parameter when calling the test_logins function. | |
Please only use this as an initial preliminary test. Oddly enough, although all credentials were passing |