ArcGIS Maps SDK for .NET Samples

repository·main·Indexed 19 days ago

https://github.com/esri/arcgis-maps-sdk-dotnet-samples

Interactive sample applications for the ArcGIS Maps SDK for .NET, demonstrating mapping capabilities across WPF, WinUI, and .NET MAUI platforms. Includes implementations for spatial querying using FeatureTable, 3D analysis tools like ExploratoryLocationLineOfSight and ExploratoryLocationViewshed, and distance measurements via ExploratoryLocationDistanceMeasurement.

Tokens
325.2K
Snippets
468
Records
1.6K
Agent score
62%

What's inside arcgis-maps-sdk-dotnet-samples

  1. Manage and Query Data in ArcGIS Maps SDK for .NET (WinUI)

    main

    The WinUI samples demonstrate various data management and querying workflows:

    Data Creation and Editing

    • Feature Management: Create, update, delete, and manage features in a layer. This includes using Feature Forms for attribute editing and Contingent Values to ensure attribute validity.
    • Geodatabase Operations: Create mobile geodatabases, manage geodatabase transactions, and generate local replicas from online feature services. Support for Branch Versioning allows editing specific server versions.
    • Attachments and Related Data: Edit feature attachments (add, delete, download) and list features related to a selected feature.

    Data Formats and Sources

    • GeoPackage: Add rasters and feature tables from a GeoPackage.
    • KML: Create and preview KML multi-tracks from location data.
    • Shapefiles: Read shapefile metadata and apply custom symbology.
    • Point Clouds: View local 3D point cloud data offline.

    Querying and Statistics

    • SQL and Arcade: Find features using SQL queries or complex Arcade expressions.
    • Statistical Queries: Retrieve aggregated statistics for specific fields, including grouping and sorting results.
  2. Perform Analysis tasks in ArcGIS Maps SDK for .NET (MAUI)

    main

    The SDK provides various analysis capabilities for spatial data within MAUI applications. Key analysis tasks include:

    • Map Algebra: Apply operations to elevation rasters to floor, mask, or categorize values into discrete integer categories.
    • Distance Measurement: Measure 3D distances between two points.
    • Feature Queries: Count features matching a query or determine the extent of features within the current visible area.
    • Line of Sight: Perform exploratory line of sight analysis between moving geoelements or static points.
    • Viewshed Analysis: Analyze visible and obstructed areas from various vantage points, including cameras in a scene, specific GeoElements, or defined points. This can be done interactively using an analysis overlay.
  3. Validate utility network topology

    main

    This sample demonstrates the workflow for retrieving the state of a utility network and validating its topology. It is used to manage 'dirty areas'—regions where feature edits have not yet been evaluated against network rules. Validating the network ensures consistency between feature data and topology, preventing errors or inaccurate results during tracing.

    Workflow Summary

    1. Get State: Check if validation is required or if tracing is currently available.
    2. Validate: Update the network topology to clear dirty areas.
    3. Trace: Execute a trace once the network is in a valid state.
    4. Edit: Select features, modify attributes (using CodedValueDomain.CodedValues), and apply edits to the server.
  4. Perform Geometry Operations in ArcGIS Maps SDK for .NET (WinUI)

    main

    The WinUI samples cover a wide range of geometric computations and manipulations:

    Spatial Operations

    • Basic Operations: Perform union, intersection, or difference operations between two geometries.
    • Spatial Relationships: Determine the spatial relationship between two geometries.
    • Buffer and Clip: Create buffers around points (individual or unioned) and clip geometries using other geometries.
    • Convex Hull: Generate a convex hull (the shortest perimeter polygon enclosing a set of points) for single or multiple input geometries.

    Geometry Manipulation

    • Creation and Editing: Use the Geometry Editor to create or edit points, multipoints, polylines, or polygons. This includes Snapping edits to existing geometries.
    • Transformation: Project points between different spatial references or coordinate systems using specific transformations.
    • Densification and Generalization: Add interpolated points at regular intervals (densify) or simplify multipart geometries while preserving shape (generalize).
    • Cutting: Cut a geometry along a polyline.

    Advanced Geometry Tasks

    • Geodesic Operations: Calculate geodesic paths and measure distances between points.
    • Vertex and Coordinate Tools: Find the nearest vertex to a point, format coordinates in various notations, and use a Programmatic Reticle Tool for customized editing workflows.
  5. Execute Geoprocessing tasks in ArcGIS Maps SDK for .NET (MAUI)

    main

    Geoprocessing allows you to run complex spatial tasks via services:

    • Hotspot Analysis: Use geoprocessing services and feature sets to identify statistically significant hot spots and cold spots.
    • Geodatabase Management: Connect to services to list available geodatabase versions.
    • Viewshed via Geoprocessing: Calculate viewsheds using a geoprocessing service (e.g., determining visibility across mountainous terrain).
  6. Perform Geometry operations in ArcGIS Maps SDK for .NET (MAUI)

    main

    The SDK provides comprehensive geometry processing tools:

    • Creation and Editing: Use the Geometry Editor to create or edit points, multipoints, polylines, and polygons. This includes programmatic reticle tools for custom workflows and snapping tools to align edits to existing geometries.
    • Spatial Operations: Perform buffering (individual or unioned lists), clipping, cutting (along a polyline), and spatial relationship determinations (union, intersection, difference).
    • Advanced Geometry: Generate convex hulls (enclosing polygons), densify (add vertices at intervals), or generalize (simplify) multipart geometries.
    • Transformations and Projections: Project geometries between spatial references, use specific transformation steps, and format coordinates into various notations.
    • Calculations: Perform geodesic operations (path calculation and distance measurement) and find the nearest vertex of a geometry to a point.
  7. Manage Graphics Overlays in ArcGIS Maps SDK for .NET (WinUI)

    main

    The WinUI samples provide techniques for displaying and animating graphics:

    Rendering and Symbology

    • Symbol Styles: Display graphics using specific symbol styles.
    • Renderers: Use a Renderer to change the style of all graphics in an overlay by referencing a single symbol style (this affects graphics that do not have their own specified style).
    • Dictionary Renderer: Create graphics from an XML file using key-value pairs (e.g., displaying military symbols using MIL-STD-2525D).

    Animation and Placement

    • 3D Animation: Animate a graphic's position and rotation using an OrbitGeoElementCameraController to follow the object.
    • Surface Placement: Position graphics relative to a surface using various surface placement modes.
    • Scene Expressions: Update a graphic's orientation dynamically using expressions based on its attributes.

    Interaction

    • Identify Graphics: Implement logic to display alert messages when a graphic is clicked.
  8. Manage GraphicsOverlay and visual elements in ArcGIS Maps SDK for .NET (MAUI)

    main

    Use GraphicsOverlay to manage visual elements on a map or scene:

    • Rendering: Use a renderer to change the style of all graphics in an overlay by referencing a single symbol style. You can also use dictionary renderers (e.g., for MIL-STD-2525D military symbols) to create graphics from XML data.
    • Graphic Interaction: Identify graphics by responding to click events and animate 3D graphics using an OrbitGeoElementCameraController to follow moving objects.
    • Placement and Orientation: Position graphics relative to surfaces using different surface placement modes, and update graphic orientation using attribute-based expressions.
  9. Find service areas for multiple facilities

    main
    This sample demonstrates how to calculate and display service areas for multiple facilities retrieved from a feature service. A service area is a region accessible from a facility within specific constraints like travel time, distance, or cost. This workflow is useful for identifying coverage gaps or overlaps to optimize facility distribution.
  10. Manage and manipulate spatial Data in ArcGIS Maps SDK for .NET (MAUI)

    main

    The SDK supports a wide range of data management and manipulation tasks:

    • Feature Management: Create, update, delete, and sync features. This includes using feature forms for editing, managing feature attachments, and using branch versioning for server geodatabase edits.
    • Data Formats: Work with GeoPackages (rasters and feature tables), KML multi-tracks, Shapefiles (reading metadata and applying symbology), and Mobile Geodatabases.
    • Querying: Perform SQL queries on feature layers, use Arcade expressions for querying, and execute statistical queries (including grouping and sorting) to get aggregated field statistics.
    • Offline Capabilities: Generate geodatabase replicas from feature services, manage geodatabase transactions, and view point cloud data offline.
    • Relational Data: List features related to a selected feature and handle contingent values that satisfy predefined attribute sets.