Software: ArcMap 10.5.1, ArcPy
I have created 2 python scripts that seeks to create a floodplain polygon from a DEM. py1 is DEM to Polygon while py2 cleans polygon to create final output. In py2 there a number of intermediatory steps to produce and clean the polygon to get the final floodplain product (clip, dissolve, feature removal, eliminate, etc.). Dissolving the Floodplain polygon by a water catchment to get single part features is one of these steps.
Before creating the script, I always run the steps manually in ArcMap to ensure processes/outputs are correct and steps are working. Following this, I generate code snippets and populate a working script. Everything is running and producing a final output.
However, I have noticed that when I review the output for the dissolve I am getting a kind of "gridded" output that I do not get when ran manually in ArcMap (either by using python console or the tool itself). This obviously has an affect on subsequent steps as this grid is visible for each step following the dissolve.
Image below shows dissolve outputs of ArcMap (1 feature selected) vs ArcPy (2 features selected). Notice the obvious right angles from the "grid"
I have checked environments for both ArcMap and ArcPy process and they are pretty much the same (apart from workspaces. I have added in additional settings to script to fully match those in ArcMap [outputCoordinateSystem and geographicTransformations]):
#2 Dissolve by gridcode to remove multipart features input_p2 = output_p1 output_p2 = os.path.join(output_root + "_step2_diss") diss_field = "gridcode" print ("Dissolving '%s'..." % (os.path.basename(input_p2))) arcpy.Dissolve_management(input_p2, output_p2, diss_field, "", "SINGLE_PART", "DISSOLVE_LINES") print ("Created: %s" % (os.path.basename(output_p2)))
link to dissolve tool - http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/dissolve.htm
This is not isolated to my PC as colleagues and the client have tested on their PCs both in and outside of our Company. Has anyone encountered this issues before?