<?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: Non-deprecated way to access IRaster in Java SOE? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284342#M7347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, I thought it was implied by the fact that I was using IMapServerDataAccess. As of 10.1, all map services are optimized map services, so you have to use IMapServerDataAccess to access map data from an SOE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to be sure, I tried using getLayer(String,int) and it fails with an AutomationException (no such interface supported).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Eric&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Apr 2013 14:26:32 GMT</pubDate>
    <dc:creator>EricRussell</dc:creator>
    <dc:date>2013-04-11T14:26:32Z</dc:date>
    <item>
      <title>Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284334#M7339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As far as I can tell, the only way to get an IRaster from an IMapServerDataAccess in a Java Server Object Extension is to create a new com.esri.arcgis.datasourcesraster.Raster, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:monospace;"&gt;&lt;BR /&gt;[indent]&lt;BR /&gt; IMapServerDataAccess dataAccess = (IMapServerDataAccess)mapServer;&lt;BR /&gt; return new Raster(dataAccess.getDataSource(mapServer.getDefaultMapName(), 0));&lt;BR /&gt;[/indent]&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This works, but the one-argument constructor for Raster is deprecated. Is there a non-deprecated way to get the data source as an IRaster?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 00:41:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284334#M7339</guid>
      <dc:creator>EricRussell</dc:creator>
      <dc:date>2013-04-10T00:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284335#M7340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Eric,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The IMapServerDataAccess Interface docs indicate that &lt;/SPAN&gt;&lt;STRONG&gt;&lt;A href="http://forums.arcgis.../../../com/esri/arcgis/carto/IMapServerDataAccess.html#getDataSource(java.lang.String, int)"&gt;getDataSource&lt;/A&gt;&lt;/STRONG&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true"&gt;String&lt;/A&gt;&lt;SPAN&gt; mapName,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int layerID) returns one of the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Get Data Source&lt;BR /&gt;This function allows fine-grained object access to a FeatureLayer, a RasterLayer or a StandaloneTable by returning IFeatureClass, IRaster or ITable respectively. If the layer or standalone table has any joins, the returned object will not contain the joined portion. In addition any field visibility or field alias set to the layer in the source map document will be ignored as it returns the underlying data source.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And, the Raster class docs indicate that even though the method you used is deprecated, that you can simply cast the object to Raster.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 13:46:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284335#M7340</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-04-10T13:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284336#M7341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Leo,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The documentation certainly seems to indicate that the result of getDataSource can be cast directly to an IRaster or IFeatureClass, but that's actually not the case. The getDataSource method returns a com.esri.arcgis.interop.RemoteObjRef, which can't be cast to an IRaster or IFeatureClass. You have to wrap in in a call to new FeatureClass(Object) or new Raster(Object). This isn't in the documentation, but it is in the sample code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Eric&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 14:10:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284336#M7341</guid>
      <dc:creator>EricRussell</dc:creator>
      <dc:date>2013-04-10T14:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284337#M7342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just so I can compare apples to apples, what is your layer 0?&amp;nbsp; A mosaic?&amp;nbsp; A raster catalog?&amp;nbsp; Something else?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 14:26:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284337#M7342</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-04-10T14:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284338#M7343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's just a regular raster layer, displaying an 8-bit unsigned file geodatabase raster dataset of flow direction data.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 16:27:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284338#M7343</guid>
      <dc:creator>EricRussell</dc:creator>
      <dc:date>2013-04-10T16:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284339#M7344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, if regular Raster layer, then can't you do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
RasterLayer rl = (RasterLayer) mapServer.getLayer("Layers", 0);
System.out.println(rl.getSpatialReference().getName());
System.out.println(rl.getFilePath());
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:45:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284339#M7344</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2021-12-11T13:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284340#M7345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That may work. I'll give it a try when I'm back in the office tomorrow. But I was under the impression that you can't use the getLayer method from an SOE at all as of 10.1, because it's not supported on optimized map services (see, for example, &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2010/11/12/accessing-optimized-map-services-with-server-object-extensions/"&gt;http://blogs.esri.com/esri/arcgis/2010/11/12/accessing-optimized-map-services-with-server-object-extensions/&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/11/15/whats-new-for-java-server-object-extension-builders/"&gt;http://blogs.esri.com/esri/arcgis/2011/11/15/whats-new-for-java-server-object-extension-builders/&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 00:27:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284340#M7345</guid>
      <dc:creator>EricRussell</dc:creator>
      <dc:date>2013-04-11T00:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284341#M7346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;But I was under the impression that you can't use the getLayer method from an SOE at all as of 10.1, because it's not supported on optimized map services &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you tell anyone in the original post you were using 10.1 with optimized map services?&amp;nbsp; No.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was going to remind you where to go from IRasterLayer, but it doesn't matter now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;A &lt;STRONG&gt;Raster&lt;/STRONG&gt; can be created in three ways:&lt;BR /&gt;1. Get from a &lt;STRONG&gt;RasterLayer&lt;/STRONG&gt; using &lt;STRONG&gt;IRasterLayer::Raster&lt;/STRONG&gt;&lt;BR /&gt;2. Create from a raster dataset using either :&lt;STRONG&gt;IRasterDataset::CreateDefaultRaster&lt;/STRONG&gt; or &lt;STRONG&gt;IRasterDataset2::CreateFullRaster&lt;/STRONG&gt;&lt;BR /&gt;3. Cocreate a &lt;STRONG&gt;Raster&lt;/STRONG&gt; and append raster bands using &lt;STRONG&gt;IRasterBandCollection&lt;/STRONG&gt; interface.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 13:28:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284341#M7346</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-04-11T13:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284342#M7347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, I thought it was implied by the fact that I was using IMapServerDataAccess. As of 10.1, all map services are optimized map services, so you have to use IMapServerDataAccess to access map data from an SOE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to be sure, I tried using getLayer(String,int) and it fails with an AutomationException (no such interface supported).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Eric&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 14:26:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284342#M7347</guid>
      <dc:creator>EricRussell</dc:creator>
      <dc:date>2013-04-11T14:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Non-deprecated way to access IRaster in Java SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284343#M7348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I'm out of options.&amp;nbsp; Not being on 10.1 doesn't help me help you either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since the 10.1 samples show this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;nbsp; FeatureClass fc = new FeatureClass(this.mapServerDataAccess.getDataSource(mapName, layerId)); &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It stands to reason that one could do this... I guess not though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt; IRaster raster = this.mapServerDataAccess.getDataSource(mapName, layerId); &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If getDataSource on IMapServerDataAccess doesn't do this,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This function allows fine-grained object access to a FeatureLayer, a RasterLayer&amp;nbsp; or a StandaloneTable by returning IFeatureClass, IRaster or ITable respectively.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;then maybe we need to report it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 15:54:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/non-deprecated-way-to-access-iraster-in-java-soe/m-p/284343#M7348</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-04-11T15:54:27Z</dc:date>
    </item>
  </channel>
</rss>

