2

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"

ArcMap vs ArcPy dissolve

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]):

ArcMap vs ArcPy environments

Code snippet:

#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?

  • 2
    My first guess is that this is due to different memory availability between ArcMap and Python. Do you have Background Processing enabled in ArcMap and the 64bit Background Geoprocessing package installed? And, are you running the arcpy script in 32bit or 64bit python? – Evil Genius Jul 6 '18 at 13:08
  • @EvilGenius Thanks for your reply. Background Processing is enabled in ArcMap. I have requested access to download 64bit Background Geoprocessing package but mighnt be able to install for few days as site admin is on leave. I'm running 32bit python. – Rob Jul 6 '18 at 13:59
  • 2
    I would imagine you are experiencing the tiling that go on behind the scenes as described here. Why it manifest in one environment and not the other is probably something that none of us will ever know? – Hornbydd Jul 6 '18 at 14:05
  • 1
    @Hornbydd That looks exactly like what is occurring! Thanks for pointing to that. If I find anything I'll update this question – Rob Jul 6 '18 at 14:24
  • I found that running the script with ArcGIS Pro resolves this issue with Dissolving (community.esri.com/thread/205057-dissolving-large-data - pro.arcgis.com/en/pro-app/arcpy/get-started/…). however, i'm encountering licence issues now. – Rob Jul 6 '18 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.