Skip to content

Commit 7560e54

Browse files
JonLaviRachael-Etschie
authored
Sync Dev with Master (#464)
* Update readmes to match common design (analysis category) (#444) * update analyse hotspots * update distance measurement analysis * update line of sight geoelement * update line of sight location * update viewshed camera * update viewshed geoelement * update viewshed geoprocessing * update viewshed location * casing of sample names / readme headers * tap -> click * implement review changes * Apply suggestions from code review Co-Authored-By: Rachael Ellen <[email protected]> Co-authored-by: Rachael Ellen <[email protected]> * Display annotation (#442) * add sample * update metadata * better sreenshot * restore unrelated file * review comments * Update display_information/display-annotation/src/main/java/com/esri/samples/display_annotation/DisplayAnnotationSample.java Co-Authored-By: Tyler Schiewe <[email protected]> Co-authored-by: Tyler Schiewe <[email protected]> * Display annotation - fix readme (#446) * add sample * update metadata * better sreenshot * restore unrelated file * review comments * Map -> ArcGISMap * Update readmes to match common design (Editing category) (#450) * update readmes to match common design * update with review comments * Update README.md Co-authored-by: Rachael Ellen <[email protected]> Co-authored-by: Tyler Schiewe <[email protected]>
1 parent 050dadb commit 7560e54

File tree

23 files changed

+756
-191
lines changed

23 files changed

+756
-191
lines changed

analysis/analyze-hotspots/README.md

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
# Analyze Hotspots
1+
# Analyze hotspots
22

3-
Perform hotspot analysis using a geoprocessing service.
3+
Use a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.
44

5-
In this case, frequency of 911 calls in an area are analyzed.
5+
![Image of analyze hotspots](AnalyzeHotspots.png)
66

7-
![](AnalyzeHotspots.png)
7+
## Use case
8+
9+
This tool identifies statistically significant spatial clusters of high values (hot spots) and low values (cold spots). For example, a hotspot analysis based on the frequency of 911 calls within a set region.
810

911
## How to use the sample
1012

11-
Select a start and end date using the datepickers between 1/1/1998 and 5/31/1998 respectively. Click the "Analyze hotspots" button to start the geoprocessing job.
13+
Select a date range (between 1998-01-01 and 1998-05-31) from the dialog and click "Analyze Hotspots". The results will be shown on the map upon successful completion of the geoprocessing job.
1214

1315
## How it works
1416

15-
To analyze hotspots using a geoprocessing service:
16-
17-
1. Create a `GeoprocessingTask` with the URL set to the endpoint of the geoprocessing service.
18-
2. Create a query string with the date range as an input of `GeoprocessingParameters`.
19-
3. Use the `GeoprocessingTask` to create a `GeoprocessingJob` with the parameters.
20-
4. Start the job and wait for it to complete and return a `GeoprocessingResult`.
21-
5. Get the resulting `ArcGISMapImageLayer` using `geoprocessingResult.getMapImageLayer()`.
22-
6. Add the layer to the map's operational layers.
17+
1. Create a `GeoprocessingTask` with the URL set to the endpoint of a geoprocessing service.
18+
1. Create a query string with the date range as an input of `GeoprocessingParameters`.
19+
1. Use the `GeoprocessingTask` to create a `GeoprocessingJob` with the `GeoprocessingParameters` instance.
20+
1. Start the `GeoprocessingJob` and wait for it to complete and return a `GeoprocessingResult`.
21+
1. Get the resulting `ArcGISMapImageLayer` using `GeoprocessingResult.getMapImageLayer()`.
22+
1. Add the layer to the map's operational layers.
2323

2424
## Relevant API
2525

26-
* ArcGISMapImageLayer
2726
* GeoprocessingJob
2827
* GeoprocessingParameters
2928
* GeoprocessingResult
30-
* GeoprocessingString
3129
* GeoprocessingTask
30+
31+
## Tags
32+
33+
analysis, density, geoprocessing, hot spots, hotspots
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# Distance Measurement Analysis
1+
# Distance measurement analysis
22

3-
Measure distances within a scene.
3+
Measure distances between two points in 3D.
44

5-
The distance measurement analysis allows you to add the same measuring experience found in ArcGIS Pro, City Engine, and the ArcGIS API for JavaScript to your app. You can set the unit system of measurement (metric or imperial) and have the units automatically switch to one appropriate for the current scale. The rendering is handled internally so it doesn't interfere with other analyses like viewsheds.
5+
![Image of distance measurement analysis](DistanceMeasurementAnalysis.png)
66

7-
![](DistanceMeasurementAnalysis.png)
7+
## Use case
8+
9+
The distance measurement analysis allows you to add to your app the same interactive measuring experience found in ArcGIS Pro, City Engine, and the ArcGIS API for JavaScript. You can set the unit system of measurement (metric or imperial). The units automatically switch to one appropriate for the current scale.
810

911
## How to use the sample
1012

11-
Choose a unit system for the measurement in the UI dropdown. Click any location in the scene to start measuring. Move the mouse to an end location, and click to complete the measure. Clicking any new location after this will start a new measurement.
13+
Choose a unit system for the measurement. Click any location in the scene to start measuring. Move the mouse to an end location, and click to complete the measurement. Click a new location to clear and start a new measurement.
1214

1315
## How it works
1416

15-
To measure distances with the `LocationDistanceMeasurement` analysis:
16-
17-
1. Create an `AnalysisOverlay` and add it to your scene view's analysis overlay collection: `sceneView.getAnalysisOverlays().add(analysisOverlay)`.
18-
2. Create a `LocationDistanceMeasurement`, specifying the `startLocation` and `endLocation`. These can be the same point to start with. Add the analysis to the analysis overlay: `analysisOverlay.getAnalyses().add(LocationDistanceMeasurement)`. The measuring line will be drawn for you between the two points.
19-
3. The `measurementChanged` callback will fire if the distances change. You can get the new values for the `directDistance`, `horizontalDistance`, and `verticalDistance` from the `MeasurementChangedEvent` returned by the callback. The distance objects contain both a scalar value and a unit of measurement.
17+
1. Create an `AnalysisOverlay` object and add it to the analysis overlay collection of the `SceneView` object.
18+
2. Specify the start location and end location to create a `LocationDistanceMeasurement` object. Initially, the start and end locations can be the same point.
19+
3. Add the location distance measurement analysis to the analysis overlay.
20+
4. The `measurementChanged` callback will trigger if the distances change. You can get the new values for the `directDistance`, `horizontalDistance`, and `verticalDistance` from the `MeasurementChangedEvent` object returned by the callback.
2021

2122
## Relevant API
2223

2324
* AnalysisOverlay
2425
* LocationDistanceMeasurement
25-
* UnitSystem
2626

2727
## Additional information
2828

29-
The `LocationDistanceMeasurement` analysis only performs planar distance calculations. This may not be appropriate for large distances where the Earth's curvature needs to be taken into account.
29+
The `LocationDistanceMeasurement` analysis only performs planar distance calculations. This may not be appropriate for large distances where the Earth's curvature must be considered.
3030

3131
## Tags
3232

33-
Analysis, 3D
33+
3D, analysis, distance, measure
+16-11
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1-
# Line of Sight GeoElement
1+
# Line of sight geoelement
22

33
Show a line of sight between two moving objects.
44

5-
To determine if an observer can see a target, you can show a line of sight between them. The line will be green until it is obstructed, in which case it will turn red. By using the GeoElement variant of the line of sight, the line will automatically update when either GeoElement moves.
5+
![Image of line of sight geoelement](LineOfSightGeoElement.gif)
66

7-
![](LineOfSightGeoElement.gif)
7+
## Use case
8+
9+
A line of sight between `GeoElement`s (i.e. observer and target) will not remain constant whilst one or both are on the move.
10+
11+
A `GeoElementLineOfSight` is therefore useful in cases where visibility between two `GeoElement`s requires monitoring over a period of time in a partially obstructed field of view
12+
(such as buildings in a city).
813

914
## How to use the sample
1015

11-
A line of sight will display between a point on the Empire State Building (observer) and a taxi (target). The taxi will drive around a block and the line of sight should automatically update. The taxi will be highlighted when it is visibile. You can change the observer height with the slider to see how it affects the target's visibility.
16+
A line of sight will display between a point on the Empire State Building (observer) and a taxi (target).
17+
The taxi will drive around a block and the line of sight should automatically update.
18+
The taxi will be highlighted when it is visible. You can change the observer height with the slider to see how it affects the target's visibility.
1219

1320
## How it works
1421

15-
To show a line of sight between two graphics:
16-
17-
1. Create an `AnalysisOverlay` and add it to the `SceneView`'s analysis overlays collection.
18-
2. Create a `GeoElementLineOfSight`, passing in observer and target `GeoElement`s (feautures or graphics). Add the line of sight to the analysis overlay's analyses collection.
19-
3. To get the target visibility when it changes, add a `TargetVisibilityChangedListener` to the line of sight. The changed event will give the `TargetVisibility`.
22+
1. Instantiate an `AnalysisOverlay` and add it to the `SceneView`'s analysis overlays collection.
23+
2. Instantiate a `GeoElementLineOfSight`, passing in observer and target `GeoElement`s (features or graphics). Add the line of sight to the analysis overlay's analyses collection.
24+
3. To get the target visibility when it changes, react to the target visibility changing on the `GeoElementLineOfSight` instance.
2025

2126
## Relevant API
2227

2328
* AnalysisOverlay
2429
* GeoElementLineOfSight
25-
* LineOfSight.TargetVisibility
30+
* LineOfSight.getTargetVisibility
2631

2732
## Tags
2833

29-
Analysis
34+
3D, line of sight, visibility, visibility analysis
+14-10
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1-
# Line of Sight Location
1+
# Line of sight location
22

3-
Perform line of sight analysis in real-time.
3+
Perform a line of sight analysis between two points in real time.
4+
5+
![Image of line of sight location](LineOfSightLocation.gif)
6+
7+
## Use case
8+
9+
A line of sight analysis can be used to assess whether a view is obstructed between an observer and a target. Obstructing features could either be natural, like topography, or man-made, like buildings. Consider an events planning company wanting to commemorate a national event by lighting sequential beacons across hill summits or roof tops. To guarantee a successful event, ensuring an unobstructed line of sight between neighboring beacons would allow each beacon to be activated as intended.
410

511
## How to use the sample
612

7-
Click to turn on the mouse move event listener. Then move the mouse where you want the target location to be. Click again to lock the target location.
13+
The sample loads with a preset observer and target location, linked by a colored line. A red segment on the line means the view between observer and target is obstructed, whereas green means the view is unobstructed.
814

9-
![](LineOfSightLocation.gif)
15+
Click to turn on the mouse move event listener, then move the mouse to update the target location in real time. Click again to lock the target location.
1016

1117
## How it works
1218

13-
To create a line of sight and update it with the mouse:
14-
1519
1. Create an `AnalysisOverlay` and add it to the scene view.
1620
2. Create a `LocationLineOfSight` with initial observer and target locations and add it to the analysis overlay.
1721
3. Make an `EventHandler<MouseEvent>` to capture mouse movement. Turn the screen point into a scene point with `sceneView.screenToLocationAsync(screenPoint)`.
1822
4. Update the target location with `lineOfSight.setTargetLocation(scenePoint)`.
1923

2024
## Relevant API
2125

22-
* 3D
2326
* AnalysisOverlay
24-
* ArcGISTiledElevationSource
25-
* ArcGISScene
26-
* Camera
2727
* LocationLineOfSight
2828
* SceneView
29+
30+
## Tags
31+
32+
3D, line of sight, visibility, visibility analysis

analysis/viewshed-camera/README.md

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
1-
# Viewshed Camera
1+
# Viewshed camera
22

3-
Create a viewshed using the current camera viewpoint.
3+
Analyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point.
44

5-
A viewshed shows the visible and obstructed areas from an observer's vantage point.
5+
![Image of viewshed for camera](ViewshedCamera.png)
66

7-
## How to use the sample
7+
## Use case
88

9-
The sample will start with a viewshed created from the initial camera location, so only the visible (green) portion of the viewshed will be visible. Move around the scene to see the obstructed (red) portion. Click the Update from Camera button to update the viewshed to the current camera position.
9+
A viewshed analysis is a type of visual analysis you can perform on a scene. The viewshed aims to answer the question 'What can I see from a given location?'. The output is an overlay with two different colors - one representing the visible areas (green) and the other representing the obstructed areas (red).
1010

11-
![](ViewshedCamera.gif)
11+
## How to use the sample
1212

13-
## How it works
13+
The sample will start with a viewshed created from the initial camera location, so only the visible (green) portion of the viewshed will be visible. Move around the scene to see the obstructed (red) portions. Click the 'Update from Camera' button to update the viewshed to the current camera position.
1414

15-
To create and update a viewshed from a camera:
15+
## How it works
1616

17-
1. Get a `Camera` either by creating it, or by getting the current camera from the scene with `sceneView.getCurrentViewpointCamera()`.
18-
2. Create a `LocationViewshed` passing in the `Camera` plus a min/max distance.
19-
3. To update the viewshed with a new camera, use `viewshed.updateFromCamera(camera)`
17+
1. Get the current camera from the scene with `SceneView.getCurrentViewpointCamera()`.
18+
2. Create a `LocationViewshed`, passing in the `Camera` and a min/max distance.
19+
3. Update the viewshed from a camera.
2020

2121
## Relevant API
2222

23-
* 3D
2423
* AnalysisOverlay
25-
* ArcGISTiledElevationSource
2624
* ArcGISScene
2725
* ArcGISSceneLayer
26+
* ArcGISTiledElevationSource
2827
* Camera
2928
* LocationViewshed
3029
* SceneView
30+
31+
## About the data
32+
33+
The scene shows a [buildings layer in Brest, France](https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_Brest/SceneServer/layers/0) with a [local elevation source image service](https://scene.arcgis.com/arcgis/rest/services/BREST_DTM_1M/ImageServer) both hosted on ArcGIS Online.
34+
35+
## Tags
36+
37+
3D, Scene, viewshed, visibility analysis
+25-15
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
1-
# Viewshed GeoElement
1+
# Viewshed geoelement
22

3-
Attach a viewshed to an object to visualize what it sees.
3+
Analyze the viewshed for an object (GeoElement) in a scene.
44

5-
![](ViewshedGeoElement.gif)
5+
![Image of viewshed for geoelement](ViewshedGeoElement.png)
6+
7+
## Use case
8+
9+
A viewshed analysis is a type of visual analysis you can perform on a scene. The viewshed aims to answer the question 'What can I see from a given location?'. The output is an overlay with two different colors - one representing the visible areas (green) and the other representing the obstructed areas (red).
610

711
## How to use the sample
812

9-
Once the scene is done loading, click on a location for the tank to drive to. It will automatically turn and drive straight towards the clicked point. The viewshed will automatically move and rotate with the tank.
13+
Click to set a destination for the vehicle (a GeoElement). The vehicle will 'drive' towards the clicked location. The viewshed analysis will update as the vehicle moves.
1014

1115
## How it works
1216

13-
To attach a viewshed to a `GeoElement`:
17+
1. Create and show the scene, with an elevation source and a buildings layer.
18+
2. Add a model (the `GeoElement`) to represent the observer (in this case, a tank).
19+
* Use a `SimpleRenderer` which has a heading expression set in the `GraphicsOverlay`. This way you can relate the viewshed's heading to the `GeoElement` object's heading.
20+
3. Create a `GeoElementViewshed` with configuration for the viewshed analysis.
21+
4. Add the viewshed to an `AnalysisOverlay` and add the overlay to the scene.
22+
5. Configure the SceneView `OrbitGeoElementCameraController` to orbit the vehicle.
23+
24+
## About the data
1425

15-
1. Create a `Graphic` and add it to a `GraphicsOverlay`.
16-
2. Use a `SimpleRenderer` in the `GraphicsOverlay` which has a heading expression set. This way you can relate the viewshed's heading to the `GeoElement`'s heading.
17-
3. Create a `GeoElementViewshed` with the graphic, heading/pitch offsets, and min/max distance.
18-
4. To offset the viewshed's observer location from the center of the graphic, use `viewshed.setOffsetX()`, etc.
26+
This sample shows a [Johannesburg, South Africa Scene](https://www.arcgis.com/home/item.html?id=eb4dab9e61b24fe2919a0e6f7905321e) from ArcGIS Online. The sample uses a [Tank model scene symbol](http://www.arcgis.com/home/item.html?id=07d62a792ab6496d9b772a24efea45d0) hosted as an item on ArcGIS Online.
1927

2028
## Relevant API
2129

22-
* 3D
2330
* AnalysisOverlay
24-
* ArcGISTiledElevationSource
25-
* ArcGISScene
26-
* ArcGISSceneLayer
31+
* GeodeticDistanceResult
2732
* GeoElementViewshed
28-
* Graphic
29-
* SceneView
33+
* GeometryEngine.distanceGeodetic (used to animate the vehicle)
34+
* ModelSceneSymbol
35+
* OrbitGeoElementCameraController
36+
37+
## Tags
38+
39+
3D, analysis, buildings, model, scene, viewshed, visibility analysis
+20-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
# Viewshed Geoprocessing
1+
# Viewshed geoprocessing
22

3-
Calculate a viewshed against terrain using a geoprocessing service.
3+
Calculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.
44

5-
![](ViewshedGeoprocessing.png)
5+
![Image of viewshed geoprocessing](ViewshedGeoprocessing.png)
6+
7+
## Use case
8+
9+
A viewshed is used to highlight what is visible from a given point. A viewshed could be created to show what a hiker might be able to see from a given point at the top of a mountain. Equally, a viewshed could also be created from a point representing the maximum height of a proposed wind turbine to see from what areas the turbine would be visible.
610

711
## How to use the sample
812

9-
After the geoprocessing task finishes loading (the spinner will stop), click anywhere on the map to generate a viewshed at that location. A viewshed will be calculated using the service's default distance of 15km.
13+
Click the map to see all areas visible from that point within a 15km radius. Clicking on an elevated area will highlight a larger part of the surrounding landscape. It may take a few seconds for the task to run and send back the results.
1014

1115
## How it works
1216

13-
To create a viewshed from a geoprocessing service:
14-
15-
1. Create a `GeoprocessingTask` with the URL set to the viewshed endpoint of a geoprocessing service .
16-
2. Create a `FeatureCollectionTable` and add a new `Feature` whose geometry is the `Point` where you want to create the viewshed.
17-
3. Make `GeoprocessingParameters` with an input for the viewshed operation `parameters.getInputs().put("Input_Observation_Point", new GeoprocessingFeatures(featureCollectionTable))`.
18-
4. Use the `GeoprocessingTask` to create a `GeoprocessingJob` with the parameters.
19-
5. Start the job and wait for it to complete and return a `GeoprocessingResult`.
20-
6. Get the resulting `GeoprocessingFeatures` using `geoprocessingResult.getOutputs().get("Viewshed_Result")`.
21-
7. Iterate through the viewshed features in `geoprocessingFeatures.getFeatures()` to use their geometry or display the geometry in a graphic.
17+
1. Create a `GeoprocessingTask` object with the URL set to a geoprocessing service endpoint.
18+
2. Create a `FeatureCollectionTable` object and add a new `Feature` object whose geometry is the viewshed's observer `Point`.
19+
3. Make a `GeoprocessingParameters` object passing in the observer point.
20+
4. Use the geoprocessing task to create a `GeoprocessingJob` object with the parameters.
21+
5. Start the job and wait for it to complete and return a `GeoprocessingResult` object.
22+
6. Get the resulting `GeoprocessingFeatures` object.
23+
7. Iterate through the viewshed features to use their geometry or display the geometry in a new `Graphic` object.
2224

2325
## Relevant API
2426

@@ -27,4 +29,8 @@ To create a viewshed from a geoprocessing service:
2729
* GeoprocessingJob
2830
* GeoprocessingParameters
2931
* GeoprocessingResult
30-
* GeoprocessingTask
32+
* GeoprocessingTask
33+
34+
## Tags
35+
36+
geoprocessing, heat map, heatmap, viewshed

0 commit comments

Comments
 (0)