<?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: Masking / clipping raster in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1090432#M7062</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/505216"&gt;@JuanPeralta_ESRIES&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you explain the effect you &lt;EM&gt;were&lt;/EM&gt; looking for please? I thought that you were trying to clip a displayed raster to a polygon area of interest.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 15:52:58 GMT</pubDate>
    <dc:creator>Nicholas-Furness</dc:creator>
    <dc:date>2021-08-19T15:52:58Z</dc:date>
    <item>
      <title>Masking / clipping raster</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1088554#M7054</link>
      <description>&lt;P&gt;I am working with the latest iOS SDK (100.11).&lt;/P&gt;&lt;P&gt;I have a web map with a raster layer. I also have an area of interest, which actually is a farm lot (irregular polygon) and I would like to mask/clip the raster with that geometry so the raster is only visible for the AOI. Any ideas where to start?&lt;/P&gt;&lt;P&gt;The image would look like this one:&amp;nbsp;&lt;IMG src="https://developers.planet.com/nicfi/beginners-arcgis-pro-workflow/arcgispro_images/final.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 17:39:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1088554#M7054</guid>
      <dc:creator>JuanPeralta_ESRIES</dc:creator>
      <dc:date>2021-08-12T17:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Masking / clipping raster</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1088753#M7056</link>
      <description>&lt;P&gt;Hi Juan,&lt;/P&gt;&lt;P&gt;We are aware of this question and currently I'm drafting a reply. Runtime SDK iOS provides limited support for Raster Functions: &lt;A href="https://developers.arcgis.com/ios/layers/add-raster-data/#create-a-raster-from-a-raster-function" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/ios/layers/add-raster-data/#create-a-raster-from-a-raster-function&lt;/A&gt;&amp;nbsp;and it is possible to clip a raster with a raster function.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update 210814:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;According to our core team, currently Runtime only support&amp;nbsp;&lt;SPAN&gt;rectangular clipping. If you would like to request the &lt;EM&gt;clip raster with polygon&lt;/EM&gt; feature in the future version of Runtime, I'd like to pass along your request to&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1212"&gt;@DiveshGoyal&lt;/a&gt;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile, if you want to try out clipping with a rectangular box, here is a snippet that might help.&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;func clipRasterJSONString() {
    let rasterFunctionJSON = """
    {
      "raster_function_arguments":
      {
        "minx":{"double":2250000,"type":"Raster_function_variable"},
        "miny":{"double":-4100000,"type":"Raster_function_variable"},
        "maxx":{"double":2350000,"type":"Raster_function_variable"},
        "maxy":{"double":-3900000,"type":"Raster_function_variable"},
        "dx":{"double":100000,"type":"Raster_function_variable"},
        "dy":{"double":100000,"type":"Raster_function_variable"},
        "raster":{"name":"raster","is_raster":true,"type":"Raster_function_variable"},
        "type":"Raster_function_arguments"
      },
      "raster_function":{"type":"Clip_function"},
      "type":"Raster_function_template"
    }
    """
    let rasterFunction = AGSRasterFunction.fromJSON(rasterFunctionJSON, error: nil) as! AGSRasterFunction
    if let rasterFunctionArguments = rasterFunction.arguments {
        let rasterNames = rasterFunctionArguments.rasterNames
        rasterFunctionArguments.setRaster(raster, withName: rasterNames.first!)
        let newRaster = AGSRaster(rasterFunction: rasterFunction)
        let newRasterLayer = AGSRasterLayer(raster: newRaster)
        mapView.map?.operationalLayers.add(newRasterLayer)
    } else {
        print("Clip raster failed")
    }
}&lt;/LI-CODE&gt;&lt;P&gt;You can either define the clipping box in a local Raster Function JSON file or in a JSON string, as shown above. Then, create a new raster with the raster function and add the layer to the map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a demo app for clipping a raster. Please see the reference doc for the raster function JSON template.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;References:&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/layers/add-raster-data/#raster-functions-supported-by-arcgis-runtime" target="_blank"&gt;https://developers.arcgis.com/ios/layers/add-raster-data/#raster-functions-supported-by-arcgis-runtime&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm#ESRI_SECTION1_5A27A22F451A4DFF99B16FB6A7A0636A" target="_blank"&gt;https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm#ESRI_SECTION1_5A27A22F451A4DFF99B16FB6A7A0636A&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_raster_function.html" target="_blank"&gt;https://developers.arcgis.com/ios/api-reference/interface_a_g_s_raster_function.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Aug 2021 18:31:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1088753#M7056</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2021-08-14T18:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Masking / clipping raster</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1089691#M7058</link>
      <description>&lt;P&gt;Although it is indeed a clip, that is not the effect I am looking for.&lt;/P&gt;&lt;P&gt;Anyway, thanks for the feedback and the detailed information.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 17:54:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1089691#M7058</guid>
      <dc:creator>JuanPeralta_ESRIES</dc:creator>
      <dc:date>2021-08-17T17:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Masking / clipping raster</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1090432#M7062</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/505216"&gt;@JuanPeralta_ESRIES&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you explain the effect you &lt;EM&gt;were&lt;/EM&gt; looking for please? I thought that you were trying to clip a displayed raster to a polygon area of interest.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 15:52:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1090432#M7062</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2021-08-19T15:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Masking / clipping raster</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1091345#M7070</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/176"&gt;@Nicholas-Furness&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;the arguments for that raster function define a rectangle (min/max x/y), but I was trying to clip a raster with an irregular polygon. The idea is to clip a continuous raster (NDVI values in my case) with the farm parcel geometry, so that way you have a map like the one I included in my first post: a standard ArcGIS basemap and on top of it a raster layer with the NDVI values just for that parcel.&lt;/P&gt;&lt;P&gt;There are a number of AgTech mobile apps with this effect, but I guess they do this in the backend, actually clipping the raster and storing it for each client/farm parcel. I was trying to avoid the geoprocessing in the backend &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you want to see some real examples you can DM me.&lt;/P&gt;&lt;P&gt;What I am trying to achieve: I would like to show that ArcGIS SDKs + Living Atlas is a quick-win vs all this ad-hoc AgTech solutions, because they need to maintain quite a complex platform to acquire, store and process all those satellite datasets in the backend, while ArcGIS does most of it out-of-the-box.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the follow-up&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 18:51:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/masking-clipping-raster/m-p/1091345#M7070</guid>
      <dc:creator>JuanPeralta_ESRIES</dc:creator>
      <dc:date>2021-08-23T18:51:14Z</dc:date>
    </item>
  </channel>
</rss>

