POST
|
Thanks but I've actually read that documentation and already tried the new 'memory' workspace but as I mentioned above the issue wasn't solved until I downgraded to ArcGIS Pro 2.4
... View more
03-20-2020
08:54 AM
|
0
|
1
|
2011
|
POST
|
I just switched back to 2.4 which fixed it. But this could be a bigger problem though. Could someone try to replicate the issue by running the following script using ArcGIS Pro 2.5? arcpy.env.workspace = 'in_memory'
Do something
Then check if there's anything in the workspace using
arcpy.ListFeatureClasses() I haven't used community.esri.com this much (to ask questions) until I switched from ArcMap to ArcGIS Pro. It makes me wonder if there are enough advanced ArcGIS users who actually upgrade to the recent versions of the software.
... View more
03-19-2020
08:54 PM
|
1
|
3
|
5569
|
POST
|
Has this issue been resolved? I'm running to the same issue using ArcGIS Pro 2.5
... View more
03-19-2020
05:13 PM
|
0
|
4
|
5569
|
POST
|
I tried these workaround but it seemed to not have fixed the issue. This script doesn't even work i stand alone as well.
... View more
03-11-2020
09:41 AM
|
0
|
0
|
1604
|
POST
|
Thanks, Dan! But is there a way to raw encode the output with TableToTable function. It's asking for both the output path and output name. And there's no option to raw encode the output.
... View more
03-11-2020
07:40 AM
|
0
|
2
|
1604
|
POST
|
Actually, my workspace is a folder. I named it specifically like that. And i tried to rename it as well but it's still not working.
... View more
03-11-2020
06:33 AM
|
0
|
4
|
1604
|
POST
|
Hi, Could someone help why I'm having Error 210 on this script? For info, I'm running the script using ArcGIS Notebook with ArcGIS Pro.
... View more
03-10-2020
02:10 PM
|
1
|
6
|
1718
|
POST
|
Actually this part of the code doesn't use any in_memory. `this_feature` was created, but `this_selecting_feature` is an existing file on the machine and its' the first time it's used in the code. Basically it's something like: this_selecting_feature = "path/to/file.shp" I mentioned `in_memory` above to explain the content of my code. Just in case that might be the issue. But it seems like it's not that. My conclusion from this is that you can't use a variable/file modified with UpdateCursor as a layer for selection.
... View more
02-12-2020
06:55 PM
|
0
|
0
|
493
|
POST
|
So the 'clear_selection' did not fix the issue but I think I figure out the solution after multiple tests. If I'm using this workflow the selection is messed up: this_feature = arcpy.CopyFeatures_management('this_feature0.shp', 'this_feature1.shp')
with arcpy.da.UpdateCursor(this_feature, ["some_field"]) as features:
for afeature in features:
if condition_met:
features.deleteRow()
arcpy.MakeFeatureLayer_management(this_feature, 'this_feature_lyr') # creating the layer right after UpdateCursor
arcpy.MakeFeatureLayer_management(this_selecting_feature, 'this_selecting_feature_lyr')
arcpy.SelectLayerByLocation_management('this_feature_lyr', 'INTERSECT', 'this_selecting_feature_lyr', selection_type='NEW_SELECTION')
# this final output will change each time I run the script
updated_features = arcpy.CopyFeatures_management('this_feature_lyr' ,'updated_features.shp') But if I make a copy after the UpdateCursor then everything seems fine: with arcpy.da.UpdateCursor('this_feature0.shp', ["some_field"]) as features:
for afeature in features:
if condition_met:
features.deleteRow()
arcpy.CopyFeatures_management('this_feature0.shp', 'this_feature1.shp') # copy after UpdateCursor
arcpy.MakeFeatureLayer_management('this_feature1.shp', 'this_feature_lyr')
arcpy.MakeFeatureLayer_management(this_selecting_feature, 'this_selecting_feature_lyr')
arcpy.SelectLayerByLocation_management('this_feature_lyr', 'INTERSECT', 'this_selecting_feature_lyr', selection_type='NEW_SELECTION')
# this final output will be correct
updated_features = arcpy.CopyFeatures_management('this_feature_lyr' ,'updated_features.shp') I don't really know why to be honest. Maybe its an issue with memory management. But this has fixed the issue. Thanks!
... View more
02-12-2020
01:48 PM
|
0
|
2
|
2614
|
POST
|
OK. I'll try to make this fix and follow-up. Thanks!
... View more
02-12-2020
07:51 AM
|
0
|
1
|
2614
|
POST
|
The script is very long and uses functions from other .py file. But long script short, here is the script config: arcpy.env.overwriteOutput = True arcpy.env.qualifiedFieldNames = False Then I run multiple functions imported from another python file but based on arcpy. Loops are done using the 'in_memory' workspace. And I'm using .shp to save all files. Everything is working fine except the part where I do this selection. I'm doing other selections as well and they all work fine. I really have no idea what going on. Should I delete/clear selection before running a selection? (I never had to that before though) Another thing is that I saved these selection files at the end of the script. And I do the selection manually, it works fine. It's only when I run it as a script that there's this issue.
... View more
02-12-2020
07:46 AM
|
0
|
3
|
2614
|
POST
|
I'm actually creating the layers right before the selection (with MakeFeatureLayer). So I'm assuming a preselected layer shouldn't be the issue
... View more
02-12-2020
07:25 AM
|
0
|
2
|
2614
|
POST
|
I am running an arcpy script in command prompt with ArcGIS Pro installed. For some reason the Select By location tool produce different result every time I run it. Here is the selection code: arcpy.SelectLayerByLocation_management('lowland_layer', 'INTERSECT', 'buildings_layer', selection_type='NEW_SELECTION') arcpy.CopyFeatures_management('lowland_layer', 'lowlands_with_buildings.shp') I have no idea why this would produce different results everytime I run it. I have already made sure that all files has the same coordinate system, as well as the outputs.
... View more
02-12-2020
06:49 AM
|
0
|
11
|
3410
|
Title | Kudos | Posted |
---|---|---|
1 | 03-19-2020 08:54 PM | |
1 | 03-10-2020 02:10 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|