POST
|
Try deleting your editor object as well (using del) and rather than using rmtree to delete your FGDB, try using the arcpy.Delete_management geoprocessing tool.
... View more
01-04-2019
12:53 PM
|
1
|
1
|
1599
|
POST
|
It seems kind of hacky, but one approach might be to do this: - Export the feature class to an XML workspace document (schema only) - Use Python to modify the XML file, specifically the geometry type and feature class name - Import the XML workspace document That should maintain all of the subtypes and such.
... View more
10-11-2018
10:26 AM
|
2
|
1
|
1537
|
POST
|
It's also odd that you can open a layer file with a search cursor and retrieve attributes other than the shape - I tried pulling the OID@ token from a layer file and it was no problem, switched it to SHAPE@ and it raised an error.
... View more
09-05-2018
06:20 AM
|
2
|
1
|
1054
|
POST
|
I was able to reproduce what you found using the SHAPE@ token, that is odd. Simple workaround is to create a layer (arcpy.mapping.Layer) using the LYR file first and then create the search cursor on it, e.g.: lyr = arcpy.mapping.Layer(r"C:\Wherever\MyLayer.lyr")
with arcpy.da.SearchCursor(lyr, ["SHAPE@"]) as sc:
...
... View more
09-04-2018
01:11 PM
|
2
|
0
|
1054
|
POST
|
Hi Carsten, perhaps you could use a geoprocessing tool written in ArcObjects and then published as a service to perform the complex edits needed. I did something similar several years ago (no sample code on hand now, unfortunately) with the connection properties stored in a configuration file. A standard map service could still be used for read access. Another option that may or may not work depending on the complexity of these features and edits is to use a Server Object Interceptor with a map service that has feature access enabled (SOIs can intercept edits in this way, then perform custom editing inline). In my opinion the big advantage of SOIs is that you don't need any client-side customization like you do for SOEs or GP services, but it also sounds like what I've used them for is less complex than what you're looking for.
... View more
05-02-2018
08:57 AM
|
0
|
1
|
465
|
POST
|
Hi Grant, after making changes have you refreshed your toolbox's contents in ArcCatalog or the ArcMap Catalog window? I copy/pasted your code and it worked right away:
... View more
05-01-2018
01:24 PM
|
1
|
1
|
917
|
POST
|
The dialog doesn't even show PYT files (not just one in particular, it doesn't seem to recognize the file type altogether). TBX files seem to appear fine, however.
... View more
04-24-2018
10:27 AM
|
0
|
0
|
583
|
POST
|
I recently moved a PYT toolbox from one machine to another - both machines have Windows 10 and ArcGIS Desktop 10.3.1, and while the new box has been used to run some ArcPy scripts from the command line, it hadn't been used with PYTs to this point. When connecting to the folder containing the PYT in ArcCatalog, the toolbox did not appear (although its metadata did as a standalone XML file). Suspecting something was up with this particular PYT file, I right-clicked to create a new Python toolbox. The new toolbox appeared but upon refreshing it too disappeared, with the metadata XML left in its place. The same behaviour is reproducible in ArcMap. PYT files are shown with the proper icon in the Windows shell, so the file association seems to be fine. Next I attempted to copy my PYT file into the "My Toolboxes" location through the Windows shell. Viewing My Toolboxes in the catalog window, the PYT file was visible and remained so (and could be run successfully). Likewise, the Space Time Pattern Mining Tools PYT toolbox in System Toolboxes is visible but when copied to any of the locations under Folder Connections will disappear. Has anyone else run into anything similar and determined a cause or solution?
... View more
04-24-2018
09:48 AM
|
0
|
2
|
741
|
POST
|
In case anyone comes across this and doesn't/can't have permanently sorted data... Was thinking about this some more this evening, trying to come up with a way to solve the case where the dataset isn't permanently sorted using the field calculator... Don't think it's possible using the calculator since to the best of my knowledge you can't do a look-ahead/sort, but using the Python window this should work: def applyRanks(layerName, valueField, rankField):
# Read the values from the dataset
allValues = set()
with arcpy.da.SearchCursor(layerName, [ valueField ]) as searchCursor:
for row in searchCursor:
allValues.add(row[0])
# Create a value/rank lookup
lookup = { value : rank + 1 for (rank, value) in enumerate(sorted(allValues, reverse=True)) }
# Set the ranks on the rows
with arcpy.da.UpdateCursor(layerName, [valueField, rankField]) as updateCursor:
for row in updateCursor:
row[1] = lookup[row[0]]
updateCursor.updateRow(row) Once added to the Python window, a call like this (using the fields from the original question) should apply the ranks: applyRanks("theLayerName", "EPDO", "RANK_EPDO")
... View more
04-17-2018
07:53 PM
|
1
|
2
|
3692
|
POST
|
Hi James, I was able to reproduce what you found - I tested downloading/unpacking while logged in (which went smoothly), logging out, filling out the survey then submitting anonymously and it worked, so it does seem the failure to submit anonymously is directly linked to the unpacking issue. Unfortunately I tried republishing from Survey123 Connect (I only made a label change) and still experienced the indefinite unpacking problem. I also tried publishing a new survey from Survey123 Connect - using one of the templates without any changes - with the same results. Also, I don't know if logging in to download the form will be an acceptable workaround, the end goal is to allow users without AGOL accounts to enter data - unless there's an alternative way to download forms? For example, is copy/pasting forms directly into the "My Surveys" directory a supported workflow?
... View more
04-17-2018
07:22 PM
|
0
|
8
|
850
|
POST
|
Good catch, I only tested that against data that was already coincidentally sorted that way on another field. I'm going to delete my earlier post so it doesn't mislead anyone.
... View more
04-16-2018
06:23 PM
|
1
|
0
|
3692
|
POST
|
Ultimately getting a photo attached is one of my requirements but for now I'm testing without a photo, only field is a single-line textbox.
... View more
04-16-2018
06:21 PM
|
0
|
1
|
850
|
POST
|
Hi James, There are in fact two issues which may be related. First, when I attempt to download and unpack a survey, it consistently hangs during unpacking. The spinner hangs indefinitely. I've reproduced this with over 15 new surveys created in both the Survey123 website as well as Survey123 Connect, and on four different devices (Android, iOS and Windows). Closing the app while it's spinning indefinitely and re-opening allows use of the survey, however. The second issue relates to anonymous submission from the app. I can submit through the web form and the REST API without authentication so I don't believe it's an AGOL privileges issue. Here are two log files, the first generated when trying to download and unpack and the second generated when trying to submit a record: Survey123forArcGIS-20180416-174130.log - Google Drive Survey123forArcGIS-20180416-174307.log - Google Drive Also, here's the link to the most recent test survey (it's basically empty, just trying to get these issues sorted before investing any time in constructing a proper form): https://survey123.arcgis.com/share/5cfb768198f64799ba73e45804b22363?open=native Thanks, James
... View more
04-16-2018
04:53 PM
|
0
|
13
|
850
|
POST
|
ListDatasets will return a None value if the workspace path is incorrect and points to a non-existent location. Your path ends with "ArdenArden_gsw_sde_sde" - is this missing a ".sde" extension, or perhaps the last underscore is supposed to be a period? If you try to call arcpy.Describe() on that path, does it return a valid collection of properties or raise a runtime error?
... View more
04-16-2018
03:03 PM
|
2
|
0
|
613
|
Title | Kudos | Posted |
---|---|---|
1 | 05-01-2018 01:24 PM | |
1 | 04-17-2018 07:53 PM | |
1 | 03-02-2018 08:44 AM | |
1 | 02-02-2018 02:58 PM | |
1 | 01-16-2018 08:53 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|