Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Polygons tool issues #40

Open
cgutierrez-01 opened this issue Jan 15, 2020 · 7 comments
Open

Make Polygons tool issues #40

cgutierrez-01 opened this issue Jan 15, 2020 · 7 comments

Comments

@cgutierrez-01
Copy link

Hello,

I have been testing/using the Make Polygons tool in the GeMS Tools for Arc10.5 toolbox (2018-05-18) with decent results but ran into an issue with relationship classes. The tool fails and crashes the software if relationship classes are present in the gdb (no useful error message generated). If the relationship classes are removed the tool succeeds.

In addition, the ArcGIS Pro version of the tool doesn't appear to be working. Even if topology and relationship classes are not present, the tool fails with a reported schema lock (see error message below).

Not sure if these are known issues or if there is anything that can be done about them, but I figured I would let you know. We are currently implementing the GeMS schema in our organization and would like to utilize the tools as much as possible. Thanks to the GeMS team for all your hard work developing these tools.

OS:
Windows 10 Enterprise v 1803
S/W:
ArcGIS Desktop 10.7.1
ArcGIS Pro 2.4.2

image

@ethoms-usgs
Copy link
Collaborator

Carlos (is that right?),
Thanks for getting in touch.

The behavior you are describing in the first part of your message probably has to do with the fact that the tool, depending on your input parameters, is either trying to rename MapUnitPolys or delete it while it is participating in a relationship class. Unfortunately, you can do this manually in ArcCatalog, so I don't know why the code would be bombing. But if it didn't crash, your relationship class would just be deleted, which isn't what you want either. In either case, since you have found that it will work if the relationship classes are removed first, I'm going to punt at this point and say you have found a workaround. If I were to change the code, and I hope I can soon, I would have it check for a relationship class, delete it if possible, rebuild the map unit polygons, and then rebuild the relationship class.

Your second issue: finding and removing schema locks can be very frustrating. All I can suggest is that you close everything that might be touching, or recently touched, the geodatabase and then try again. Orphaned python processes sometimes hang onto schema locks even when it appears they have stopped running. They should disappear once the program has been shut down.

You might also look inside the geodatabase as a folder in Windows Explorer and try to delete any *.lock files you find. Those are not always properly deleted when they should be.

@cgutierrez-01
Copy link
Author

Hi Evan,

Thanks for the quick reply and for pointing out the issues/limitations with the relationship classes.

I am still a bit perplexed by the schema lock issue. Following a full reboot, I have ensured that the gdb is not being accessed by another application and verified that no schema locks are present in the gdb folder prior to loading the features classes into ArcPro, but still get the error.

@ethoms-usgs
Copy link
Collaborator

Carlos, I apologize. The script was failing because of some code that was trying to determine if a schema lock could be placed on a geodatabase and exiting if it found one could not. Maybe this worked for me as expected some time ago, but it clearly isn't now. I have removed that section of code and updated the script. You can download just that script (https://github.com/ethoms-usgs/GeMS_Tools/blob/master/Scripts/GeMS_MakePolys3_AGP2.py - click Raw and then copy and paste the text to a file with the same name) or download the attached .txt file and rename it .py.

GeMS_MakePolys3_AGP2.txt

@cgutierrez-01
Copy link
Author

cgutierrez-01 commented Jan 15, 2020 via email

@ethoms-usgs
Copy link
Collaborator

Carlos,
See Issue 59 and note that the tool has changed since you logged this issue. Does the tool work for you now?

@cgutierrez-01
Copy link
Author

Thanks for the follow-up, Evan. The tool works fine in ArcMap if relationship classes are not present. Unfortunately, the tool still does not work in ArcMap if relationship classes and does not work at all in AcGIS Pro. In ArcMap the whole application bombs and in ArcGIS Pro I get the following error message (same error with or without the relationship classes):

Traceback (most recent call last):
File "G:\CGS\GM_Work\Arcwork\ArcGIS_Files\GeMS\test\cg_testing\gems-tools-pro-master_20210315\Scripts\GeMS_MakePolys3_AGP2.py", line 319, in
arcpy.DeleteFeatures_management(blankPolys)
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 3910, in DeleteFeatures
raise e
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 3907, in DeleteFeatures
retval = convertArcObjectToPythonObject(gp.DeleteFeatures_management(*gp_fixargs((in_features,), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing_base.py", line 511, in
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset D:\Temp\250K_State_Geology\ATLAS_new\Weed\Test\pro\Weed_GeMS.gdb\GeologicMap\errors_unlabeledPolys does not exist or is not supported
Failed to execute (DeleteFeatures).
Failed to execute (MakePolys).

@ethoms-usgs
Copy link
Collaborator

Ok, I can see that happening. The tool would have to detect a relationship class, delete it, recreate MapUnitPolys and then re-create the relationship, which it doesn't do now. We'll add that to the list.

I will try to look at the Pro version soon.
Thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants