ucd-cws / PISCES

Software for tracking and analyzing fish species range data
Other
0 stars 2 forks source link

Return Updated EO Layer #87

Closed nickrsan closed 9 years ago

nickrsan commented 9 years ago

Original report by AndyB (Bitbucket: AndyB, GitHub: AndyB).


Returning updated expert opinion layer in the Add or Modify Data tool is broken. Operations for the data changes are successful, tool breaks on getting custom query.

2014-10-20 10_44_39-Add or Modify Data.png

nickrsan commented 9 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


Oh, interesting - if this is still in place, I think I know what's going on here. Not sure if it's been fixed yet, but I'll look into it. Thanks

nickrsan commented 9 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


Andy, can you do some testing around this? I can't reproduce. I'm including an old traceback from Rod's machine at DFW:

Generating new layer Making database connection to C:\ProgramData\CWS\PISCES\data\pisces.sqlite Failed script AddData2... Traceback (most recent call last): File "C:\ProgramData\CWS\PISCES\scripts\PISCES\modify_records.py", line 186, in layer = api.get_query_as_layer("select distinct Zone_ID from Observations where Species_ID = '%s' And Presence_Type = 3" % species) File "C:\ProgramData\CWS\PISCES\scripts\PISCES\api.py", line 45, in get_query_as_layer arcpy.MakeFeatureLayer_management(local_vars.HUCS, zone_layer) File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 6043, in MakeFeatureLayer raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000725: Output Layer: Dataset z_layer already exists. Failed to execute (MakeFeatureLayer). Failed to execute (AddData2). Failed at Wed Jan 28 15:24:42 2015 (Elapsed Time: 7.40 seconds)

I can't reproduce anymore, but I'm not sure why it was gone. You had noted at one point that it fails to return the Expert Knowledge layer if the Main Range Maps layer for the taxa is in the current map - I couldn't reproduce with Unlimited Main Range Maps layers. Can you try?

nickrsan commented 9 years ago

Original comment by AndyB (Bitbucket: AndyB, GitHub: AndyB).


I can reproduce the problem using either Main Range and Unlimited layers that are in a map document by trying to add another record using the Add/Modify tool. Selecting the Return EO layer option causes tool to fail.

2015-02-24 10_12_27-Add or Modify Data.png

nickrsan commented 9 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


So, to clarify, is it that you generate the layers, then, from within the generated map document, you add the records, and it fails? Or is it where you move the generated layers into the editing map document, and it fails there too. Thanks! Glad I checked with you before closing it when I couldn't reproduce.

nickrsan commented 9 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


Also, I'm assuming with this that you are modifying the same species - what species are you testing with? I was trying with ZZZ01, but was also generating maps for it

nickrsan commented 9 years ago

Original comment by AndyB (Bitbucket: AndyB, GitHub: AndyB).


This was when the layers were moved from the unlimited or main range map into editing.mxd.

I tried it with ZZZ01 as well as a few real species.

nickrsan commented 9 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


So, apparently, when copying layers output from another map document into the editing.mxd, a hidden layer named z_layer shows up. It's not visible in the TOC, but it's selectable from the dropdowns in the tools. Not sure why this is occurring - will have to debug after 3pm.

nickrsan commented 9 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


Ok, I was able to reproduce and now can't - can you take the code from the latest push and see if, after merging that code, you can reproduce this still? Thanks

nickrsan commented 9 years ago

Original comment by AndyB (Bitbucket: AndyB, GitHub: AndyB).


Unable to reproduce after merging the latest changes (a95cb31). Fixed?

nickrsan commented 9 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


I'm going to call it fixed for now, but let's definitely reopen at the first sign of anything like it. Thanks!