Skip to content

Instantly share code, notes, and snippets.

View MarieAshley's full-sized avatar

Ash MarieAshley

  • San Francisco Bay Area
View GitHub Profile
@MarieAshley
MarieAshley / sierpinski.py
Created February 9, 2016 15:06
Create ST Geometry Oracle 12c (Sierpinski Carpet)
"""
Author: Ashley S (MarieAshley)
Versions: Oracle 12c, ArcGIS for Desktop 10.3.1
"""
import cx_Oracle
class IterationError(Exception):
pass
@MarieAshley
MarieAshley / golden.py
Last active February 9, 2016 15:03
Create SDO Geometry Oracle 12c (polygons from the Golden Spiral)
"""
In Oracle 12c, using the SDO Geometry type, this script will create the
polygons from the golden ratio spiral.
Authors:
Danny B
-- original concept and code
-- added and subtracted coordinates to generate new polygons
Ashley S
-- cleared up rough spots by using phi to create perfect squares
@MarieAshley
MarieAshley / geocodeService.py
Created September 18, 2015 17:13
ArcGIS Online Geocode Service
from agol import AGOL
class geocodeService(AGOL):
"""Geocode Service object, that inherits properties from the AGOL object."""
def geocodeAddresses(self):
"""
The geocodeAddresses operation is performed on a Geocode Service resource. \
The result of this operation is a resource representing the list of geocoded addresses. \
This resource provides information about the addresses including the address, location, score, and other geocode service-specific attributes.
@MarieAshley
MarieAshley / community.py
Last active September 19, 2015 01:22
Community object, which inherits from AGOL object (found in this Gist), that is able to search for groups.
from agol import AGOL
class community(AGOL):
"""
Community object that contains operations related to users and groups, \
and inherits properties from the AGOL object.
"""
def groupSearch(self):
"""
@MarieAshley
MarieAshley / agol.py
Last active September 19, 2015 01:21
import urllib, urllib2, json
class AGOL(object):
"""
Superclass that includes most commonly used methods.
"""
def __init__(self, username, password):
self.username = username
self.password = password
import random, unittest
def generateMagicKey():
magicKey = {}
list1 = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
list2 = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
while len(list2) > 0:
z = random.randint(0, len(list2)-1)
y = random.randint(0, len(list2)-1)
a, b = list1[z], list2[y]