eeker_XM
- What is a map?
- How are maps made? (GIS)
- Show them some cool web maps!
- Mention the atlas!
ArcGIS Version | Pandas | Numpy | Pip |
---|---|---|---|
10.7.1 | 0.18.1 | 1.9.3 | 18.1 |
10.5 | 0.18.1 | 1.9.3 | 9.0.1 |
10.4.1 | 0.16.1 | 1.9.2 | 7.0.1 |
10.3 | x | 1.7.1 | x |
10.2 | x | 1.6.1 | x |
10.1 | x | 1.6.1 | x |
'''A little script that attempts to fix the awful naming scheme of the Brains | |
On! podcast.''' | |
import os | |
import glob | |
import eyed3 | |
import re | |
def new_name(filename, mp3_date, title): | |
"""Gives a new filename starting with the eyed3 date and then the title |
def find_file_by_type(file_extension, directory=''): | |
if directory == '': | |
root = Tkinter.Tk() | |
directory = tkFileDialog.askdirectory(parent = root, initialdir = "/", title = 'Please Select a Directory') | |
root.withdraw() | |
os.chdir(directory) | |
targetfiles = [] | |
for root, dirs, filenames in os.walk(directory): | |
for name in filenames: | |
if os.path.splitext(name)[1] == file_extension: |
def addraster_list_to_mosaicdataset(rasterlist, mosaic_dataset_path): | |
"""Use this function to add a list of rasters to a mosaic dataset | |
Parameters: | |
rasterlist : list | |
List containing the paths to the rasters to be added to the mosaic | |
dataset | |
mosaic_dataset_path : str | |
String of the path to the mosaic dataset to which the rasters | |
will be added |
Have:
ID | flag |
---|---|
1 | r |
1 | a |
2 | |
2 | |
3 | a |
3 |
"""Needs some work. Needs error handling (empty outputs especially) and better | |
output naming logic. | |
""" | |
import arcpy, os | |
source_polys = r'path to shapefile to be clipped here' | |
clip_polys = r'path to shapefile whose features will be used for the clipping here' | |
def iterclipbyfeatures(source_polys, clip_polys, clip_id='FID', | |
output_prefix='', output_suffix=''): |
def write_dict_to_csv(dictionary, filename): | |
"""Write a dictionary of lists to a CSV file with the keys as the column | |
heading. Will work with lists of unequal length.""" | |
with open(filename, 'w') as myfile: | |
myfile.write(','.join(dictionary.keys())) # write header | |
for line in itertools.izip_longest(*dictionary.values(), fillvalue=''): | |
myfile.write('\n' + ','.join(line)) | |
print "Created file: " + os.getcwd() + '\\' + filename | |
def read_dict_from_csv(filename): |
import logging | |
def setup_custom_logger(name): | |
formatter = logging.Formatter(fmt='%(asctime)s-%(levelname)s-%(module)s-%(funcName)s-%(lineno)d-%(message)s') | |
sthandler = logging.StreamHandler() | |
sthandler.setFormatter(formatter) | |
flhandler = logging.FileHandler('depmorph.log') | |
flhandler.setFormatter(formatter) | |
logger = logging.getLogger(name) |
import collections | |
def findmissing(expectedlist, foundlist): | |
"""Compare two lists and output lists of items that are not included""" | |
expected = collections.Counter(expectedlist) | |
found = collections.Counter(foundlist) | |
not_in_found = list((found - expected).elements()) | |
not_in_expected = list((expected - found).elements()) | |
return not_in_expected, not_in_found |