<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using GPInMemoryWorkspace Data in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717629#M23780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a model that has a couple input parameters and the in_table is an output parameter.  I put the model in a toolbox...  I then run the tool and share it as a GP service.  Then when I run the GP service it asks for the inputs which would be like begin C000001E and a reference marker i.e. 22    Here is a snap shot of the model and the GP service.  Here is a link to the GP service that is created.  You should be able to add this to ARCMAP and run it, add the following parameters first point Corridor = C000001E.  RM = 22  end point Corridor = C000001E RM 23.  You can leave the offsets at zero.  It should return a table in the results tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;https://app.mdt.mt.gov/arcgis/rest/services/Testing/rs/GPServer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure if any of this makes sense..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Oct 2015 14:20:25 GMT</pubDate>
    <dc:creator>TerryGustafson</dc:creator>
    <dc:date>2015-10-21T14:20:25Z</dc:date>
    <item>
      <title>Using GPInMemoryWorkspace Data</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717627#M23778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping someone has run into something similar.&amp;nbsp; I have looked for a solution with no luck.&amp;nbsp; I have a GP service that generates a point table through a process.&amp;nbsp; I want to add the "Make Route Event Layer" to the GP service and use this point table to generate a segment.&amp;nbsp; When I do this it returns an error that it can't open the in_table.&amp;nbsp; This in_table is in the GPInMemoryWorkspace.&amp;nbsp; Is there a way to get to this in memory data so I can generate the segment or is there another way to get it?&amp;nbsp; TIA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Terry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2015 13:03:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717627#M23778</guid>
      <dc:creator>TerryGustafson</dc:creator>
      <dc:date>2015-10-21T13:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPInMemoryWorkspace Data</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717628#M23779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post some code of how you're creating the in_table? Are you doing something with "in_memory"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2015 14:01:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717628#M23779</guid>
      <dc:creator>MichaelKozub</dc:creator>
      <dc:date>2015-10-21T14:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPInMemoryWorkspace Data</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717629#M23780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a model that has a couple input parameters and the in_table is an output parameter.  I put the model in a toolbox...  I then run the tool and share it as a GP service.  Then when I run the GP service it asks for the inputs which would be like begin C000001E and a reference marker i.e. 22    Here is a snap shot of the model and the GP service.  Here is a link to the GP service that is created.  You should be able to add this to ARCMAP and run it, add the following parameters first point Corridor = C000001E.  RM = 22  end point Corridor = C000001E RM 23.  You can leave the offsets at zero.  It should return a table in the results tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;https://app.mdt.mt.gov/arcgis/rest/services/Testing/rs/GPServer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure if any of this makes sense..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2015 14:20:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717629#M23780</guid>
      <dc:creator>TerryGustafson</dc:creator>
      <dc:date>2015-10-21T14:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPInMemoryWorkspace Data</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717630#M23781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I exported the model to python and this is the code.&amp;nbsp; I would have thought there would be a local variable for the points_Events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# seg.py
# Created on: 2015-10-22 10:41:12.00000
#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)
# Usage: seg &amp;lt;first_point&amp;gt; &amp;lt;end_point&amp;gt; &amp;lt;merge__3_&amp;gt; &amp;lt;points&amp;gt; &amp;lt;points_Events&amp;gt; 
# Description: 
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Load required toolboxes
arcpy.ImportToolbox("E:/MDTAPPS/terry/ref segment.tbx")
# Script arguments
first_point = arcpy.GetParameterAsText(0)
if first_point == '#' or not first_point:
&amp;nbsp;&amp;nbsp;&amp;nbsp; first_point = "E:\\MDTAPPS\\terry\\Default.gdb\\first_point" # provide a default value if unspecified
end_point = arcpy.GetParameterAsText(1)
if end_point == '#' or not end_point:
&amp;nbsp;&amp;nbsp;&amp;nbsp; end_point = "E:\\MDTAPPS\\terry\\Default.gdb\\end_point" # provide a default value if unspecified
merge__3_ = arcpy.GetParameterAsText(2)
if merge__3_ == '#' or not merge__3_:
&amp;nbsp;&amp;nbsp;&amp;nbsp; merge__3_ = "E:\\MDTAPPS\\terry\\Default.gdb\\merge" # provide a default value if unspecified
points = arcpy.GetParameterAsText(3)
if points == '#' or not points:
&amp;nbsp;&amp;nbsp;&amp;nbsp; points = "E:\\MDTAPPS\\terry\\Default.gdb\\points" # provide a default value if unspecified
points_Events = arcpy.GetParameterAsText(4)
if points_Events == '#' or not points_Events:
&amp;nbsp;&amp;nbsp;&amp;nbsp; points_Events = "points Events3" # provide a default value if unspecified
# Local variables:
first_point__2_ = first_point
first_point_Event = first_point__2_
first_point_ev = first_point_Event
Output_Event_Table_Properties = first_point_Event
end_point__2_ = end_point
end_point_Event = end_point__2_
end_point_ev = end_point_Event
end_point_ev_View = end_point_ev
Output_Event_Table_Properties__2_ = end_point_Event
MDTGIS_ROUTES_LRM_RM = "MDTGIS.ROUTES_LRM_RM"
MDTGIS_ROUTES_LRM_DC_MI = "MDTGIS.ROUTES_LRM_DC_MI"
MDTGIS_ROUTES_LRM_DC_MI__2_ = "MDTGIS.ROUTES_LRM_DC_MI"
Default_gdb = "E:\\MDTAPPS\\terry\\Default.gdb"
MDTGIS_ROUTES_LRM_DC_MI__3_ = "MDTGIS.ROUTES_LRM_DC_MI"
# Process: Calculate Field
arcpy.CalculateField_management(first_point, "Corridor", "str(!Corridor!) + \"_\" + str(!RM!)", "PYTHON_9.3", "")
# Process: Make Route Event Layer
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_RM, "ROUTE_ID", first_point__2_, "Corridor POINT beg_offset", first_point_Event, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Locate Features Along Routes
arcpy.LocateFeaturesAlongRoutes_lr(first_point_Event, MDTGIS_ROUTES_LRM_DC_MI, "CORRIDOR", "0 Meters", first_point_ev, Output_Event_Table_Properties, "FIRST", "DISTANCE", "ZERO", "FIELDS", "M_DIRECTON")
# Process: Calculate Field (2)
arcpy.CalculateField_management(end_point, "Corridor", "str(!Corridor!) + \"_\" + str(!RM!)", "PYTHON_9.3", "")
# Process: Make Route Event Layer (2)
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_RM, "ROUTE_ID", end_point__2_, "Corridor POINT end_offset", end_point_Event, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Locate Features Along Routes (2)
arcpy.LocateFeaturesAlongRoutes_lr(end_point_Event, MDTGIS_ROUTES_LRM_DC_MI__2_, "CORRIDOR", "0 Meters", end_point_ev, Output_Event_Table_Properties__2_, "FIRST", "DISTANCE", "ZERO", "FIELDS", "M_DIRECTON")
# Process: Make Table View
arcpy.MakeTableView_management(end_point_ev, end_point_ev_View, "", "", "OBJECTID OBJECTID VISIBLE NONE;RID RID VISIBLE NONE;to_MEAS to_MEAS VISIBLE NONE;Distance Distance VISIBLE NONE;RM RM VISIBLE NONE")
# Process: Merge
arcpy.Merge_management("E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev;end_point_ev_View", merge__3_, "RID \"CORRIDOR\" true true false 10 Text 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev,RID,-1,-1,end_point_ev_View,RID,-1,-1;from_MEAS \"from_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev,from_MEAS,-1,-1;to_MEAS \"to_MEAS\" true true false 0 Double 0 0 ,First,#,end_point_ev_View,to_MEAS,-1,-1")
# Process: Table to Table
arcpy.TableToTable_conversion(merge__3_, Default_gdb, "points", "", "RID \"CORRIDOR\" true true false 10 Text 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,RID,-1,-1;from_MEAS \"from_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,from_MEAS,-1,-1;to_MEAS \"to_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,to_MEAS,-1,-1", "")
# Process: Make Route Event Layer (3)
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_DC_MI__3_, "CORRIDOR", points, "rid LINE from_MEAS to_MEAS", points_Events, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Script1
arcpy.gp.toolbox = "E:/MDTAPPS/terry/ref segment.tbx";
# Warning: the toolbox E:/MDTAPPS/terry/ref segment.tbx DOES NOT have an alias. 
# Please assign this toolbox an alias to avoid tool name collisions
# And replace arcpy.gp.Script1(...) with arcpy.Script1_ALIAS(...)
arcpy.gp.Script1()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:43:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-gpinmemoryworkspace-data/m-p/717630#M23781</guid>
      <dc:creator>TerryGustafson</dc:creator>
      <dc:date>2021-12-12T06:43:40Z</dc:date>
    </item>
  </channel>
</rss>

