|
POST
|
Completely missed that looking at the docs. Thanks again!
... View more
09-11-2018
09:59 AM
|
0
|
0
|
2944
|
|
POST
|
Awesome. Is that the "boundary" or most outer ring? Thanks!
... View more
09-11-2018
08:19 AM
|
0
|
2
|
2944
|
|
POST
|
I think it's just easier to insert the rings as a single polygon feature into an "in_memory" feature class first. What I didn't reveal was what ultimately I was doing -- clipping. The issue I had was that I was using a polygon to clip with but because there were multiple rings in each feature I was not correctly handling things. To simplify it all, I can just insert the rings from a feature into a feature class and then execute my clip from two whole feature classes. Sorry there's little detail in this but I think I have it covered.
... View more
09-10-2018
10:49 AM
|
0
|
0
|
2944
|
|
POST
|
My code is expecting a single ring of coordinates that will convert into arcpy.Polygon(<polyArray>, <desired spatial ref>) and has worked just fine. However, there some instances where multiple rings are encountered (doughnut polys) and I now need to handle appropriately. Dissolve, exterior ring/poly, etc. any ideas or assistance to convert the following JSON into a SINGLE arcpy.Polygon()??? Thanks! {
"features": [
{
"geometry": {
"rings": [
[
[
-9101613.3137,
3036108.4844999984
],
[
-9101624.0627,
3036107.2901999988
],
[
-9101637.9523,
3036107.067400001
],
[
-9101702.9795,
3036105.580600001
],
[
-9101714.2895,
3036105.3200999983
],
[
-9101716.2594,
3036335.3596
],
[
-9101603.4394,
3036337.8596
],
[
-9101604.4099,
3036452.850299999
],
[
-9101605.0145,
3036567.2518999986
],
[
-9101593.5307,
3036568.089899998
],
[
-9101492.4093,
3036570.249499999
],
[
-9101379.5599,
3036572.659699999
],
[
-9101378.65,
3036457.8000999987
],
[
-9101153.0394,
3036462.66
],
[
-9101152.4496,
3036393.209899999
],
[
-9101152.0695,
3036347.8797999993
],
[
-9101377.6404,
3036342.839400001
],
[
-9101374.448,
3036230.3060000017
],
[
-9101373.2537,
3035998.6063
],
[
-9101601.3704,
3035993.828899998
],
[
-9101600.1761,
3036107.2901999988
],
[
-9101600.445,
3036118.136
],
[
-9101613.3137,
3036108.4844999984
]
],
[
[
-9101602.5648,
3036201.642099999
],
[
-9101603.7591,
3036165.8123000003
],
[
-9101601.3704,
3036139.5370000005
],
[
-9101600.8702,
3036135.285100002
],
[
-9101602.5248,
3036202.0218
],
[
-9101602.5648,
3036201.642099999
]
],
[
[
-9101600.7696,
3036290.5020999983
],
[
-9101600.6783,
3036280.322900001
],
[
-9101600.1761,
3036281.6620999984
],
[
-9101600.7696,
3036290.5020999983
]
]
]
}
}
]
}
... View more
09-10-2018
10:17 AM
|
0
|
9
|
3178
|
|
DOC
|
We have several WAB applications deployed that were developed with various versions of Web AppBuilder (Developer Edition), many of which have the Enhanced Search widget. We're planning an entire rebuild and redeploy of all of these WAB products using the most current Web AppBuilder (Developer Edition) version 2.9. Will the current eSearch widget version 2.7 work or should we reconsider? Thanks!
... View more
09-06-2018
07:48 AM
|
0
|
0
|
11580
|
|
DOC
|
Thanks for that. I should have mentioned the additional detail you provided, it's probably important: Hosted FS Source to a Survey123 survey Attachments Thanks again!
... View more
08-02-2018
09:42 AM
|
1
|
0
|
13490
|
|
DOC
|
Thanks! Invite to group sent. There's only 1 hosted FS in there.
... View more
08-02-2018
05:49 AM
|
0
|
0
|
13490
|
|
DOC
|
I get a KeyError: 'GlobalID' on the last line in this block: # Add Attachments
# Create Match Table
if whereClause != '1=1':
attachmentGlobalIDs = []
for x in data['layers'][0]['features']:
print x['attributes'][OID]
if x['attributes'][OID] in OIDs:
attachmentGlobalIDs.append(x['attributes']['GlobalID']) <--KeyError thrown here
... View more
08-01-2018
12:58 PM
|
0
|
0
|
13490
|
|
DOC
|
Hi Jake -- I'm running this as a scheduled task (a . bat executes the .py script), so no Toolbox implementation. The whereClause is how I posted in my last reply -- I just want to change to only use features from the service after an input date using the CreationDate column. The whereClause works and applied correctly and the script runs most the way thru. It fails when attempting to add attachments and create the match table. Here's the first whereClause statement(s) setup (whereClause2 is for the date filter, I left the original whereClause the same): # Return largest ObjectID
whereClause = '1=1'
whereClause2 = "CreationDate>'{}'".format(inputD)
if whereClause == '':
whereClause = '1=1'
#params = urllib.urlencode({'f': 'pjson', 'where': "CreationDate>'{}'".format(inputDate), 'outFields': '*', 'token': token, 'returnGeometry': 'true'})
params = {'where': whereClause2, 'returnIdsOnly': 'true', 'token': token, 'f': 'json'}
req = urllib2.Request(baseURL, urllib.urlencode(params))
print baseURL
response = urllib2.urlopen(req)
data = json.load(response)
try:
data['objectIds'].sort()
except:
arcpy.AddError("\nURL is incorrect. Or, Service is secure, please enter username and password.\n")
#sys.exit()
OIDs = data['objectIds']
arcpy.AddMessage(OIDs)
count = len(data['objectIds'])
iteration = int(data['objectIds'][-1])
minOID = int(data['objectIds'][0]) - 1
OID = data['objectIdFieldName'] I get the correct list of OIDs. Also, I can see that it retrieves the attachments & creates replica just fine It fails in the section # Add Attachments
# Create Match Table
if whereClause != '1=1':
attachmentGlobalIDs = []
for x in data['layers'][0]['features']:
if x['attributes'][OID] in OIDs:
attachmentGlobalIDs.append(x['attributes']['GlobalID'])
try:
for x in data['layers'][0]['attachments']:
if whereClause != '1=1':
for attachmentGlobalID in attachmentGlobalIDs:
if x['parentGlobalId'] == attachmentGlobalID:
gaUrl = x['url']
gaFolder = cwd + os.sep + x['parentGlobalId']
if not os.path.exists(gaFolder):
os.makedirs(gaFolder)
gaName = x['name']
gaValues = {'token' : token }
gaData = urllib.urlencode(gaValues)
try:
urllib.urlretrieve(url=gaUrl + '/' + gaName, filename=os.path.join(gaFolder, gaName),data=gaData)
except:
PrintException("Error Retrieving Attachments")
rows = arcpy.da.InsertCursor(fc + "__ATTACH", ["GlobalID_Str", "PhotoPath"])
rows.insertRow((x['parentGlobalId'], cwd + os.sep + x['parentGlobalId'] + os.sep + x['name']))
del rows
hasrow = True Specifically, it throws an error here if hasrow == True:
try:
arcpy.AddMessage("Adding attachments")
arcpy.AddAttachments_management(fc, 'GlobalID_Str', fc + '__ATTACH', 'GlobalID_Str', 'PhotoPath')
except:
PrintException("Error Retrieving Attachments")
try:
arcpy.MakeTableView_management(fc + '__ATTACH', "tblView")
arcpy.SelectLayerByAttribute_management("tblView", "NEW_SELECTION", "DATA_SIZE = 0")
arcpy.DeleteRows_management("tblView")
arcpy.DeleteField_management(fc + '__ATTACH', 'GlobalID_Str')
arcpy.DeleteField_management(fc + '__ATTACH', 'PhotoPath')
except Exception, e:
print "Error removing empty rows from attachment table"
PrintException("Error removing empty rows from attachment table")
pass The except block throws the print "Error removing empty rows from attachment table".
... View more
08-01-2018
06:30 AM
|
0
|
0
|
13490
|
|
DOC
|
Jake, I've been trying to apply an additional filter on the initial whereClause variable so that it only pulls feature from my Hosted Feature Service after a specified date. I tried at about line # 220 of the script so that the params variable includes the updated whereClause -- this is what I'm changing from: # Return largest ObjectID
if whereClause == '':
whereClause = '1=1'
params = {'where': whereClause, 'returnIdsOnly': 'true', 'token': token, 'f': 'json'}
data = urllib.parse.urlencode(params)
data = data.encode('ascii') # data should be bytes
req = urllib.request.Request(baseURL, data)
response = urllib.request.urlopen(req)
data = response.read().decode("utf-8")
json_acceptable_string = data.replace("'", "\"")
data = json.loads(json_acceptable_string) To: # Return largest ObjectID
#whereClause = '1=1'
whereClause = "CreationDate>'{}'".format(inputD)
if whereClause == '':
whereClause = '1=1'
#params = urllib.urlencode({'f': 'pjson', 'where': "CreationDate>'{}'".format(inputDate), 'outFields': '*', 'token': token, 'returnGeometry': 'true'})
params = {'where': whereClause, 'returnIdsOnly': 'true', 'token': token, 'f': 'json'}
req = urllib2.Request(baseURL, urllib.urlencode(params))
print baseURL
response = urllib2.urlopen(req)
data = json.load(response) However, anywhere else in the code where it checks for "if whereClause != '1=1':" then it seems to run into issues. Perhaps because it is using a Replica (which is out of sync with the queries feature service?). Is there a straight forward way to alter this script so that the initial whereClause/params filtered on an input date? Thanks
... View more
07-27-2018
11:44 AM
|
0
|
0
|
13490
|
|
POST
|
Hi Tina, I was trying to run this on a Windows Server 2008 R2 box that is a designated "developer" environment for us. FYI: I ended up installing AppStudio on a local computer to test it out (Windows7 machine). However, our org is rapidly moving to Virtual Desktop environments, I will have to coordinate to get it installed there.
... View more
07-16-2018
06:13 AM
|
0
|
0
|
1222
|
|
POST
|
3.0.53 AppStudio_x64_3_0_53.exe is the file I downloaded.
... View more
07-13-2018
01:08 PM
|
0
|
2
|
1222
|
|
POST
|
When clicking the "New App" button, the dialog that opens "Finding apps for you to use. Please Wait." fails to load anything and simply spins and nothing happens. I attempted to login with our AGOL org account as well as not signed in and get the same result. Any input?
... View more
07-13-2018
06:06 AM
|
0
|
4
|
1299
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-17-2020 10:47 AM | |
| 1 | 10-25-2022 11:46 AM | |
| 1 | 08-08-2022 01:40 PM | |
| 1 | 02-15-2019 08:21 AM | |
| 2 | 08-14-2023 07:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-22-2025
02:28 PM
|