<?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: RasterLayer is not showing the image at right location in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511567#M3487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although I have no idea of how to program this for Android, I do not speak java or whatever this is....&lt;/P&gt;&lt;P&gt;But, you say your raster image is in ED50 / UTM30N. That indicates to me that you will need a suitable datum transformation between ED50 and WGS84 (on which Web Mercator is based).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Nov 2016 13:23:51 GMT</pubDate>
    <dc:creator>NeilAyres</dc:creator>
    <dc:date>2016-11-22T13:23:51Z</dc:date>
    <item>
      <title>RasterLayer is not showing the image at right location</title>
      <link>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511566#M3486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm developing an Android application and I'm trying to add a RasterLayer to may map containing a tif image. The map has web mercator 102100 as spatial reference and the spatial reference of the image is different (ED50 / UTM 30N). I have the .pfj, .tif and .tfw files in the same folder. This is my code to add the RasterLayer to my MapView:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;String rasterPath = "&amp;lt;path to tif image&amp;gt;";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;FileRasterSource rasterSource = null;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;try {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;rasterSource = new FileRasterSource(rasterPath);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;rasterSource.project(mMapView.getSpatialReference());&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;RasterLayer rasterLayer = new RasterLayer(rasterSource);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;rasterLayer.setOpacity(0.5f);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;mMapView.addLayer(rasterLayer);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;} catch (IllegalArgumentException ie) {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Log.d("IAE", "null or empty path");&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;} catch (FileNotFoundException fe) {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Log.d("FNFE", "raster file doesn't exist");&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;} catch (RuntimeException re) {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Log.d("RE", "raster file can't be opened");&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: normal;"&gt;When I run the application, the image is shown in a bad location. I think the problem is the API is not making the reprojection of the image. How does the API know the spatial reference of the image? Do I need to add any other file?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: normal;"&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 10:46:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511566#M3486</guid>
      <dc:creator>JoseFernandez6</dc:creator>
      <dc:date>2016-11-22T10:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: RasterLayer is not showing the image at right location</title>
      <link>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511567#M3487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although I have no idea of how to program this for Android, I do not speak java or whatever this is....&lt;/P&gt;&lt;P&gt;But, you say your raster image is in ED50 / UTM30N. That indicates to me that you will need a suitable datum transformation between ED50 and WGS84 (on which Web Mercator is based).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 13:23:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511567#M3487</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-11-22T13:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: RasterLayer is not showing the image at right location</title>
      <link>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511568#M3488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alternatively, just reproject the image first (with a transformation) from UTM30/ED50 to WebMerc/WGS84.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 13:25:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511568#M3488</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-11-22T13:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: RasterLayer is not showing the image at right location</title>
      <link>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511569#M3489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response. I agree with you I need a datum transformation. And there is the real problem: I don't know how to add that transformation. In that line:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold; font-size: 13px;"&gt;rasterSource.project(mMapView.getSpatialReference());&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I indicate the source what spatial reference I want to use in my map. Then, the API would make the projection, but: what is the spatial reference of the image? I know the spatial reference but I don't know how to say the API what spatial reference is used in the image in order to make the projection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 08:55:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511569#M3489</guid>
      <dc:creator>JoseFernandez6</dc:creator>
      <dc:date>2016-11-23T08:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: RasterLayer is not showing the image at right location</title>
      <link>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511570#M3490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, there are a whole stack of ED50 to WGS84 transformations available to you. Which one depends on the location of your data and accuracy.&lt;/P&gt;&lt;P&gt;See pages 12 to 14 of the geographic_transformations.pdf found in the documentation folder of the ArcGIS installation.&lt;/P&gt;&lt;P&gt;In ArcGIS / arcpy / python world, the transformation is set in the environment variables. So, no idea how to do this in Android.&lt;/P&gt;&lt;P&gt;As I said before, isn't it just vest to use the normal desktop tools and reproject / transform the image up front.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 11:11:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/rasterlayer-is-not-showing-the-image-at-right/m-p/511570#M3490</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-11-23T11:11:55Z</dc:date>
    </item>
  </channel>
</rss>

