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 arcpy | |
def get_fields(input_fc,only_field_type="String",not_null=True): | |
'''returns list of field names of specified data type and contain at | |
least one not NULL value''' | |
if not not_null: | |
all_fields = [field.name for field in arcpy.ListFields(in_fc,field_type=only_field_type)] | |
return all_fields |
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
def select_distinct(input_fc,input_field): | |
'''returns a list of unique values in a field sorted''' | |
sql = (None, 'GROUP BY {0}'.format(input_field)) | |
cur = arcpy.da.SearchCursor(in_table=input_fc,field_names=["{0}".format(input_field)], | |
sql_clause=sql) | |
unique_values = [f[0] for f in cur] | |
return sorted(unique_values) |
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 arcpy | |
path = r"C:\ArcTutor\Editing\Zion.gdb" | |
#obtaining individual properties | |
release = arcpy.Describe(path).release | |
workspaceType = arcpy.Describe(path).workspaceType | |
workspaceFactoryProgID = arcpy.Describe(path).workspaceFactoryProgID | |
#obtaining a dictionary of properties |
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 sys | |
sys.path.append(r"C:\Program Files (x86)\FME\fmeobjects\python27") | |
from fmeobjects import * | |
import os | |
root_folder = r"C:\GIS\fme" | |
#---------------------------------------------------------------------- | |
def read_features(): | |
"""Reads all features within input shapefile, projects it and writes |
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 sys | |
import os | |
sys.path.append(r"C:\Program Files (x86)\FME\fmeobjects\python27") | |
import fmeobjects | |
#---------------------------------------------------------------------- | |
def project_multiple_shapefiles(): | |
"""Finds all shapefiles in the input folder, projects and outputs | |
a projected feature type into output folder.""" | |
try: |
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 sys | |
sys.path.append(r"C:\Program Files (x86)\FME\fmeobjects\python27") | |
import fmeobjects | |
#---------------------------------------------------------------------- | |
def buffer_single_shapefile_diff_param_values(): | |
""" | |
Processes the same shapefile specified in the FME workbench project | |
creating multiple output shapefiles with the distance appended to the | |
output file. |
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 httplib | |
import time | |
from hashlib import sha1 | |
import random | |
import string | |
import json | |
callerId = "YOUR_CALLER_ID" | |
timestamp = str(int(time.time())) | |
unique = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(16)) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer