<?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 How to add a raster image from a web location in ArcGIS Explorer Desktop Questions</title>
    <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/how-to-add-a-raster-image-from-a-web-location/m-p/368674#M2310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone know how to programatically add a raster image (ungeoreferenced) from the Internet. I can add this image &lt;BR /&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fdata.cei.psu.edu%2Fpennpilot%2Fera1940%2Felk_1941%2Felk_1941_photos_jpg_200%5Celk_042840_apm_103_36.jpg" rel="nofollow" target="_blank"&gt;http://data.cei.psu.edu/pennpilot/era1940/elk_1941/elk_1941_photos_jpg_200\elk_042840_apm_103_36.jpg&lt;/A&gt;&lt;SPAN&gt; directly to AGX by selecting Add Content, Add Raster, and then typing or pasting that web address into the box. But when I try to add it programatically, it gives me an error message. One thing I've noticed is that it tells me it can't add the image from http:/data... (notice the single backslash). No matter what I do I can't get it to use two back slashes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The method I'm using is Raster.OpenRasterFile(webaddress) with the webaddress being exactly what I showed above for the url.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried other methods too. I was successful downloading the above image programatically using webclient and webclient.downloadfile. That worked, but I ran into troubles trying to add the downloaded image as a raster. Here's what I tried.&lt;/P&gt;&lt;P&gt;Dim myImage As Raster = Raster.OpenRasterFile(savepath)&lt;/P&gt;&lt;P&gt;dim myRasterLayer As RasterLayer = rasterlayer.OpenFromRaster(myImage)&lt;/P&gt;&lt;P&gt;mapdisp.childItems.add(myRasterLayer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This approach also works but then I get an error message that it's got no coordinate system and the georeference option is greyed out so I can't fix it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas/comments are appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ellen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Nov 2015 21:34:27 GMT</pubDate>
    <dc:creator>EllenBryson2</dc:creator>
    <dc:date>2015-11-24T21:34:27Z</dc:date>
    <item>
      <title>How to add a raster image from a web location</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/how-to-add-a-raster-image-from-a-web-location/m-p/368674#M2310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone know how to programatically add a raster image (ungeoreferenced) from the Internet. I can add this image &lt;BR /&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fdata.cei.psu.edu%2Fpennpilot%2Fera1940%2Felk_1941%2Felk_1941_photos_jpg_200%5Celk_042840_apm_103_36.jpg" rel="nofollow" target="_blank"&gt;http://data.cei.psu.edu/pennpilot/era1940/elk_1941/elk_1941_photos_jpg_200\elk_042840_apm_103_36.jpg&lt;/A&gt;&lt;SPAN&gt; directly to AGX by selecting Add Content, Add Raster, and then typing or pasting that web address into the box. But when I try to add it programatically, it gives me an error message. One thing I've noticed is that it tells me it can't add the image from http:/data... (notice the single backslash). No matter what I do I can't get it to use two back slashes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The method I'm using is Raster.OpenRasterFile(webaddress) with the webaddress being exactly what I showed above for the url.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried other methods too. I was successful downloading the above image programatically using webclient and webclient.downloadfile. That worked, but I ran into troubles trying to add the downloaded image as a raster. Here's what I tried.&lt;/P&gt;&lt;P&gt;Dim myImage As Raster = Raster.OpenRasterFile(savepath)&lt;/P&gt;&lt;P&gt;dim myRasterLayer As RasterLayer = rasterlayer.OpenFromRaster(myImage)&lt;/P&gt;&lt;P&gt;mapdisp.childItems.add(myRasterLayer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This approach also works but then I get an error message that it's got no coordinate system and the georeference option is greyed out so I can't fix it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas/comments are appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ellen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 21:34:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/how-to-add-a-raster-image-from-a-web-location/m-p/368674#M2310</guid>
      <dc:creator>EllenBryson2</dc:creator>
      <dc:date>2015-11-24T21:34:27Z</dc:date>
    </item>
  </channel>
</rss>

