Skip to content

[New] Show geodesic sector and ellipse #648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: v.next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Samples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@
88FB70D92DD3DFA800EB76E3 /* AddOpenStreetMapLayerView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = 88FB70D72DD3DF3700EB76E3 /* AddOpenStreetMapLayerView.swift */; };
9501BBEF2DF39DAB0054F4BD /* SetFeatureLayerRenderingModeOnSceneView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9501BBEE2DF39DA50054F4BD /* SetFeatureLayerRenderingModeOnSceneView.swift */; };
9503056E2C46ECB70091B32D /* ShowDeviceLocationUsingIndoorPositioningView.Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9503056D2C46ECB70091B32D /* ShowDeviceLocationUsingIndoorPositioningView.Model.swift */; };
951961AC2E00BC420088B0C2 /* ShowGeodesicSectorAndEllipseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 951961AB2E00BC3C0088B0C2 /* ShowGeodesicSectorAndEllipseView.swift */; };
951961AE2E00BD430088B0C2 /* SetMapImageLayerSublayerVisibilityView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = 95813E382DF88FD000342CBF /* SetMapImageLayerSublayerVisibilityView.swift */; };
9525404E2DF904BA004090B9 /* SetFeatureLayerRenderingModeOnSceneView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = 9501BBEE2DF39DA50054F4BD /* SetFeatureLayerRenderingModeOnSceneView.swift */; };
9529D1942C01676200B5C1A3 /* SelectFeaturesInSceneLayerView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = 954AEDED2C01332600265114 /* SelectFeaturesInSceneLayerView.swift */; };
Expand All @@ -330,6 +331,7 @@
95F3A52B2C07F09C00885DED /* SetSurfaceNavigationConstraintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95F3A52A2C07F09C00885DED /* SetSurfaceNavigationConstraintView.swift */; };
95F3A52D2C07F28700885DED /* SetSurfaceNavigationConstraintView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = 95F3A52A2C07F09C00885DED /* SetSurfaceNavigationConstraintView.swift */; };
95F891292C46E9D60010EBED /* ShowDeviceLocationUsingIndoorPositioningView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95F891282C46E9D60010EBED /* ShowDeviceLocationUsingIndoorPositioningView.swift */; };
95FFEB442E06211B00543993 /* ShowGeodesicSectorAndEllipseView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = 951961AB2E00BC3C0088B0C2 /* ShowGeodesicSectorAndEllipseView.swift */; };
D70082EB2ACF900100E0C3C2 /* IdentifyKMLFeaturesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D70082EA2ACF900100E0C3C2 /* IdentifyKMLFeaturesView.swift */; };
D70082EC2ACF901600E0C3C2 /* IdentifyKMLFeaturesView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D70082EA2ACF900100E0C3C2 /* IdentifyKMLFeaturesView.swift */; };
D7010EBF2B05616900D43F55 /* DisplaySceneFromMobileScenePackageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7010EBC2B05616900D43F55 /* DisplaySceneFromMobileScenePackageView.swift */; };
Expand Down Expand Up @@ -721,6 +723,7 @@
dstPath = "";
dstSubfolderSpec = 7;
files = (
95FFEB442E06211B00543993 /* ShowGeodesicSectorAndEllipseView.swift in Copy Source Code Files */,
88FB70D92DD3DFA800EB76E3 /* AddOpenStreetMapLayerView.swift in Copy Source Code Files */,
951961AE2E00BD430088B0C2 /* SetMapImageLayerSublayerVisibilityView.swift in Copy Source Code Files */,
9525404E2DF904BA004090B9 /* SetFeatureLayerRenderingModeOnSceneView.swift in Copy Source Code Files */,
Expand Down Expand Up @@ -1179,6 +1182,7 @@
88FB70D72DD3DF3700EB76E3 /* AddOpenStreetMapLayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddOpenStreetMapLayerView.swift; sourceTree = "<group>"; };
9501BBEE2DF39DA50054F4BD /* SetFeatureLayerRenderingModeOnSceneView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetFeatureLayerRenderingModeOnSceneView.swift; sourceTree = "<group>"; };
9503056D2C46ECB70091B32D /* ShowDeviceLocationUsingIndoorPositioningView.Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowDeviceLocationUsingIndoorPositioningView.Model.swift; sourceTree = "<group>"; };
951961AB2E00BC3C0088B0C2 /* ShowGeodesicSectorAndEllipseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowGeodesicSectorAndEllipseView.swift; sourceTree = "<group>"; };
9537AFD62C220EF0000923C5 /* ExchangeSetwithoutUpdates */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ExchangeSetwithoutUpdates; sourceTree = "<group>"; };
9547085B2C3C719800CA8579 /* EditFeatureAttachmentsView.Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditFeatureAttachmentsView.Model.swift; sourceTree = "<group>"; };
954AEDED2C01332600265114 /* SelectFeaturesInSceneLayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectFeaturesInSceneLayerView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1771,6 +1775,7 @@
D722BD1E2A420D7E002C2087 /* Show extruded features */,
1C7B861B2DFB4EAF00B267EA /* Show extruded graphics */,
88129D782DD5034B001599A5 /* Show geodesic path between two points */,
951961AD2E00BC760088B0C2 /* Show geodesic sector and ellipse */,
00ABA94B2BF671FC00C0488C /* Show grid */,
D751017D2A2E490800B8FA48 /* Show labels on layer */,
1C293D562DD53523000B0822 /* Show labels on layer in 3D */,
Expand Down Expand Up @@ -2682,6 +2687,14 @@
path = "Set feature layer rendering mode on scene";
sourceTree = "<group>";
};
951961AD2E00BC760088B0C2 /* Show geodesic sector and ellipse */ = {
isa = PBXGroup;
children = (
951961AB2E00BC3C0088B0C2 /* ShowGeodesicSectorAndEllipseView.swift */,
);
path = "Show geodesic sector and ellipse";
sourceTree = "<group>";
};
9537AFC82C220ECB000923C5 /* 9d2987a825c646468b3ce7512fb76e2d */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -4376,6 +4389,7 @@
D77BC5392B59A2D3007B49B6 /* StylePointWithDistanceCompositeSceneSymbolView.swift in Sources */,
D7084FA92AD771AA00EC7F4F /* AugmentRealityToFlyOverSceneView.swift in Sources */,
D75B58512AAFB3030038B3B4 /* StyleFeaturesWithCustomDictionaryView.swift in Sources */,
951961AC2E00BC420088B0C2 /* ShowGeodesicSectorAndEllipseView.swift in Sources */,
0072C8002DBAF08D001502CA /* AddItemsToPortalView.swift in Sources */,
E0D04FF228A5390000747989 /* DownloadPreplannedMapAreaView.Model.swift in Sources */,
88129D7A2DD5035A001599A5 /* ShowGeodesicPathBetweenTwoPointsView.swift in Sources */,
Expand Down
39 changes: 39 additions & 0 deletions Shared/Samples/Show geodesic sector and ellipse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Show geodesic sector and ellipse

Create and display geodesic sectors and ellipses.

![Image of show geodesic sector and ellipse](show-geodesic-sector-and-ellipse.png)

## Use case

Geodesic sectors and ellipses can be used in a wide range of analyses ranging from projectile landing zones to antenna coverage. For example, given the strength and direction of a cellular tower's signal, you could generate cell coverage geometries to identify areas without sufficient connectivity.

## How to use the sample

The geodesic sector and ellipse will display with default parameters at the start. Click anywhere on the map to change the center of the geometries. Adjust any of the controls to see how they affect the sector and ellipse on the fly.

## How it works

To create a geodesic sector and ellipse:

1. Create GeodesicSectorParameters and GeodesicEllipseParameters using one of the constructors with default values or using each setter individually.
2. Set the center, axisDirection, semiAxis1Length, and the semiAxis2Length properties to change the general ellipse position, shape, and orientation.
3. Set the sectorAngle and startDirection angles to change the sector's shape and orientation.
4. Set the maxPointCount and maxSegmentLength properties to control the complexity of the geometries and the approximation of the ellipse curve.
5. Specify the geometryType to either POLYGON, POLYLINE, or MULTIPOINT to change the result geometry type.
6. Pass the parameters to the related static methods: GeometryEngine.ellipseGeodesic(geodesicEllipseParameters) and GeometryEngine.sectorGeodesic(geodesicSectorParameters). The returned value will be a Geometry of the type specified by the geometryType parameter.

## Relevant API

GeodesicEllipseParameters
GeodesicSectorParameters
GeometryEngine
GeometryType

## Additional information

To create a circle instead of an ellipse, simply set semiAxis2Length to 0.0 and semiAxis1Length to the desired radius of the circle. This eliminates the need to update both parameters to the same value.

## Tags

ellipse, geodesic, geometry, sector
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"category": "Layers",
"description": "Create and display geodesic sectors and ellipses.",
"ignore": false,
"images": [
"show-geodesic-sector-and-ellipse.png"
],
"keywords": [
"ellipse",
"geodesic",
"geometry",
"sector",
"GeodesicEllipseParameters",
"GeodesicSectorParameters",
"GeometryEngine",
"GeometryType"
],
"redirect_from": [],
"relevant_apis": [
"GeodesicEllipseParameters",
"GeodesicSectorParameters",
"GeometryEngine",
"GeometryType"
],
"snippets": [
"ShowGeodesicSectorAndEllipseView.swift"
],
"title": "Show geodesic sector and ellipse"
}
Loading
Loading