# leave GlobalID out - you cannot edit this field in the destination geodb # makes use of the "updatevalue function to deal with dates # ListFields( cwd + '/data.gdb/myLayer')įor cfX in data: InsertCursor( cwd + '/data.gdb/myLayer')įields = arcpy. urlretrieve( url = gaUrl + '/' + gaName, filename = os. urlretrieve( replicaUrl, 'myLayer.json')įor x in data: Request( crUrl, crData)ĬrResponse = urllib2. setValue( field_to_update, value) # change "fromtimestamp" to "utcfromtimestamp" fromtimestamp( value / 1000) # convert to date - this is local time, to use utc time If outputfield = None or value = None: #exit if no field found or empty (null) value passed in name = field_to_update), None) #find the output field Outputfield = next(( f for f in fields if f. # since json has dates as a long (milliseconds since unix epoch) and geodb wants #ĭef updateValue( row, field_to_update, value): # function to update a field - basically converts longs to dates for date fields # Import os, urllib, urllib2, datetime, arcpy, json
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |