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
### CURRENT | |
# Result is a enum of streams in any order. To get a particular stream you loop through them, | |
# and ask for it's type. A particular requested stream is not returned if it's not | |
# on the activity (need to code defensively). | |
streams = client.get_activity_streams(123, types=types, resolution='medium') | |
heartrate_stream = None | |
for s in streams: |
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 pprint_fields(table): | |
""" pretty print table's fields and their properties """ | |
def _print(l): | |
print("".join(["{:>12}".format(i) for i in l])) | |
atts = ['name', 'aliasName', 'type', 'baseName', 'domain', | |
'editable', 'isNullable', 'length', 'precision', | |
'required', 'scale',] | |
_print(atts) | |
for f in arcpy.ListFields(table): |
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 export_fc_to_csv(fc, out_csv): | |
""" | |
Export each vertex in a line or poly fc to a csv with OID | |
user requested at http://arcpy.wordpress.com/about/#comment-348 | |
example | |
import geom_snippets | |
geom_snippets.export_fc_to_csv(r"c:\proj\fc1.shp", r"c:\proj\fc1.csv") |
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 connect_parts(fc): | |
""" | |
Takes each part of a line feature. If made of more than one path | |
(aka segment, aka part) connects them into a single path. | |
Vertices are unchanged. | |
Code authored on ArcGIS ver 10.2.2 | |
""" | |
import json | |
with arcpy.da.UpdateCursor(fc, "Shape@JSON") as uc: |