Hi,
I have a problem with the Eliminate tool (again). Basically, I have noticed that this tool will modify some polygons that are not originally selected. It will end in some holes being created or some overlap in other polygons. Here is an example:
Good ouput (done with geoprocessing tool in Arcgis pro)
Here are my tool parameter:
Bad output (with script)
Here is my script:
Superficie_minimale = 1
select_sup_minimale = f"Shape_area < {Superficie_minimale}"
# Éliminer les polygones trop petits
arcpy.management.MakeFeatureLayer(in_features=ZONE_DETAILS_merge_TROUS, out_layer="poly_a_fusionner")
arcpy.management.SelectLayerByAttribute(in_layer_or_view="poly_a_fusionner", selection_type="NEW_SELECTION", where_clause=select_sup_minimale, invert_where_clause="NON_INVERT")
OCCUPATION_TERRITOIRE = fr"{Resultat}\OCCUPATION_TERRITOIRE"
arcpy.management.Eliminate(in_features="poly_a_fusionner", out_feature_class=OCCUPATION_TERRITOIRE, selection="LENGTH")
What could be the problem?
well... again, it turns out I was the problem. The issue came along later on when the output is passed as spatial dataframe to make some calculations before returning to a feature class. I guess spatial.to_featureclasse does not deal well with complex geometries. Using a cursor instead to pass the new fields solved the issue.
UPDATE: No the problem is really the eliminate tool... I have run again my tests and no matter what I do, this tool modifies some polygons to create holes and overlaps
Would you be able to provide the data as well? This could be related to the data properties that are inherited during processing.
Thx.