|
POST
|
I have a custom Python Toolbox that has been running fine. Since the update to Pro, when I run the script, the program immediately crashes and if I can open the dialog box in time, it contains the following error: Error 000819: The tool is not available or is unassigned All of my third party packages are in the python environment that is active in Pro and I have background processing turned off int he script. I'm not sure what else to try. What would have changed in the update to make this suddenly start to happen?
... View more
02-17-2020
07:15 AM
|
0
|
5
|
3553
|
|
POST
|
Hi Neeraj, The sample data can be downloaded here: watershed_data.gdb.zip - Google Drive - the GDB includes the input raster for the pour point tool, the flow accumulation raster and the flow direction raster. To answer your questions, For snap pour point tool: 1) Input pour point (Raster or feature) - included in GDB 2) Input accumulation raster (Raster) - included in GDB 3) Snap distance - 0 4) Pour point field - Value For Watershed tool, 1) Input flow direction raster - included in GDB 2) Input pour point data (Is this the output from the Snap Pour Point tool? If so, you don't need to provide this) - output from snap pour point tool 3) Pour point field - Value Are you using any environment settings? (Such as Parallel Processing Factor) I originally had no environment settings other than default. But, in testing, I tried increasing the parallel processing factor and it had no impact on the speed of the tool. Lastly, could you also provide any information on the machine configuration you are using? OS Name: Windows 10 Pro Processor: Intel(R) Xeon(R) CPU E3-1245 v5 @3.50GHz Memory (RAM): 16.0 GB Disk space and type (SSD or HDD): HDD 224 GB total, 45.2 GB free space I also made the switch to Windows 10 around the same time I upgraded to ArcMap 10.7, but I'm not sure if I ran these tools between the switch or not. Thank you for checking this out!
... View more
01-03-2020
05:42 AM
|
0
|
1
|
1698
|
|
POST
|
Has anyone else noticed this in ArcMap 10.7? I have a custom .pyt toolbox that uses snap pour point and watershed tools to create a local watershed for user input sites. For the last 3 years, it has consistently run, taking about 90 seconds each time - I've used it thousands of times. Since my upgrade to ArcMap 10.7, the custom tool now takes 50 minutes to run. I included reporting to see what was going on and I discovered it was taking nearly 15 minutes to snap pour points and 33 minutes to delineate the watershed consistently for every input site I tried. I tried running the snap pour point tool manually from the toolbox and it also took much longer than expected, around 9 minutes. Is anyone else having trouble with the speed of the watershed tools in ArcMap 10.7? Did something change?
... View more
01-02-2020
10:26 AM
|
0
|
3
|
1959
|
|
POST
|
I have an SDE geodatabase in which I have an origin feature class with relationship classes to several destination feature classes and tables. When a feature is deleted from the origin table, the foreign keys in the all of the destination feature classes and tables are nullified. This has been annoying for the destination feature classes because the foreign keys have to be reestablished, however, it has resulted in lost data for the destination tables because we have no way to figure out which feature they originally belonged to (because there are no spatial data attached) and this has created serious issues. Is there a workaround for this or a different setting that I need to consider when setting up my relationship classes?
... View more
02-13-2019
12:26 PM
|
1
|
1
|
1103
|
|
POST
|
I have a script that uses the sql orderby parameter to sort my arcpy cursors by a user defined field or fields and deletes duplicates, but keeps the duplicate with the highest value. I'd like to be able to sort by geometry to identify/group features that are spatial duplicates and delete those that are duplicates (but keeping the duplicate with the highest value in another chosen field which is why I can't just use the Delete Identical tool). I have tried several ways of doing this, but as I understand, shape tokens such as SHAPE@, SHAPE@WKT, etc. cannot be used in the sql clause. Is there another way to do this or another workaround? I also tried to add a field and fill with the SHAPE@WKT, but the update cursor did not fill the field. Here is the code I've got that works for other fields, other than the geometry field: import arcpy
from itertools import groupby
from operator import itemgetter
input_layer = arcpy.GetParameterAsText(0)
case_fields = arcpy.GetParameterAsText(1)
max_field = arcpy.GetParameterAsText(2)
case_fields = case_fields.split(";")
case_fields = [str(x) for x in case_fields]
sql_orderby = "ORDER BY {}, {} DESC".format(",".join(case_fields), max_field)
with arcpy.da.UpdateCursor(input_layer, "*", sql_clause=(None, sql_orderby)) as cursor:
case_func = itemgetter(*(cursor.fields.index(fld) for fld in case_fields))
for key, group in groupby(cursor, case_func):
next(group)
for extra in group:
cursor.deleteRow()
... View more
10-02-2018
08:30 AM
|
0
|
2
|
1139
|
|
POST
|
I am trying to install a third-party Python package from within a Python script so that other users can run the script and the package can be installed and loaded without having to manually download and install. This is the code I'm using: import subprocess
def install(package):
subprocess.call([sys.executable, "-m", 'pip', 'install', package])
install('pyodbc')
import pyodbc
This seems to work fine from within my stand-alone Python script. However, when I try to run it as a script tool set up in ArcGIS Pro, it is not finding the installed package and is failing with this error message: ModuleNotFoundError: No module named 'pyodbc'
Does anyone know what the issue is? Do I need to change a path or environment setting?
... View more
07-09-2018
12:14 PM
|
0
|
1
|
2608
|
|
POST
|
I am creating a tool that takes records from an Access Database and inserts them into a feature service layer. I'd like this tool to be available as a stand-alone Python script. I currently have the script working and inserting new features/table records into feature classes in a file geodatabase. However, I would really like for users to be able to run the tool and insert their features/records directly into a feature service. Is there a particular path I should be using for the feature service layers? How do I deal with this path changing depending on the user? If someone could give me some input on this or direct me to resources where I could get a start on the best way to do this, I'd appreciate it!
... View more
06-28-2018
08:35 AM
|
0
|
1
|
993
|
|
POST
|
I have a feature service that includes several related tables that have attachments enabled. When I edit these tables in ArcMap, I can access the attachments manager and add, remove, or edit attachments. However, when attempt to add or view attachments in ArcGIS Pro 2.1.2, I am not given the option to open the attachment manager when viewing records in the Attributes pane.
... View more
04-27-2018
10:42 AM
|
1
|
7
|
2620
|
|
POST
|
I finally got this to work. But, I'm still wondering why it wouldn't work originally. Here are the different things I tried: I was originally using a large (2.9 million features) feature class to delineate 'zones' within which to tabulate area of the raster. I tried clipping this to a smaller area and the stand-alone script then ran fine. It still would not work on the larger dataset. Finally, I converted my zone feature class to a raster and the stand-alone script then ran on the whole dataset.
... View more
12-20-2017
06:50 AM
|
0
|
0
|
3314
|
|
POST
|
I have tried converting both inputs to layers and tried running the script with origin files in new locations. Both, to no avail - I am still getting the same error message.
... View more
12-14-2017
10:16 AM
|
0
|
0
|
1014
|
|
POST
|
I tried the cell size as an integer and it is giving the same error. I inserted some print statements and all the paths seem to be correct. I'm a bit baffled by this one.
... View more
12-14-2017
06:15 AM
|
0
|
1
|
1013
|
|
POST
|
Thanks for the suggestions. I will make those updates. I edited my post to include the full error message that I'm getting.
... View more
12-13-2017
01:30 PM
|
0
|
5
|
2299
|
|
POST
|
I have a Python script that I would like to operate as a standalone script. When I copy and paste it into the Python window in a fresh ArcMap .mxd, it operates fine. However, when I attempt to run it as a standalone script within my Python IDE, it fails during the tabulate area tool that is written like this: tab_area = TabulateArea(target_features,"unique_id",sdm,"Value",os.path.join(outTable,"tab_area_temp"),"30") I am getting the ambiguous 999998 error message: ExecuteError: ERROR 999998: Unexpected Error. Does anyone have any ideas as to why this might be working fine when copied and pasted into the Python window in ArcMap, but failing as a standalone script? Full Python script is below for reference: import arcpy, os, datetime
from arcpy import env
from arcpy.sa import *
from itertools import groupby
from operator import itemgetter
print "start time: " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
arcpy.env.overwriteOutput = True
target_features = r'C:\Users\mmoore\Documents\ArcGIS\COA.gdb\PlanningUnit_Hex10acre'
sdm_folder = r'C:\Users\mmoore\Documents\ArcGIS\SDMs.gdb'
outTable = r'C:\Users\mmoore\Documents\ArcGIS\out_tables.gdb'
arcpy.env.workspace = sdm_folder
sdms = arcpy.ListRasters()
species_tables = []
for sdm in sdms:
print sdm + " started at: " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
sdm_path = os.path.join(sdm_folder,sdm)
arcpy.CheckOutExtension("Spatial")
tab_area = TabulateArea(target_features,"unique_id",sdm,"Value",os.path.join(outTable,"tab_area_temp"),"30")
sdm_table = arcpy.TransposeFields_management(tab_area,"VALUE_1 Low;VALUE_2 Medium",os.path.join(outTable,sdm),"OccProb","PERCENTAGE","unique_id")
arcpy.AddField_management(sdm_table,"ElSeason","TEXT","","",20,"ElSeason")
with arcpy.da.UpdateCursor(sdm_table,["OccProb","PERCENTAGE","ElSeason"]) as cursor:
for row in cursor:
row[1] = (int(row[1])/40468.383184)*100
cursor.updateRow(row)
row[2] = sdm
cursor.updateRow(row)
if row[0] == "VALUE_1":
row[0] = "Low"
elif row[0] == "VALUE_2":
row[0] = "Medium"
cursor.updateRow(row)
with arcpy.da.UpdateCursor(sdm_table, "PERCENTAGE") as cursor:
for row in cursor:
if row[0] > 10:
pass
else:
cursor.deleteRow()
case_fields = ["unique_id", "ElSeason"]
max_field = "PERCENTAGE"
sql_orderby = "ORDER BY {}, {} DESC".format(",".join(case_fields), max_field)
# use groupby cursor to order by percent coverage
with arcpy.da.UpdateCursor(sdm_table, "*", sql_clause=(None, sql_orderby)) as cursor:
case_func = itemgetter(*(cursor.fields.index(fld) for fld in case_fields))
for key, group in groupby(cursor, case_func):
next(group)
for extra in group:
cursor.deleteRow()
species_tables.append(sdm_table)
arcpy.Delete_management(tab_area)
print sdm + " finished at: " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
merge = arcpy.Merge_management(species_tables, os.path.join(outTable, "SGCN_SDMxPU"))
print "end time: " + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") The full error message is as follows: Traceback (most recent call last):
File "H:\Scripts\COA\COA\COA_species_populator v.7_SDMraster.py", line 23, in <module>
tab_area = TabulateArea(target_features,"unique_id",sdm,"Value",os.path.join(outTable,"tab_area_temp"),30)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Functions.py", line 6183, in TabulateArea
processing_cell_size)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Utils.py", line 53, in swapper
result = wrapper(*args, **kwargs)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Functions.py", line 6175, in Wrapper
processing_cell_size)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\geoprocessing\_base.py", line 510, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
ExecuteError: ERROR 999998: Unexpected Error.
Failed to execute (TabulateArea).
... View more
12-13-2017
12:48 PM
|
0
|
15
|
3821
|
|
POST
|
Thank you for working through this and for your help. I knew that there were some limitations of the in_memory workspace, but was not aware that the SQL postfix clauses were one of them. This is helpful.
... View more
06-08-2017
08:49 AM
|
0
|
1
|
3742
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-06-2025 12:09 PM | |
| 1 | 01-16-2025 10:10 AM | |
| 12 | 06-12-2024 08:50 AM | |
| 2 | 06-13-2024 01:02 PM | |
| 3 | 07-17-2024 12:24 PM |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|