<?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: Create a raster from a raster function:&amp;quot;Raster_calculator_function&amp;quot; in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1657158#M13726</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Have you succeeded to solve?&lt;/P&gt;</description>
    <pubDate>Fri, 10 Oct 2025 17:32:09 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2025-10-10T17:32:09Z</dc:date>
    <item>
      <title>Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1322871#M12067</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Recently i develop a gis app with Navtive Maps SDK 200.1, i want to apply a raster function(Raster_calculator_function) on a raster file, but it doesn't work, so i wander whether i can use&amp;nbsp; the function:"Con()" in the expression statement as following:&lt;/P&gt;&lt;P&gt;string theJSON_String =&lt;BR /&gt;@"{&lt;BR /&gt;""raster_function_arguments"":&lt;BR /&gt;{&lt;BR /&gt;""expression"":{ ""string"":""Con(r1&amp;gt;r2,0,1)"",""name"":""expression"",""type"":""Raster_function_variable""},&lt;BR /&gt;""raster_names"":{ ""name"":""raster_names"",""type"":""Raster_function_variable""},&lt;BR /&gt;""raster_names"":{ ""name"":""raster_names"",""string_array"":[""r1"",""r2""],""type"":""Raster_function_variable""},&lt;BR /&gt;""r1"":{ ""name"":""r1"",""is_raster"":true,""type"":""Raster_function_variable""},&lt;BR /&gt;""r2"":{ ""name"":""r2"",""is_raster"":true,""type"":""Raster_function_variable""},&lt;BR /&gt;""type"":""Raster_function_arguments""&lt;BR /&gt;},&lt;BR /&gt;""raster_function"":{ ""type"":""Raster_calculator_function""},&lt;BR /&gt;""type"":""Raster_function_template""&lt;BR /&gt;}";&lt;/P&gt;&lt;P&gt;// Create a raster function from the JSON string using the static/Shared method called: RasterFunction.FromJson(json as String)&lt;BR /&gt;RasterFunction myRasterFunction = RasterFunction.FromJson(theJSON_String);&lt;/P&gt;&lt;P&gt;&amp;nbsp;Esri.ArcGISRuntime.Rasters.RasterFunction(path as String)&lt;/P&gt;&lt;P&gt;// Get the raster function arguments&lt;BR /&gt;RasterFunctionArguments myRasterFunctionArguments = myRasterFunction.Arguments;&lt;/P&gt;&lt;P&gt;// Get the list of names from the raster function arguments&lt;BR /&gt;IReadOnlyList&amp;lt;string&amp;gt; myRasterNames = myRasterFunctionArguments.GetRasterNames();&lt;/P&gt;&lt;P&gt;// Apply the first raster name and image service raster in the raster function arguments&lt;BR /&gt;myRasterFunctionArguments.SetRaster(myRasterNames[0], raster1);&lt;BR /&gt;myRasterFunctionArguments.SetRaster(myRasterNames[1], raster2);&lt;/P&gt;&lt;P&gt;var layer = new RasterLayer(new Raster(myRasterFunction));&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 07:36:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1322871#M12067</guid>
      <dc:creator>AlexanderZhang</dc:creator>
      <dc:date>2023-08-28T07:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324156#M12071</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/647271"&gt;@AlexanderZhang&lt;/a&gt;&amp;nbsp;thank you for your question. It seems like you've viewed our&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-dotnet-samples/blob/af7778135796060c02e7df5a1cfb48dffdfee722/src/WPF/WPF.Viewer/Samples/Layers/RasterLayerRasterFunction/RasterLayerRasterFunction.xaml.cs" target="_self"&gt;RasterLayerRasterFunction&lt;/A&gt;&amp;nbsp;WPF sample. Since your code follows that logic, this should work! The comparison expression makes sense in your JSON. But you said it isn't working, so a few things to consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Verify that your raster1 or raster2 is instantiated correctly. Ensure the link to the raster service, or the file path to the offline raster is correct.&lt;/LI&gt;&lt;LI&gt;Is your code not compiling? I am guessing this is just a copy-paste error, but "&lt;SPAN&gt;Esri.ArcGISRuntime.Rasters.RasterFunction(path as String)" won't compile as is...&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Let me check to see that the Con() expression works with &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/net/layers/add-raster-data/#raster_calculator" target="_self"&gt;Raster_calculator&amp;nbsp;&lt;/A&gt;per your request. Sorry for the correction, hoping it's an easy fix!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 00:50:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324156#M12071</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2023-08-31T00:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324197#M12072</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/655350"&gt;@williambohrmann3&lt;/a&gt;&amp;nbsp; thank you for your help, following your suggestion, I recoded my program. I fixed the compilation error you&amp;nbsp;pointed out,&amp;nbsp; then i modified the JSON string as following:&lt;/P&gt;&lt;P&gt;string theJSON_String =&lt;BR /&gt;@"{&lt;BR /&gt;""raster_function_arguments"":&lt;BR /&gt;{&lt;BR /&gt;""expression"":{ ""string"":""r1+r2"",""name"":""expression"",""type"":""Raster_function_variable""},&lt;BR /&gt;""raster_names"":{ ""name"":""raster_names"",""string_array"":[""r1"",""r2""],""type"":""Raster_function_variable""},&lt;BR /&gt;""r1"":{ ""name"":""r1"",""is_raster"":true,""type"":""Raster_function_variable""},&lt;BR /&gt;""r2"":{ ""name"":""r2"",""is_raster"":true,""type"":""Raster_function_variable""},&lt;BR /&gt;""type"":""Raster_function_arguments""&lt;BR /&gt;},&lt;BR /&gt;""raster_function"":{ ""type"":""Raster_calculator_function""},&lt;BR /&gt;""type"":""Raster_function_template""&lt;BR /&gt;}";&lt;/P&gt;&lt;P&gt;It works well! However,&amp;nbsp;When I modify the JSON string to the following case, it doesn't work anymore(The app automatically exited without any error message.):&lt;/P&gt;&lt;P&gt;string theJSON_String =&lt;BR /&gt;@"{&lt;BR /&gt;""raster_function_arguments"":&lt;BR /&gt;{&lt;BR /&gt;""expression"":{ ""string"":""Con(r1&amp;gt;r2,0,1)"",""name"":""expression"",""type"":""Raster_function_variable""},&lt;BR /&gt;""raster_names"":{ ""name"":""raster_names"",""string_array"":[""r1"",""r2""],""type"":""Raster_function_variable""},&lt;BR /&gt;""r1"":{ ""name"":""r1"",""is_raster"":true,""type"":""Raster_function_variable""},&lt;BR /&gt;""r2"":{ ""name"":""r2"",""is_raster"":true,""type"":""Raster_function_variable""},&lt;BR /&gt;""type"":""Raster_function_arguments""&lt;BR /&gt;},&lt;BR /&gt;""raster_function"":{ ""type"":""Raster_calculator_function""},&lt;BR /&gt;""type"":""Raster_function_template""&lt;BR /&gt;}";&lt;/P&gt;&lt;P&gt;The raster1 and raster2&amp;nbsp; are&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;offline rasters with a single band. So, i would like to know if the raster function(Raster_calculator_function) supports the following expression: "Con(r1&amp;gt;r2,0,1)".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 01:29:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324197#M12072</guid>
      <dc:creator>AlexanderZhang</dc:creator>
      <dc:date>2023-08-31T01:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324425#M12073</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/647271"&gt;@AlexanderZhang&lt;/a&gt;&amp;nbsp;, your original JSON was correct. My mistake. Glad you fixed the compilation error. Waiting to hear from our raster experts on if Con() expression will work here.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 16:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324425#M12073</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2023-08-31T16:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324600#M12074</link>
      <description>&lt;P&gt;Your Con() expression works in ArcGIS Pro. However, with your app, I am also getting same behavior: silent failure. I checked the output in Visual Studio:&amp;nbsp;&lt;SPAN&gt;The program has exited with code 3221225477 (0xc0000005) 'Access violation'. When debugging, I notice the RasterLayer.Raster.Path was empty. However, I changed your expression to "r1 &amp;gt; r2" and the code compiled. Could you try changing the expression and let me know if that resolves your issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If that doesn't work, I'd like to know... Are you working with a raster service or a local file? If a local file, what file extension? And did you ever see the same access violation in output?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 23:52:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324600#M12074</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2023-08-31T23:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324630#M12075</link>
      <description>&lt;P&gt;Thanks for your information, i'm afraid it can't resolves my issue by changing the expression, because I will use Con expression like "Con(r1&amp;gt;2000,r1,r2)" later!&lt;/P&gt;&lt;P&gt;In my app, the path of the r1 and r2 point to two local raster files(.tif).&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 05:45:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324630#M12075</guid>
      <dc:creator>AlexanderZhang</dc:creator>
      <dc:date>2023-09-01T05:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324997#M12076</link>
      <description>&lt;P&gt;I wonder if the issue is the Con() function isn't syntactically correct. I think r1 and r2 need to be surrounded by quotations, since they're names of raster function variables. This is how the raster calculator works in ArcGIS Pro. Can you change your expression to:&amp;nbsp;""Con(\""r1\""&amp;gt;\""r2\"",0,1)""?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 22:14:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1324997#M12076</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2023-09-01T22:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1325682#M12081</link>
      <description>&lt;P&gt;Hi,&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/655350"&gt;@williambohrmann3&lt;/a&gt;,&amp;nbsp;I've tried your idea but it still doesn't work，Thanks for your advice.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 00:14:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1325682#M12081</guid>
      <dc:creator>AlexanderZhang</dc:creator>
      <dc:date>2023-09-06T00:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1326197#M12087</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/647271"&gt;@AlexanderZhang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you're able to send me a reproducer project with your two raster files, I'd be happy to take a look.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 00:02:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1326197#M12087</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2023-09-07T00:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1326398#M12094</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/655350"&gt;@williambohrmann3&lt;/a&gt;, the raster files are too big to send you, i'm currently trying another solution to implement the function: &lt;SPAN&gt;create&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;a geoprocessing package (&lt;/SPAN&gt;&lt;SPAN&gt;.gpkx&lt;/SPAN&gt;&lt;SPAN&gt;) in ArcGIS Pro&lt;/SPAN&gt;&lt;SPAN&gt;, and then execute the geoprocessing package&amp;nbsp;with ArcGIS Runtime Local Server.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Unfortunately,&amp;nbsp;I encountered another &lt;A href="https://community.esri.com/t5/net-maps-sdk-questions/the-quot-geodesic-viewshed-3d-analyst-quot/m-p/1326392#M12093" target="_self"&gt;problem&lt;/A&gt;&amp;nbsp;, would you like give me some advice?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 14:46:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1326398#M12094</guid>
      <dc:creator>AlexanderZhang</dc:creator>
      <dc:date>2023-09-07T14:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1326938#M12096</link>
      <description>&lt;P&gt;Oh ok. If you're able to zip your raster files and code, my email is &lt;A href="mailto:wbohrmann@esri.com" target="_blank"&gt;wbohrmann@esri.com&lt;/A&gt;&amp;nbsp;but I understand if its too large to share.&lt;/P&gt;&lt;P&gt;I see Mike responded to your other problem.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 18:38:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1326938#M12096</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2023-09-08T18:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1657158#M13726</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Have you succeeded to solve?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 17:32:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1657158#M13726</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2025-10-10T17:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a raster from a raster function:"Raster_calculator_function"</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1657683#M13737</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/655350"&gt;@williambohrmann3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello, has it been solved - this issue with Con? We are dealing with the same problem.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2025 14:05:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/create-a-raster-from-a-raster-function-quot-raster/m-p/1657683#M13737</guid>
      <dc:creator>DonatasBružas</dc:creator>
      <dc:date>2025-10-14T14:05:28Z</dc:date>
    </item>
  </channel>
</rss>

