<?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: SpatialReference of MPK using Pthon Script with ArcGIS Runtime SDK java 10.1.1 in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627009#M1909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Question: How did you create your .gpk? I assume you shared your GP result from Desktop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, on the Geoprocessing Package dialog, did you make sure that the &lt;/SPAN&gt;&lt;STRONG&gt;Support ArcGIS Runtime&lt;/STRONG&gt;&lt;SPAN&gt; option was checked?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Nov 2013 14:29:13 GMT</pubDate>
    <dc:creator>EricBader</dc:creator>
    <dc:date>2013-11-12T14:29:13Z</dc:date>
    <item>
      <title>SpatialReference of MPK using Pthon Script with ArcGIS Runtime SDK java 10.1.1</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627008#M1908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All Folks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to get the spatial Reference of 'MPK' file using python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My Python code is as follows::&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mpk = arcpy.mapping.MapDocument("c:\myMpks\world.mpk")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dataFrames = arcpy.mapping.ListDataFrames(mpk)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myCRS = frame.spatialReference.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the above code is working fine when I run the python script in ArcMap10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But when I Run this by creating gpk, and run then its gives ServerException and my gpk gets currupted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to confirm followings::&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;UL&gt;&lt;STRONG&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;LI&gt;&lt;STRONG&gt;Is arcpy.mapping.MapDocument() supported in ArcGIS Runtime SDK?&lt;/STRONG&gt;&lt;/LI&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;LI&gt;If above is supported then, how to achieve the result?&lt;/LI&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;LI&gt;If above is not supported then, what could be the alternative?&lt;/LI&gt;&amp;nbsp; &lt;BR /&gt; &lt;/UL&gt;&lt;SPAN&gt;your suggestions are welcomed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ravindra Shekhawat.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 09:19:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627008#M1908</guid>
      <dc:creator>RavindraSingh</dc:creator>
      <dc:date>2013-11-11T09:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialReference of MPK using Pthon Script with ArcGIS Runtime SDK java 10.1.1</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627009#M1909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Question: How did you create your .gpk? I assume you shared your GP result from Desktop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, on the Geoprocessing Package dialog, did you make sure that the &lt;/SPAN&gt;&lt;STRONG&gt;Support ArcGIS Runtime&lt;/STRONG&gt;&lt;SPAN&gt; option was checked?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 14:29:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627009#M1909</guid>
      <dc:creator>EricBader</dc:creator>
      <dc:date>2013-11-12T14:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialReference of MPK using Pthon Script with ArcGIS Runtime SDK java 10.1.1</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627010#M1910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you expand on your workflow? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering why you are trying to access the mpk info via a geoprocessing package.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As an alternative I would suggest spinning up a map service via creating a local dynamic layer from the mpk, then you can get the spatial reference of the map service. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ArcGISLocalDynamicMapServiceLayer serviceLayer = new ArcGISLocalDynamicMapServiceLayer("c:\\USCitiesStates.mpk");
serviceLayer.addLayerInitializeCompleteListener(new LayerInitializeCompleteListener() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; @Override
&amp;nbsp; public void layerInitializeComplete(LayerInitializeCompleteEvent e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; SpatialReference spRef = ((ArcGISLocalDynamicMapServiceLayer)e.getSource()).getDefaultSpatialReference();
&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(spRef) ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; }
});
serviceLayer.initializeAsync();
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:43:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627010#M1910</guid>
      <dc:creator>EliseAcheson1</dc:creator>
      <dc:date>2021-12-12T02:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialReference of MPK using Pthon Script with ArcGIS Runtime SDK java 10.1.1</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627011#M1911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Question: How did you create your .gpk? I assume you shared your GP result from Desktop.&lt;BR /&gt;If so, on the Geoprocessing Package dialog, did you make sure that the &lt;STRONG&gt;Support ArcGIS Runtime&lt;/STRONG&gt; option was checked?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Eric Bader,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, &lt;/SPAN&gt;&lt;STRONG&gt;Support ArcGIS Runtime&lt;/STRONG&gt;&lt;SPAN&gt; option was checked.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 12:16:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627011#M1911</guid>
      <dc:creator>RavindraSingh</dc:creator>
      <dc:date>2013-11-25T12:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialReference of MPK using Pthon Script with ArcGIS Runtime SDK java 10.1.1</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627012#M1912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Elise Acheson,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way I am able to get the CRS. But Lets say if i have to add multiple MPKs in my Project, then the response of ArcGISRuntime server is not good. so tp overcome this problem. I am thinking to create a single gpk service and this same service will be used for getting the CRS of any mpk, the only thing is, you have to give the path of that mpk.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if i remove following code from python:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mpk = arcpy.mapping.MapDocument("c:\myMpks\world.mpk")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dataFrames = arcpy.mapping.ListDataFrames(mpk)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myCRS = frame.spatialReference.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then the gpk service works perfect (It doesnot get crashed.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 12:16:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627012#M1912</guid>
      <dc:creator>RavindraSingh</dc:creator>
      <dc:date>2013-11-25T12:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialReference of MPK using Pthon Script with ArcGIS Runtime SDK java 10.1.1</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627013#M1913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your first test should be on an mxd to see if it works at all !!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 16:12:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/spatialreference-of-mpk-using-pthon-script-with/m-p/627013#M1913</guid>
      <dc:creator>SachinKanaujia</dc:creator>
      <dc:date>2013-11-25T16:12:51Z</dc:date>
    </item>
  </channel>
</rss>

