Error When Using in_memory to Process Polyline Features

490
6
07-18-2018 08:29 AM
MatthewWiecek
New Contributor

Hi,

I'm trying to run a script that will generate a contour map from a raster in a geodatabase, run Simplify Line on the contour map, and then run Smooth Line. At first I ran it in disk, and it worked (albeit slowly), and now I'd like to do it using the in_memory workspace. However, it returns the error message at the bottom. I've tried this in PyScripter and ArcMap with both foreground and background (64-bit) geoprocessing, and the result is the same. What is the problem with my code that is causing this to fail when I use the in_memory workspace?

# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Snippet.py
# Created on: 2018-07-17 11:14:47.00000
#   (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy
from arcpy.sa import *
from arcpy.ddd import *
arcpy.CheckOutExtension("Spatial")
arcpy.CheckOutExtension("3D")

# Local variables:
FilteredDEM = "D:\\ArcGIS\\FloodMapGenerator\\FloodMapGenerator.gdb\\FilteredDEM"
FiveMeterContour = "in_memory\\FiveMeterContour"
FiveMeterSimplify_Pnt = FiveMeterContour
FiveMeterSimplify = "in_memory\\FiveMeterSimplify"
FiveMeterSmooth = "in_memory\\FiveMeterSmooth"

# Process: Contour
arcpy.Contour_3d(FilteredDEM, FiveMeterContour, "5", "0", "1")

# Process: Simplify Line
arcpy.SimplifyLine_cartography(FiveMeterContour, FiveMeterSimplify, "BEND_SIMPLIFY", "5 Meters", collapsed_point_option = "NO_KEEP", error_checking_option = "NO_CHECK")

# Process: Smooth Line
arcpy.SmoothLine_cartography(FiveMeterSimplify, FiveMeterSmooth, "BEZIER_INTERPOLATION", "0 Meters", "FIXED_CLOSED_ENDPOINT", "NO_CHECK")

arcpy.CheckInExtension("Spatial")
arcpy.CheckInExtension("3D")

Runtime error Traceback (most recent call last): File "", line 27, in File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\cartography.py", line 1340, in SimplifyLine raise e ExecuteError: ERROR 000207: Cannot create intermediate output GPInMemoryWorkspace:{5568791D-08F7-4A36-BC5F-A640D3D64572}\FiveMeterSimplify_TmpIn Failed to execute (SimplifyLine).

0 Kudos
6 Replies
DanPatterson_Retired
MVP Esteemed Contributor

/blogs/dan_patterson/2016/08/14/script-formatting please to format your code.

Also you have a bunch of lines with … at the end.  Are they really there? or are they remnants from commenting,

0 Kudos
MatthewWiecek
New Contributor

Sorry about that, thanks for the link. Is this better? As for the period, I copied it out of the Python window, and they were part of that. I just removed them.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

There is no indication in the help for either arcmap or ArcGIS pro that it can't be run in-memory... but it will fail if you run out of memory.  I suspect why it was running slowly on disk is because it was swapping in and out to disk.  Perhaps your file is too large to handle in-memory.

In Pro at least, there is the...

Cartographic Partitions (Environment setting)—Geoprocessing | ArcGIS Desktop 

environment setting that can be used for large data sets to help things along.

MartinM__Baihaqi
New Contributor II

you can use virtual memory in system windows to allocated memory processing

Pada tanggal Kam, 19 Jul 2018 pukul 01.48 Dan Patterson <geonet@esri.com>

menulis:

GeoNet <https://community.esri.com/?et=watches.email.thread>

Re: Error When Using in_memory to Process Polyline Features

reply from Dan Patterson

<https://community.esri.com/people/Dan_Patterson?et=watches.email.thread>

in Geoprocessing - View the full discussion

<https://community.esri.com/message/785679-re-error-when-using-inmemory-to-process-polyline-features?commentID=785679&et=watches.email.thread#comment-785679>

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

and that is different than in-memory?

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

How big are the data sets you are working with, both inputs and the final output?

0 Kudos