<?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: How to open local layer on ArcGIS Pro using ArcGIS API for Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066797#M6186</link>
    <description>&lt;P&gt;Currently I am using the Notebook inside the Pro. But I can run the notebook from the Python command prompt too (the one installed together with Pro). Are they different?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jun 2021 09:08:30 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-06-10T09:08:30Z</dc:date>
    <item>
      <title>How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066746#M6179</link>
      <description>&lt;P&gt;I am learning ArcGIS API for python, which I run using the notebook inside the ArcGIS Pro. I opened some layers in ArcGIS Pro (local files: rasters an vectors).&lt;/P&gt;&lt;P&gt;On the ArcGIS API for Python documentations, it shows the way to open layers from portals. How to get the layers on ArcGIS API for Python that I open locally on my ArcGIS Pro?&lt;/P&gt;&lt;P&gt;My aim is to process the layers with arcgis.learn libraries. I would like to run the process using ArcGIS API for Python libraries using the layer from my local files.&lt;/P&gt;&lt;P&gt;Looking forward to your advice.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 04:04:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066746#M6179</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-10T04:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066749#M6180</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;EM&gt;addDataFromPath&lt;/EM&gt;&amp;nbsp;method provides a way to add a layer to a map in a similar way to how the&amp;nbsp;&lt;STRONG&gt;Add Data From Path&lt;/STRONG&gt;&amp;nbsp;button works in the application; it places each layer based on layer weight rules and geometry type.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;addDataFromPath (data_path)&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm#M2_GUID-CD5119D8-1DD8-46A3-9051-3DFE58C6B5A6" target="_self"&gt;Map Class (Methods) - ArcPy&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&lt;A href="https://gis.stackexchange.com/questions/265592/adding-feature-class-to-map-in-current-project-using-arcpy-in-arcgis-pro" target="_self"&gt;Adding feature class to Map in CURRENT project using ArcPy in ArcGIS Pro?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;lyrTest = r"C:\data\test.gdb\Layer1" 
aprx = arcpy.mp.ArcGISProject("CURRENT")
aprxMap = aprx.listMaps("MainMap")[0] 
aprxMap.addDataFromPath(lyrTest)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 04:31:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066749#M6180</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-06-10T04:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066770#M6182</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/95280"&gt;@JayantaPoddar&lt;/a&gt;&amp;nbsp; Thank you very much for your information. So I need to use arcpy instead. Now I can get the layer from my ArcGIS Pro from my map object.&lt;/P&gt;&lt;P&gt;But looking back to my original purpose, to use it inside arcgis.learn libraries, I think I have some knowledge gap here. Now I am not sure I can use this layer object from arcpy to input as parameters inside the export_training_data function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My first attempt running the export_training_data function with the local layers produce error: "ArcGIS Online does not support export_training_data function." The error sounds like not related to ArcPy though.&lt;/P&gt;&lt;P&gt;Here is my script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
my_gis = GIS()&lt;/LI-CODE&gt;&lt;LI-CODE lang="python"&gt;import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
aprxMap = aprx.listMaps("Map")[0]
for lyr in aprxMap.listLayers():
    if lyr.name == "clipped_building":
        boundaryLayer = lyr
    elif lyr.name == "20200428SA1_B05_grid.tif":
        imageLayer = lyr&lt;/LI-CODE&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS, learn
from arcgis.learn import export_training_data
outFolder = r"E:\Data\Out\building"
export = export_training_data(input_raster=imageLayer,
                                           output_location=outFolder,
                                           input_class_data=boundaryLayer, 
                                           chip_format="PNG", 
                                           tile_size={"x":448,"y":448}, 
                                           stride_size={"x":224,"y":224},                                           metadata_format="PASCAL_VOC_rectangles",                                        
                                           classvalue_field = "CLASSNO",
                                           buffer_radius = 6
                                           )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:02:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066770#M6182</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-10T08:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066789#M6183</link>
      <description>&lt;P&gt;you should be running arcgis.learn from a local machine according to the error.&amp;nbsp; Are you trying to run the analysis through arcgis online?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:53:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066789#M6183</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-06-10T08:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066791#M6184</link>
      <description>&lt;P&gt;Hi Dan. I am aiming for running the arcgis.learn from my local machine. Do you know where is the part on my script I can switch the setting from AGOL to my local machine?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:57:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066791#M6184</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-10T08:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066793#M6185</link>
      <description>&lt;P&gt;What python IDE are you using? or are you trying to run this through Pro's notebook.&lt;/P&gt;&lt;P&gt;Fire up Pro and use the python window or a notebook or use a python IDE (eg Spyder, VS etc etc&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 09:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066793#M6185</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-06-10T09:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066797#M6186</link>
      <description>&lt;P&gt;Currently I am using the Notebook inside the Pro. But I can run the notebook from the Python command prompt too (the one installed together with Pro). Are they different?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 09:08:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066797#M6186</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-10T09:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066799#M6187</link>
      <description>&lt;P&gt;There is no need to use a notebook, work with local data and your python IDE, then use Pro to view results if needed&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/installing-python-for-arcgis-pro.htm" target="_blank"&gt;Python in ArcGIS Pro—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.anaconda.com/anaconda/user-guide/tasks/integration/" target="_blank"&gt;Using IDEs — Anaconda documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 09:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066799#M6187</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-06-10T09:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066802#M6188</link>
      <description>&lt;P&gt;Hi Dan, thank you for your suggestion. The reason why I am using a notebook is that I am using a shared PC on my company that was only installed ArcGIS Pro in it. There was no other Python and Python IDE installation made previously. Will be complicated to ask the admin to install this and that for now.&lt;/P&gt;&lt;P&gt;So I guess if I can stick to the notebook that will be fine for me. In your opinion, do you think running the ArcGIS API for Python libraries on a separated python IDE can solve the "ArcGIS Online does not support export_training_data function." error, Dan?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 09:32:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1066802#M6188</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-10T09:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to open local layer on ArcGIS Pro using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1068733#M6206</link>
      <description>&lt;P&gt;After few days of trial and error, I then realised that the easiest way to start the arcgis.learn libraries with local data (not portal data) is by running the "Export Training Data For Deep Learning" tool. This will make our local data into the format that can be consumed by the model training libraries inside the arcgis.learn module.&lt;BR /&gt;&lt;BR /&gt;The "Export Training Data For Deep Learning" itself maybe able to be run on python too, but I did not try it. I ran the tool manually using the Spatial Analyst License on the Geoprocessing tool.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So sorry the title may lead to a mislead interpretation, I should have mentioned about the arcgis.learn too on the title. But I don't know how to edit the title.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 03:10:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-open-local-layer-on-arcgis-pro-using-arcgis/m-p/1068733#M6206</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-16T03:10:40Z</dc:date>
    </item>
  </channel>
</rss>

