POST
|
Just wanted to add this for future generations who are still working with ArcGIS Server-based Feature Services and want to use arcpy/Python to authenticate via token to do stuff. I could not get any of the above to work in my environments (10.8, 10.6.1), but found an outstanding Python toolset called 'restapi' that is great if you still need to run things on Python 2.7.x and more traditional ArcGIS Servers (that are not Portal). Authenticating is easy (token) Editing is easy (including adding/editing attachments for feature services) Highly recommend this repository! GitHub - Bolton-and-Menk-GIS/restapi: Python API designed to work externally with ArcGIS REST Services to query and extr…
... View more
05-22-2020
12:29 PM
|
4
|
0
|
680
|
POST
|
I found this thread because I was experiencing the same issue as Clare. After some fiddling around, I believe I have figured out what the issue is. When using a Single Choice control on a field, the label/description of the choices cannot be too long. For example: I add a single choice control to my survey (using the Web designer). One of my choices was - Commercial Delivery Truck (Fedex, UPS, etc) After adding the remaining choices and pressing the Save button, the following error shows: "Error when parse form". When pressing the details dropdown, it reveals the name of your question > Choices[11]: I deduced that the 10th or 11th option down was my really long choice (see #2) above. After shortening it to Commercial Delivery Truck, saving the form was successful with no errors. Hope this helps someone out there, James
... View more
10-04-2019
09:30 AM
|
0
|
0
|
348
|
POST
|
Hi Brad - I'm picking up this conversation and wanted to know if you had any luck fine-tuning your network? I'm having a similar issue with unexpected route results. Thanks!
... View more
04-16-2019
06:55 PM
|
0
|
1
|
284
|
POST
|
Title says it. Myself and my colleague are already comfortable using the JSAPI to construct our custom-built app, but need help with creating more tasteful/better design. Should we focus on using what's in the Dojo library? We haven't been able to find much training. Perhaps other frameworks for the UI and just use Dojo only for ESRI map stuff? Hoping that the community can help guide me and my colleague on the above.
... View more
11-21-2018
04:32 AM
|
0
|
1
|
376
|
POST
|
DC DOT is currently sharing crash data to the public. We have redacted PII and have attempted to provide a decent summary of relevant attributes. It’s not perfect, but very useful to the general public. Currently, the update frequency is twice a year or so; in the next week we plan to change this to nightly updates. http://opendata.dc.gov/datasets/crashes-in-the-district-of-columbia Thanks, James K. Graham, GISP GIS and Applications Manager Office of Information Technology and Innovation District Department of Transportation 55 M Street SE, Suite 700 Washington, DC 20003 o. 202.741.5391 m. 202.553.8374 f. 202.671.0650 e. james.graham2@dc.gov<mailto:james.graham2@dc.gov> w. ddot.dc.gov<http://ddot.dc.gov/>
... View more
04-18-2017
11:27 AM
|
0
|
0
|
571
|
POST
|
We have been provided a customized story map and our intention is to make some slight alterations and updates to it. We have published this to the following URL: DDOT AlleyPalooza 3.0 Story I've added it to my AGO account, registered and shared it publicly within AGO here: http://dcgis.maps.arcgis.com/home/item.html?id=bbf0653779ae4191bd62dddb9e4dc507#overview Unfortunately, I can't seem to get it to allow me to configure using the built-in configuration tool. I'm prompted to authenticate (even though I'm already logged in) and then get an error message after trying to log in: This is my first time ever customizing someone else's customized template. Any ideas?
... View more
03-06-2017
06:37 AM
|
0
|
2
|
2565
|
POST
|
The responses here identify the problem, but the resolution is actually present in the ArcGIS/ArcMap documentation here: Calculate Field examples—Help | ArcGIS for Desktop A slight tweak the examples gives the resolution, using the Field Calculator: arcpy.time.ParseDateTimeString(!field1!) + datetime.timedelta(hours=12)
... View more
01-17-2017
08:28 AM
|
0
|
0
|
591
|
POST
|
with arcpy.da.UpdateCursor(FClassOrTable, fields) as cursor:
for row in cursor:
row[1] = GetMmax(row[0]) Instead of using a function to breakdown that Mmax value, you could also just use the extent object, which comes as part of the Shape@. Like this: with arcpy.da.UpdateCursor(FClassOrTable, fields) as cursor:
for row in cursor:
row[1] = row[0].extent.MMax
... View more
12-03-2014
08:10 AM
|
0
|
0
|
451
|
POST
|
Peter, I have yet to find a workaround, but Richard's suggestion seems promising. I hacked an ugly workaround (even more ugly than what's above :D), but will give Richard's suggestion a try to see if this works. Seems to me that the info stored in my dict() is just fine. I can enter a set of keys, and return the data just fine if I'm at a break. I'm a little baffled as to why it won't store on the row even though the data seems perfectly legit. :confused: Thanks for both your and Richard's comments. try:
ID_check = entry[0]
print entry[0]
intable = "in_memory\ID_Check"
counter = 0
with da.SearchCursor(intable,["ID"]) as cursor:
for row in cursor:
if row[0] == ID_check:
counter += 1
if counter >= 1:
pythonaddins.MessageBox("This Feature's ID is a duplicate. Solve thi s error before continuing!","Error",0)
raise Exception()
elif counter == 0:
print "All is good, this ID is not a duplicate."
cursor = arcpy.da.InsertCursor(intable,["ID"])
cursor.insertRow([ID_check])
del cursor
edit = da.Editor(workspace)
edit.startEditing(False,True)
edit.startOperation()
with da.UpdateCursor(targetlayer,fields) as cursor:
for row in cursor:
row = entry
print "row: {}".format(row)
cursor.updateRow(row)
del cursor
del row
edit.stopOperation()
#edit.stopEditing(True)
except Exception as e:
print e.message
print arcpy.GetMessages()
arcpy.RefreshActiveView()
print "Complete"
When using "print edit.isEditing" after each edit method they are all true. When I uncomment the line edit.stopEditing(True) an exception is thrown before the print statement saying Start Edit Session. This happens in a versioned sde environment. When using the same code in a personal geodatabase the exception message states something like "unable to perform within an edit session." So my solution for sde is to comment out the stop editing method. This works however if I create a feature then save edits. If I later change the attributes or geometry of that feature the state of the geodatabase changes and the edits cannot be saved. "Attempting to perform action on a closed state. Unable to save edits."
... View more
05-30-2014
07:01 AM
|
0
|
0
|
1698
|
POST
|
Hi Wayne, thanks for your comment. Actually when populating the key in the first code block (4th or 5th) line, I am converting the OID to string when storing the key value. If I didn't have the key (as text), then I would be getting some sort of python key error because it wouldn't exist in the dict. It's finding it, but something else is going on, I believe. Your code looks sound except you forgot your populated 'myinfo' dictionary OID keys are integers...your 'lookup' update cursor code is attempting to use string keys. That creates an exception which isn't really handled - I won't go into that, but you have enough to know how to modify your code. BTW, I may not know what the whole enchilada is on your OID handling -maybe you've got that adequately covered- but don't know how advisable it is to use the OID from one table to use in updating another table? So, bottom line, your code should at least run with "myinfo[row[3]]['...']" statements. Wayne
... View more
05-30-2014
06:36 AM
|
0
|
0
|
1698
|
POST
|
Additional info: we experienced this problem while using a Samsung Galaxy S4
... View more
05-15-2014
08:30 AM
|
0
|
0
|
360
|
POST
|
Happy to say that this issue has been identified and resolved!:) I emailed the android team at esri and Paul Barker provided the answer (thank you Paul): James are you by chance using a samsung device, if so what version of android is it running. Samsung had a bug at one point where their camera app consumed so much memory it actually forced the operating system to steal some of collectors memory which leaves it in a funny state (similar to what you???ve described.). Upgrading (if its an option) to the latest version of android might resolve the issue or downloading another camera app could also work https://play.google.com/store/apps/details?id=com.google.android.GoogleCamera https://play.google.com/store/apps/details?id=com.magix.camera_mx Paul
... View more
05-15-2014
07:33 AM
|
0
|
0
|
360
|
POST
|
I hesitate to call this a 'bug', but it sure seems like it. (Adding points w/attachments in iOS and AGOL desktop browser seems to work fine, Android has the issue described below) Here's the set up: *Map created using ArcGIS 10.2.2 - but MXD is sent to our IT department and they open and publish using 10.2. ArcMap and Server published to are at 10.2. (don't know if this is relevant, but including detail just in case) *Collector for ArcGIS version 10.2.3 - initially upgraded existing Android install, but eventually uninstalled and reinstalled as of today. *In the map, we have two public-facing, secured point feature services, both with attachments and editor tracking enabled. NOTE: these two point fcs have a 1-M relationship class set up. *In ArcGIS.com, we have a single map which is set to private with access to one Group. In the Android version of Collector: this works: 1. Open the app, select the map, enter my security credentials, the map appears, the data are visible, selectable and editable. 2. Click on the (+) sign to add a new feature. Enter various attribute info. 3. Click the 'map' icon to move the point. 3. Click the checkmark to save. 4. Saves feature successfully. this fails: 1. Open the app, select the map, enter my security credentials, the map appears, the data are visible, selectable and editable. 2. Click on the (+) sign to add a new feature. Enter various attribute info. 3. Click the 'map icon to move the point. 4. Add attachment (either from device or via camera). 5. Click the checkmark to save. No 'posting' dialog, just shows the name of the map at the top nav bar. 6. Feature is still in 'edit' mode! I can't go back to the attribute or map view. I'm trapped! 🙂 Here's a quick 2 minute Youtube video that demonstrates the issue:
... View more
05-15-2014
06:21 AM
|
0
|
4
|
921
|
POST
|
I'm having a whale of a time trying to use the arcpy.da.updatecursor while using an edit session to update the feature data. Here's the problem: I've got a script that is trying to update an unversioned point feature class in ArcSDE. The user role has edit privileges to this specific FC. I'll include the relevant bits of my code, but if you'd like to see the whole enchilada let me know and thanks in advance for your help. Here, I'm querying webservice (inside the 'getNearestAddress' function) then building a dictionary with the result. This works without error: with arcpy.da.SearchCursor(points, ('NEARBYADDRESS', 'BLOCK','STREET','SHAPE@X', 'SHAPE@Y', 'OID@')) as cursor:
for row in cursor:
#if row[5] < 100:
thisoid = str(row[5])
point_info = getNearestAddress(row[3], row[4])
#returns a list like this ['Street Address','Block Description','Street Name'] or if no address found ['No Address Nearby']
if str(point_info) == "No Address Nearby":
myinfo[thisoid] = {"address" : "No Address Nearby"}
myinfo[thisoid]["block"] = "Unknown"
myinfo[thisoid]["street"] = "Unknown"
else:
myinfo[thisoid] = {"address" : "".join(point_info[0])} #first value in the dictionary looks like this... create a key
myinfo[thisoid]["block"] = "".join(point_info[1])
myinfo[thisoid]["street"] = "".join(point_info[2])
#the resulting dictionary of a couple of entries will look like this:
#{123: {'address': "123 Main Street", 'block': "100 Block of Main Street", 'street': "Main Street"},
#456: {'address': "456 South Street", 'block': "400 Block of South Street", 'street': "South Street"}} Next, I try to populate the fields of the same FC using the info stored in the dictionary. When the script gets to edit.stopOperation(), I get the error: error return without exception set: edit = arcpy.da.Editor(workspace)
# Edit session is started without an undo/redo stack for versioned data
# (for second argument, use False for unversioned data)
edit.startEditing(False, False)
# Start an edit operation
edit.startOperation()
# Insert a row into the table.
with arcpy.da.UpdateCursor(points, ('NEARBYADDRESS','BLOCK','STREET','OID@')) as cursor:
for row in cursor:
print "Currently on... " + str(row[3])
if row[3] < 100:
##This will successfully save to the feature class!
row[0] = "123 Dummy Address"
row[1] = "100 Block of Dummy"
row[2] = "Dummy"
##This will NOT save to the feature class!!
row[0] = myinfo[str(row[3])]["address"]
row[1] = myinfo[str(row[3])]["block"]
row[2] = myinfo[str(row[3])]["street"]
cursor.updateRow(row)
totalpointsupdated +=1
# Stop the edit operation. THIS IS WHERE THE ERROR OCCURS
edit.stopOperation()
# Stop the edit session and save the changes
edit.stopEditing(True)
... View more
01-22-2014
09:57 AM
|
0
|
6
|
6972
|
POST
|
Rats. I'm having a completely different issue (I think), but I truly appreciate your speedy reply, Dan. I'll post a new (but related) question to the forums shortly. Posted question about the same error here: http://forums.arcgis.com/threads/101241-Problem-committing-edits-with-arcpy.da.updatecursor Thanks again, James
... View more
01-22-2014
08:55 AM
|
0
|
0
|
404
|
Title | Kudos | Posted |
---|---|---|
4 | 05-22-2020 12:29 PM | |
1 | 10-23-2013 05:24 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|