Skip to content

Commit 40e6f5d

Browse files
committed
Add initial files.
1 parent f66f42d commit 40e6f5d

File tree

4 files changed

+106
-0
lines changed

4 files changed

+106
-0
lines changed

Samples.xcodeproj/project.pbxproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@
393393
D7705D5B2AFC246A00CC0335 /* FindClosestFacilityToMultiplePointsView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7705D552AFC244E00CC0335 /* FindClosestFacilityToMultiplePointsView.swift */; };
394394
D7705D642AFC570700CC0335 /* FindClosestFacilityFromPointView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7705D612AFC570700CC0335 /* FindClosestFacilityFromPointView.swift */; };
395395
D7705D662AFC575000CC0335 /* FindClosestFacilityFromPointView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7705D612AFC570700CC0335 /* FindClosestFacilityFromPointView.swift */; };
396+
D771D0C82CD55211004C13CB /* ApplyRasterRenderingRuleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D771D0C22CD55211004C13CB /* ApplyRasterRenderingRuleView.swift */; };
397+
D771D0C92CD5522A004C13CB /* ApplyRasterRenderingRuleView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D771D0C22CD55211004C13CB /* ApplyRasterRenderingRuleView.swift */; };
396398
D7749AD62AF08BF50086632F /* FindRouteInTransportNetworkView.Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7749AD52AF08BF50086632F /* FindRouteInTransportNetworkView.Model.swift */; };
397399
D77570C02A2942F800F490CD /* AnimateImagesWithImageOverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77570BF2A2942F800F490CD /* AnimateImagesWithImageOverlayView.swift */; };
398400
D77570C12A2943D900F490CD /* AnimateImagesWithImageOverlayView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D77570BF2A2942F800F490CD /* AnimateImagesWithImageOverlayView.swift */; };
@@ -581,6 +583,7 @@
581583
dstPath = "";
582584
dstSubfolderSpec = 7;
583585
files = (
586+
D771D0C92CD5522A004C13CB /* ApplyRasterRenderingRuleView.swift in Copy Source Code Files */,
584587
D751B4CB2CD3E598005CE750 /* AddKMLLayerWithNetworkLinksView.swift in Copy Source Code Files */,
585588
D70789952CD1611E000DF215 /* ApplyDictionaryRendererToGraphicsOverlayView.swift in Copy Source Code Files */,
586589
D7F2A0302CD00F400008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift in Copy Source Code Files */,
@@ -1025,6 +1028,7 @@
10251028
D76EE6062AF9AFE100DA0325 /* FindRouteAroundBarriersView.Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindRouteAroundBarriersView.Model.swift; sourceTree = "<group>"; };
10261029
D7705D552AFC244E00CC0335 /* FindClosestFacilityToMultiplePointsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindClosestFacilityToMultiplePointsView.swift; sourceTree = "<group>"; };
10271030
D7705D612AFC570700CC0335 /* FindClosestFacilityFromPointView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindClosestFacilityFromPointView.swift; sourceTree = "<group>"; };
1031+
D771D0C22CD55211004C13CB /* ApplyRasterRenderingRuleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplyRasterRenderingRuleView.swift; sourceTree = "<group>"; };
10281032
D7749AD52AF08BF50086632F /* FindRouteInTransportNetworkView.Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindRouteInTransportNetworkView.Model.swift; sourceTree = "<group>"; };
10291033
D77570BF2A2942F800F490CD /* AnimateImagesWithImageOverlayView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimateImagesWithImageOverlayView.swift; sourceTree = "<group>"; };
10301034
D77572AD2A295DDD00F490CD /* PacificSouthWest2 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = PacificSouthWest2; sourceTree = "<group>"; };
@@ -1260,6 +1264,7 @@
12601264
D7F2A02C2CD00F1C0008D981 /* Apply dictionary renderer to feature layer */,
12611265
D70789912CD160FD000DF215 /* Apply dictionary renderer to graphics overlay */,
12621266
955AFAC52C10FD74009C8FE5 /* Apply mosaic rule to rasters */,
1267+
D771D0C52CD55211004C13CB /* Apply raster rendering rule */,
12631268
004A2BA12BED456500C297CE /* Apply scheduled updates to preplanned map area */,
12641269
D75362CC2A1E862B00D83028 /* Apply unique value renderer */,
12651270
1C8EC7422BAE2891001A6929 /* Augment reality to collect data */,
@@ -2585,6 +2590,14 @@
25852590
path = "Find closest facility from point";
25862591
sourceTree = "<group>";
25872592
};
2593+
D771D0C52CD55211004C13CB /* Apply raster rendering rule */ = {
2594+
isa = PBXGroup;
2595+
children = (
2596+
D771D0C22CD55211004C13CB /* ApplyRasterRenderingRuleView.swift */,
2597+
);
2598+
path = "Apply raster rendering rule";
2599+
sourceTree = "<group>";
2600+
};
25882601
D77570BC2A29427200F490CD /* Animate images with image overlay */ = {
25892602
isa = PBXGroup;
25902603
children = (
@@ -3430,6 +3443,7 @@
34303443
1C2538562BABACFD00337307 /* AugmentRealityToNavigateRouteView.swift in Sources */,
34313444
1C2538572BABACFD00337307 /* AugmentRealityToNavigateRouteView.ARSceneView.swift in Sources */,
34323445
D76929FA2B4F79540047205E /* OrbitCameraAroundObjectView.swift in Sources */,
3446+
D771D0C82CD55211004C13CB /* ApplyRasterRenderingRuleView.swift in Sources */,
34333447
79D84D132A81711A00F45262 /* AddCustomDynamicEntityDataSourceView.swift in Sources */,
34343448
102B6A372BFD5B55009F763C /* IdentifyFeaturesInWMSLayerView.swift in Sources */,
34353449
E000E7602869E33D005D87C5 /* ClipGeometryView.swift in Sources */,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2024 Esri
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import ArcGIS
16+
import SwiftUI
17+
18+
struct ApplyRasterRenderingRuleView: View {
19+
@State private var map = Map(basemapStyle: .arcGISTopographic)
20+
21+
var body: some View {
22+
MapView(map: map)
23+
}
24+
}
25+
26+
#Preview {
27+
ApplyRasterRenderingRuleView()
28+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Apply raster rendering rule
2+
3+
Display a raster on a map and apply different rendering rules to that raster.
4+
5+
![Image of apply raster rendering rule](ApplyRasterRenderingRule.png)
6+
7+
## Use case
8+
9+
Raster images whose individual pixels represent elevation values can be rendered in a number of different ways, including representation of slope, aspect, hillshade, and shaded relief. Applying these different rendering rules to the same raster allows for a powerful visual analysis of the data. For example, a geologist could interrogate the raster image to map subtle geological features on a landscape, which may become apparent only through comparing the raster when rendered using several different rules.
10+
11+
## How to use the sample
12+
13+
Run the sample and use the drop-down menu at the top to select a rendering rule.
14+
15+
## How it works
16+
17+
1. Create an `ImageServiceRaster` using a URL to an online image service.
18+
2. After loading the raster, use `imageServiceRaster.getServiceInfo().getRenderingRuleInfos()` to get a list of `RenderingRuleInfo` supported by the service.
19+
3. Choose a rendering rule info to apply and use it to create a `RenderingRule`.
20+
4. Create a new `ImageServiceRaster` using the same URL.
21+
5. Apply the rendering rule to the new raster using `imageServiceRaster.setRenderingRule(renderingRuleInfo)`.
22+
6. Create a `RasterLayer` from the raster for display.
23+
24+
## Relevant API
25+
26+
* ImageServiceRaster
27+
* RasterLayer
28+
* RenderingRule
29+
30+
## About the data
31+
32+
This raster image service contains 9 LAS files covering Charlotte, North Carolina's downtown area. The lidar data was collected in 2007. Four Raster Rules are available for selection: None, RFTAspectColor, RFTHillshade, and RFTShadedReliefElevationColorRamp.
33+
34+
## Additional information
35+
36+
Image service rasters of any type can have rendering rules applied to them; they need not necessarily be elevation rasters. See the list of [raster function objects](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) and syntax for rendering rules in the *ArcGIS REST API* documentation.
37+
38+
## Tags
39+
40+
raster, rendering rules, visualization
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"category": "Visualization",
3+
"description": "Display a raster on a map and apply different rendering rules to that raster.",
4+
"ignore": false,
5+
"images": [],
6+
"keywords": [
7+
"raster",
8+
"rendering rules",
9+
"visualization",
10+
"ImageServiceRaster",
11+
"RasterLayer",
12+
"RenderingRule"
13+
],
14+
"redirect_from": [],
15+
"relevant_apis": [
16+
"ImageServiceRaster",
17+
"RasterLayer",
18+
"RenderingRule"
19+
],
20+
"snippets": [
21+
"ApplyRasterRenderingRuleView.swift"
22+
],
23+
"title": "Apply raster rendering rule"
24+
}

0 commit comments

Comments
 (0)