<?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 can I load local kml file as KMLLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160546#M14977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also you can create a geoprocessing service to do it. Upload a KML one or many and convert into graphic on map.&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;import glob, zipfile, arcpy&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def kmlToFeatures(kmlFile):&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.AddMessage("kmlToFeatures")&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.KMLToLayer_conversion(kmlFile, arcpy.env.scratchFolder, "outKML1")&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; return arcpy.env.scratchFolder + "/outKML1.gdb/Placemarks/Polygons"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def ProcessInput():&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; sourceKMLFile = arcpy.GetParameterAsText(0)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; outputFeatureClass = kmlToFeatures(sourceKMLFile)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.SetParameterAsText(1, outputFeatureClass)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ProcessInput()&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Sep 2016 08:00:41 GMT</pubDate>
    <dc:creator>PanagiotisPapadopoulos</dc:creator>
    <dc:date>2016-09-26T08:00:41Z</dc:date>
    <item>
      <title>How can I load local kml file as KMLLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160543#M14974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;BR /&gt;I have clients with there own local kml files.&lt;/P&gt;&lt;P&gt;And I wanted to create small web app that they will be able to load or drag\drop KML file into the page and then renderer it into KMLLayer (totally failed... ) any idea?... &lt;BR /&gt; &lt;BR /&gt;then i was trying to use the sample of loading shape file &lt;BR /&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jssamples/portal_addshapefile.html" title="https://developers.arcgis.com/javascript/3/jssamples/portal_addshapefile.html"&gt;Add shapefile | ArcGIS API for JavaScript 3.17&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It use Generate option of the portal but kml is working in different way&lt;/P&gt;&lt;P&gt;You need to Add item to the portal and its not generate&amp;nbsp;something on memory like CSV\Shape file.&lt;BR /&gt;Beside adding item into the portal with some kind of authentication with proxy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Do you have any idea how can i implement it?... &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt;Shahar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 08:53:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160543#M14974</guid>
      <dc:creator>ShaharBukra</dc:creator>
      <dc:date>2016-09-22T08:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I load local kml file as KMLLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160544#M14975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/kmllayer-amd.html"&gt;documentation for KMLLayers&lt;/A&gt; clearly states:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;"&lt;STRONG&gt;Note&lt;/STRONG&gt;: The KMLLayer uses a utility service from ArcGIS.com, therefore your kml/kmz must be publicly accessible on the internet. If your kml/kmz files are behind the firewall you will need to set the &lt;CODE&gt;&lt;A href="https://developers.arcgis.com/javascript/3/jshelp/inside_defaults.html"&gt;esriConfig.defaults.kmlService&lt;/A&gt;&lt;/CODE&gt; to your own utility service. (Requires Portal for ArcGIS)."&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Outside of that, I would think the only way to "import" KML files would be to digest the KML's XML content and create a featureCollection for use with a new featureLayer. Of course, you'd have to code such an importer since I don't think anyone else has made one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 14:58:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160544#M14975</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2016-09-22T14:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I load local kml file as KMLLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160545#M14976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can use the portal in order to create and get KML Item...&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;use proxy in order the portal know me&lt;/LI&gt;&lt;LI&gt;upload kml as new item&lt;/LI&gt;&lt;LI&gt;wait until i get the key&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;and then use it as KMLLayer&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But i will need to upload many kml per day,&lt;/P&gt;&lt;P&gt;And i dont really know if its the right approach&amp;nbsp;doing it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2016 05:32:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160545#M14976</guid>
      <dc:creator>ShaharBukra</dc:creator>
      <dc:date>2016-09-25T05:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I load local kml file as KMLLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160546#M14977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also you can create a geoprocessing service to do it. Upload a KML one or many and convert into graphic on map.&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;import glob, zipfile, arcpy&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def kmlToFeatures(kmlFile):&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.AddMessage("kmlToFeatures")&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.KMLToLayer_conversion(kmlFile, arcpy.env.scratchFolder, "outKML1")&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; return arcpy.env.scratchFolder + "/outKML1.gdb/Placemarks/Polygons"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def ProcessInput():&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; sourceKMLFile = arcpy.GetParameterAsText(0)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; outputFeatureClass = kmlToFeatures(sourceKMLFile)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.SetParameterAsText(1, outputFeatureClass)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ProcessInput()&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 08:00:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160546#M14977</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2016-09-26T08:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I load local kml file as KMLLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160547#M14978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you're dealing with local KML files, you should really be doing the conversion on the client (in the browser via JavaScript) rather than on another server. A client-side conversion will be a lot faster than sending the KML to another server (arcgis.com or GP service).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.npmjs.com/search?q=kml"&gt;There are a number of libraries on NPM that can convert from KML to GeoJSON&lt;/A&gt;. From there you can use &lt;A href="https://www.npmjs.com/package/arcgis-to-geojson-utils"&gt;arcgis-to-geojson-utils&lt;/A&gt; to get from GeoJSON to ArcGIS features.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 18:01:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160547#M14978</guid>
      <dc:creator>JeffJacobson</dc:creator>
      <dc:date>2016-09-26T18:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I load local kml file as KMLLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160548#M14979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much i will give it a try &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;have a great day!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 05:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160548#M14979</guid>
      <dc:creator>ShaharBukra</dc:creator>
      <dc:date>2016-09-27T05:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How can I load local kml file as KMLLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160549#M14980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will give it a try, this will be easier then working with the Portal...&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 05:53:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/160549#M14980</guid>
      <dc:creator>ShaharBukra</dc:creator>
      <dc:date>2016-09-27T05:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I load local kml file as KMLLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/1383649#M83672</link>
      <description>&lt;P&gt;Hi, I also have clients with there own local kml files.&lt;/P&gt;&lt;P&gt;I tried it several times, but still have issues in uploading file.&lt;/P&gt;&lt;P&gt;If you fix this issue, can you please help me?&lt;/P&gt;&lt;P&gt;My email address is loyalman00715@outlook.com&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 21:29:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-load-local-kml-file-as-kmllayer/m-p/1383649#M83672</guid>
      <dc:creator>loyaldevguru</dc:creator>
      <dc:date>2024-02-16T21:29:20Z</dc:date>
    </item>
  </channel>
</rss>

