<?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: Black Borders on GeoTiffs imported to RasterLayer type in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/black-borders-on-geotiffs-imported-to-rasterlayer/m-p/1054061#M10058</link>
    <description>&lt;P&gt;Try setting the background color with a Raster Function - example code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;async Task AddRasterAndSetBackgroundColorValue() 
{
    try
    {
        // Create a raster dataset from a local file raster.
        Raster raster = new Raster(@"..\FileRaster.tif");

        // Await the Load to catch any errors.
        await raster.LoadAsync();

        // Create a raster function from the JSON string using the static/Shared method called: RasterFunction.FromJson(json as String)
        RasterFunction rasterFunction = RasterFunction.FromJson(jsonFunction);

        // Get the raster function arguments
        RasterFunctionArguments rasterFunctionArguments = rasterFunction.Arguments;
                
        // Get the list of raster names from the raster function arguments.
        IReadOnlyList&amp;lt;string&amp;gt; rasterNames = rasterFunctionArguments.GetRasterNames();

        // Set the local file raster as a raster name argument.
        rasterFunctionArguments.SetRaster(rasterNames[0], raster);

        // Create a new raster based on the raster function.
        Raster rasterWithFunction = new Raster(rasterFunction);

        // Create a new raster layer from the raster with function applied.
        RasterLayer rasterLayer = new RasterLayer(rasterWithFunction);

        // Add RasterLayer with function to Map OperationalLayers collection.
        Map.OperationalLayers.Add(rasterLayer);
    }
    catch (Exception ex)
    {

    }
}

string jsonFunction =
@"{
    ""raster_function"":{""type"":""Mask_function""},
    ""raster_function_arguments"":
    {
        ""nodata_values"":{""double_array"":[0],""type"":""Raster_function_variable""},
        ""nodata_interpretation"":{""nodata_interpretation"":""all"",""type"":""Raster_function_variable""},
        ""raster"":{""name"":""raster"",""is_raster"":true,""type"":""Raster_function_variable""},
        ""type"":""Raster_function_arguments""
   },
    ""type"":""Raster_function_template""
}";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 May 2021 00:37:13 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2021-05-04T00:37:13Z</dc:date>
    <item>
      <title>Black Borders on GeoTiffs imported to RasterLayer type</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/black-borders-on-geotiffs-imported-to-rasterlayer/m-p/1053910#M10054</link>
      <description>&lt;P&gt;When i load this geotiff into my ArcgisRuntime UWP app i have black borders where there are no valid pixels.&amp;nbsp; When i load the same geotiff into arcgisPro, i get transparent borders.&lt;/P&gt;&lt;P&gt;Is there a way to show these "non-valid pixels" as transparent in my arcgis runtime UWP app?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;geotiff under question is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="no borders in arcgisPro" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12430i8A6C4E8C145DC620/image-size/large?v=v2&amp;amp;px=999" role="button" title="no_black_borders_arcgis_pro.PNG" alt="no borders in arcgisPro" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;no borders in arcgisPro&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="black borders in arcgisRuntime UWP" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12431i1D5F82F51D6E4C94/image-size/large?v=v2&amp;amp;px=999" role="button" title="borders_uwp_app.JPG" alt="black borders in arcgisRuntime UWP" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;black borders in arcgisRuntime UWP&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 18:33:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/black-borders-on-geotiffs-imported-to-rasterlayer/m-p/1053910#M10054</guid>
      <dc:creator>justinfernandes</dc:creator>
      <dc:date>2021-05-03T18:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Black Borders on GeoTiffs imported to RasterLayer type</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/black-borders-on-geotiffs-imported-to-rasterlayer/m-p/1054061#M10058</link>
      <description>&lt;P&gt;Try setting the background color with a Raster Function - example code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;async Task AddRasterAndSetBackgroundColorValue() 
{
    try
    {
        // Create a raster dataset from a local file raster.
        Raster raster = new Raster(@"..\FileRaster.tif");

        // Await the Load to catch any errors.
        await raster.LoadAsync();

        // Create a raster function from the JSON string using the static/Shared method called: RasterFunction.FromJson(json as String)
        RasterFunction rasterFunction = RasterFunction.FromJson(jsonFunction);

        // Get the raster function arguments
        RasterFunctionArguments rasterFunctionArguments = rasterFunction.Arguments;
                
        // Get the list of raster names from the raster function arguments.
        IReadOnlyList&amp;lt;string&amp;gt; rasterNames = rasterFunctionArguments.GetRasterNames();

        // Set the local file raster as a raster name argument.
        rasterFunctionArguments.SetRaster(rasterNames[0], raster);

        // Create a new raster based on the raster function.
        Raster rasterWithFunction = new Raster(rasterFunction);

        // Create a new raster layer from the raster with function applied.
        RasterLayer rasterLayer = new RasterLayer(rasterWithFunction);

        // Add RasterLayer with function to Map OperationalLayers collection.
        Map.OperationalLayers.Add(rasterLayer);
    }
    catch (Exception ex)
    {

    }
}

string jsonFunction =
@"{
    ""raster_function"":{""type"":""Mask_function""},
    ""raster_function_arguments"":
    {
        ""nodata_values"":{""double_array"":[0],""type"":""Raster_function_variable""},
        ""nodata_interpretation"":{""nodata_interpretation"":""all"",""type"":""Raster_function_variable""},
        ""raster"":{""name"":""raster"",""is_raster"":true,""type"":""Raster_function_variable""},
        ""type"":""Raster_function_arguments""
   },
    ""type"":""Raster_function_template""
}";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 00:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/black-borders-on-geotiffs-imported-to-rasterlayer/m-p/1054061#M10058</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2021-05-04T00:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Black Borders on GeoTiffs imported to RasterLayer type</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/black-borders-on-geotiffs-imported-to-rasterlayer/m-p/1054447#M10061</link>
      <description>&lt;P&gt;you are my hero.&amp;nbsp; thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 22:08:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/black-borders-on-geotiffs-imported-to-rasterlayer/m-p/1054447#M10061</guid>
      <dc:creator>justinfernandes</dc:creator>
      <dc:date>2021-05-04T22:08:36Z</dc:date>
    </item>
  </channel>
</rss>

