POST
|
Using an example from the blog post that Joe shared I was able to get the calculation to work with the UpdateCursor in the memory workspace, so it looks like I'm good to proceed. I didn't test using the older in_memory workspace to see if my join + calculation method would work, but I'd rather get it to work with the newer workspace type.
... View more
05-21-2020
08:42 AM
|
2
|
1
|
2071
|
POST
|
Thank you for this link - I'm going to give the dictionary example a try and see if that works with the in-memory features. Thank you for the pointer!
... View more
05-20-2020
08:28 AM
|
0
|
1
|
2071
|
POST
|
In the original version of this script I was writing everything out to disk first, and that worked fine, and I confirmed that the field calculation works that way. I'm trying to do as much in memory as possible to eliminate the disk I/O.
... View more
05-20-2020
08:27 AM
|
0
|
0
|
2071
|
POST
|
Hi all, I'm working on a script that uses the 'memory' workspace as layers are being processed, and I've hit an issue when I try to execute a field calculation between joined layers. I have included a script below that demonstrates the differences between workflows - the calculation will work fine if I create the feature layers from layers on disk, but will fail if the feature layers are created from layers in the memory workspace - testtype "fromdisk" works but testtype "frommemory" does not. import arcpy
inLine = r"D:\TEMP\Output_20200520080600.gdb\LINE00240"
inPoint = r"D:\TEMP\Output_20200520080600.gdb\StructureJoin"
testtype = "fromdisk"
if testtype == "fromdisk":
# Features are stored on disk
# Feature layers are created from layers on disk
print("Running disk workflow")
# Make feature layers
arcpy.MakeFeatureLayer_management(inLine, "LineFeature")
arcpy.MakeFeatureLayer_management(inPoint, "StructureFeature")
# Add join
arcpy.AddJoin_management("LineFeature", "OBJECTID", "StructureFeature", "ORIG_FID", "KEEP_COMMON")
# Calculate field
in_field = "Field_Name"
expression = '!StructureJoin.STRUCTURE_GUID!'
arcpy.CalculateField_management("LineFeature", in_field, expression, "PYTHON3")
elif testtype == "frommemory":
# Features are stored on disk
# Make copy of data in memory
# Feature layers are created from layers in memory
print("Running memory workflow")
# Copy features to memory
arcpy.CopyFeatures_management(inLine, r"memory\Lines")
arcpy.CopyFeatures_management(inPoint, r"memory\Structures")
# Make feature layers
arcpy.MakeFeatureLayer_management(r"memory\Lines", "LineFeature")
arcpy.MakeFeatureLayer_management(r"memory\Structures", "StructureFeature")
# Add join
arcpy.AddJoin_management("LineFeature", "OBJECTID", "StructureFeature", "ORIG_FID", "KEEP_COMMON")
# Calculate field
in_field = "Field_Name"
expression = '!Structures.STRUCTURE_GUID!'
arcpy.CalculateField_management("LineFeature", in_field, expression, "PYTHON3")
The resulting error is: Running memory workflow Traceback (most recent call last): File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4527, in CalculateField retval = convertArcObjectToPythonObject(gp.CalculateField_management(*gp_fixargs((in_table, field, expression, expression_type, code_block, field_type), True))) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 511, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds. Failed to execute (CalculateField). Do I need to do something different when using the memory workspace?
... View more
05-20-2020
06:23 AM
|
0
|
9
|
2181
|
POST
|
Alicia, Here are a few resources for downloading data from your ArcGIS Online account: Download data | ArcGIS for Developers - "Automate downloading data from the cloud using ArcGIS API for Python." How To: Download feature service items from ArcGIS Online using ArcGIS API for Python - Esri Technical Support GitHub - tedrick/SyncSurvey: Synchronize a Hosted Feature Service to an Enterprise Geodatabase - "This script will extract the data from a Feature Service and import it into a File Geodatabase or an Enterprise Geodatabase." You may need to update them a bit to have them run as a scheduled task - check out the forum thread here (Run Python API script as scheduled task? ) for links and discussion. --Tim https://www.geo-jobe.com/
... View more
04-24-2020
03:58 AM
|
2
|
1
|
2476
|
POST
|
Bree, OK, I would try two things - first, add a 'test' feature to each feature class before publishing, and also try publishing a service to ArcGIS Online through ArcMap rather than doing the file upload (Publish to ArcGIS Online and ArcGIS Enterprise—Publish services | Documentation) --Tim https://www.geo-jobe.com/
... View more
04-03-2020
08:14 AM
|
0
|
1
|
1520
|
POST
|
When you check the properties of the feature class that you've created, what do you see under the XY Coordinate System tab? Do the features have a valid projection set? --Tim https://www.geo-jobe.com/
... View more
04-03-2020
03:42 AM
|
0
|
3
|
1520
|
POST
|
Pawel, If you have the new coordinates as field attributes, you could use a python script to update the location of the feature. Something like this could work: import arcpy
import sys
import time
import traceback
# Capture start time
tStart = time.time()
# Workspace, target feature class, and fields variables
# Coordinate fields in attribute table should be of type 'Double'
arcpy.env.workspace = r'C:\TEMP\PointMoveTest.gdb'
fc = r'C:\TEMP\PointMoveTest.gdb\AddressPointsModified'
fields = ['SHAPE@X', 'SHAPE@Y', 'gps_x', 'gps_y']
try:
# Create update cursor for feature class
with arcpy.da.UpdateCursor(fc, fields) as cursor:
for row in cursor:
# Set X, Y values to fields in 'fields' variable
row[0] = row[2]
row[1] = row[3]
# Update the row
cursor.updateRow(row)
except arcpy.ExecuteError:
msgs = arcpy.GetMessages(2)
arcpy.AddError(msgs)
print(msgs)
except:
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1])
msgs = "ArcPy ERRORS:\n" + arcpy.GetMessages(2) + "\n"
arcpy.AddError(pymsg)
arcpy.AddError(msgs)
print(pymsg)
print(msgs)
# Capture end time and calculate elapsed time
tEnd = time.time()
elapsedTime = round(tEnd - tStart, 2)
print 'Script completed in {0} seconds'.format(elapsedTime)
--Tim https://www.geo-jobe.com/
... View more
03-26-2020
08:50 AM
|
0
|
0
|
414
|
POST
|
This question is a few months old but I wanted to respond anyway, as we've been looking at the same thing. There are now some places in the ArcGIS Pro documentation where recommendations for different cloud providers are listed. See Cloud virtualization—ArcGIS Pro | Documentation and pages that are linked there. Also, be sure to look at posts about ArcGIS Pro on the Esri blog - there was a new one this month about instance types in Azure ArcGIS Pro on the Azure NVv4-series And, as usual, it might take some testing to determine which instance type is best for the work your're doing. --Tim https://www.geo-jobe.com/
... View more
03-26-2020
06:01 AM
|
0
|
0
|
684
|
POST
|
Jeff, Did you check to confirm that the arcgis account (or whatever account your're using for the services) has permission to write to the specified output directory? --Tim
... View more
03-26-2020
05:32 AM
|
0
|
0
|
2544
|
POST
|
In my case I worked with two different support analysts to troubleshoot the issue but in the end the issue just kind of 'went away' and we were able to download Esri basemaps for every project we tried. If you still have your support case open and would like to reference mine for the sake of additional information, it was #02227979. In my case I was getting the error using Collector on Andriod and iOS, including the new Aurora release for iOS. --Tim
... View more
01-02-2019
09:17 AM
|
0
|
2
|
2178
|
POST
|
Thanks Brian, I also opened a support case for this issue and should be working with an analyst this afternoon. In my case I am receiving the Invalid URL error when using the Esri Topographic and World Imagery base map choices, both on my Android tablet and on an iPad. --Tim
... View more
12-05-2018
09:20 AM
|
0
|
1
|
2178
|
POST
|
Brian, I started seeing this error today with an organization that I work with. We are using ArcGIS Enterprise 10.6, and using Collector on Android devices (various Samsung devices). I'm not seeing any relevant errors in the Portal or Server logs, so I'm not sure what URL is invalid. I have tried reinstalling Collector, and re-applying the ArcGIS Online credentials to the base map item in portal. I have also tried different wireless networks, changing download extents, level of detail, etc. --Tim
... View more
12-03-2018
11:39 AM
|
0
|
3
|
2178
|
POST
|
I encountered this same issue today and wanted to provide my solution, as it's not listed here. On both my PC (Windows) and tablet (Android) I was attempting to access a public survey but kept getting the 'does not exist' error. In both cases I found that the last location I had logged into with Survey123 was an ArcGIS Enterprise site; I wasn't currently signed in to the site on either device, but I guess Survey123 was still looking there for the survey, even though it was published to ArcGIS Online. So, I switched the 'active' portal to ArcGIS Online, signed in/out, and the survey was accessible. --Tim
... View more
11-28-2018
03:36 PM
|
1
|
2
|
1822
|
IDEA
|
I think it would be useful if the currently active portal were saved in an ArcGIS Pro project. As a consultant working with many customers I have many portal connections saved (currently 12) in ArcGIS Pro. Each time I open a project ArcGIS Pro reconnects to the most recently used connection, which is not necessarily related to the project that I am working on. I have found this to be a small issue in a couple of ways: If the last portal connection was private (i.e. I was connected to a portal while on-site or over VPN) it takes some time for the connection to time-out and to be able to connect to a new portal When trying to 'Switch Active Portal' in ArcGIS Pro, it can take a moment for the software to test each connection (I assume that's what it is doing) to determine if it's available or not, and to make the portal connections selectable based on connectivity. Overall, I think it would be convenient if the active portal connection were saved with each ArcGIS Pro project.
... View more
11-19-2018
07:04 AM
|
3
|
5
|
786
|
Title | Kudos | Posted |
---|---|---|
1 | 09-18-2015 11:29 AM | |
1 | 09-18-2015 12:59 PM | |
1 | 11-28-2018 03:36 PM | |
1 | 10-30-2018 05:02 AM | |
3 | 05-03-2018 05:37 AM |
Online Status |
Offline
|
Date Last Visited |
04-27-2023
05:48 PM
|