Do you have an application that requires mapping of complex geometries and data, such as a network of interconnected pipes, complex railroad system, lakes within islands, or mapping multiple islands, but don’t know where to start? You’ve come to the right place. These types of complex geometries are termed multipart geometries, which is a collection of simpler geometries combined to form a more complex shape.
In this blog, we will explore the concept of multipart geometries using the ArcGIS Maps SDKs for Native Apps and describe multipart geometry types, how to create them, their applications and the benefits of using them. The code snippets for this blog are written using the ArcGIS Maps SDK for Kotlin but all the concepts apply to the ArcGIS Maps SDKs for .NET, Qt, Java and Swift.
Let’s get started with some terminologies we will be using in this blog.
Feature, Geometry and Hosted table
The developer glossary defines features as a representation of a real-world object on a map. A feature will store its geographic representation, which could be a point, line, or polygon, that has both geometry (e.g. the length of the line or area of the polygon) and attribute data (e.g. the number of people, the temperature, ID number).
Geometry refers to the spatial aspects of a feature. It is used to define the shape and position of the feature.
An ArcGIS hosted table contains information about a set of geographic features. Each row represents a feature, and each column represents one feature attribute.
Shown below is highlighted demographic data of USA states in a hosted table.
What are multipart geometries?
Multipart geometries allow users to represent complex spatial features using simpler geometry types. These complex features can be composed of multiple points, lines or polygons that are combined to form a more complex shape. Multipart geometries are categorized as multipoints, multipart lines and multipart polygons, as seen in the image below.
As these geometries are composed of multiple simpler geometries grouped into one complex geometry, we can represent them as a single entry in a hosted table, rather than having multiple entries for each single geometry.
Multipoint geometry is a type of geometry which represents features that consist of clusters of points, such as weather station networks, lidar point clusters, a collection of trees in a forest or a prairie dog underground den which has multiple entry and exit points.
For example, the image below shows a collection of trees on the Esri Redlands campus. Each individual tree could be represented as a single point feature on a map, or since each tree is of the same species, each point could be represented in a multipoint geometry to represent the entire collection of trees on the campus.
In this example, choosing a single multipoint geometry (uses a single row in the database) over many single point geometries (uses many rows) has many advantages. For example, it allows efficient management and analysis of the spatial data such as location and characteristics of individual trees on the campus. In addition, calculating the density of trees in different areas of the campus or determining the distance between trees, could be performed on multipoint geometry. Such analysis helps with the campus planning and development.
The code snippet below demonstrates creating a multipoint geometry using ArcGIS Maps SDK for Kotlin. It adds a collection of trees on the Esri campus in Redlands, California. Each individual tree is a point feature which is combined to form a multipoint geometry.
⊕ Show code …
View the complete code on GitHub.
Multipart line geometry
Multipart line geometry is a type of geometry that represents a set of two or more individual line features combined to form a more complex feature. It is used to represent linear features that cannot be shown as a single line feature. These individual line features can be disconnected, which means that they do not share endpoints with adjacent line features.
An example of a multipart line geometry would be a braided river composed of multiple river channels that form part of the same river. Other examples include a complex railroad system or a pipeline network.
Shown below is an aerial image of the Brahmaputra River, Bangladesh. There are many channels forming this river, and they share the same attribute since collectively the channels/streams make up the Brahmaputra River.
The different streams that are highlighted in blue connect to the Brahmaputra River which eventually joins the Indian Ocean.
Representing this complex river system as a single multipart line geometry helps in efficient data analysis like computing the length and width of the complete river system. One can easily manage, analyze and visualize the spatial data related with the entire system, rather than having to work with individual segments of the river.
The code snippet below demonstrates creating complex multipart polylines using ArcGIS Maps SDK for Kotlin. This code creates different river streams which connect to the main river. The four river streams constituting a single river which eventually connects to the ocean are represented as one multipart polyline feature.
⊕ Show code …
View complete code on GitHub.
Multipart polygon geometry
In GIS, when a path encloses an area, it is called a ring. The ring starts and ends at the same place. A collection of one or more such rings make a polygon. A multipart polygon is composed of many such individual polygons that combine to form a complex shape. Each polygon in the multipart polygon is termed as a part, and each part has its own size and shape. They also represent areas that are completely contained within another area, like an island in a lake.
For example, agricultural fields with complex shapes and multiple sections can be represented as a multipart polygon geometry that permits the farmers to understand and analyze the agricultural output. Complex geologic formations such as mountains, ridges and canyons, can be represented as multipart polygons to help geologists analyze the structure of the Earth’s crust and its formation process.
Another example as shown in the image below, is the state of Hawaii which can be represented as a multipart polygon as it is made of eight main islands, each with its own shape and size. Hawaii can be stored as a single multipart polygon feature in the database table. This allows for a detailed and accurate representation of the state’s geography in GIS applications like land use planning or disaster response.
The code snippet below demonstrates creating complex multipart polygons by adding a couple of islands and a lake within an island on the map using ArcGIS Maps SDK for Kotlin.
⊕ Show code …
View complete code on GitHub.
Interesting Fact: Did you know that the largest lake on an island is Nettilling Lake on Baffin Island, Canada – 5,542 km2 (2,140 sq mi)? This is a perfect example of a real-world feature which we can represent using a multipart polygon.
Applications of multipart geometries
Let’s see some other real-life examples of multipart geometry.
Multipart geometries can be used to represent complex road and transportation networks, like highways with multiple lanes, ramps, and intersections, which help to analyze the connections between different parts of the network.
Complex urban features such as city blocks, neighborhoods, complex building structures can be represented as multipart geometries which help the users to understand the relationship between different city zones.
They can also be used to represent complex environmental features such as national forests, nature conservancy land, wildlife sanctuary and various water bodies which are important in environmental assessments and planning.
Benefits of multipart geometries:
Using multipart geometry over multiple individual geometries has many benefits. One of the important benefits is enhanced performance. The amount of memory required to store these geometries is reduced significantly when multiple related parts or features are stored as a single multipart geometry object, which in turn boosts the efficiency of spatial queries and analysis.
Multipart geometries help simplify data management. If a map feature consists of multiple polylines, we can store them as a single multipart polyline geometry. Which means, you only need to update a single geometry object, instead of many individual geometries. This makes it easier to update the feature and maintain its integrity.
Another benefit of multipart geometries is increased flexibility in representing complex spatial features. By representing features as a single multipart geometry, you can very easily visualize and analyze the feature as a whole, rather than treating each part as a separate feature.
In summary, using multipart geometries in your mapping applications is an efficient way of representing a wide range of complex features in geographic data. From water bodies and land masses to buildings and transportation networks, multipart geometries allow for a detailed representation of complex features, which helps in urban and town planning, environmental resource planning, and other fields.
We also showcased how the ArcGIS Maps SDK for Kotlin can be used to map such complex features. If you’re interested to know more about adding attributes to a feature, check out this sample app which creates and adds features whose attribute values satisfy a predefined set of contingencies. To learn further about the capabilities of the ArcGIS Maps SDKs for Kotlin, check out our GitHub samples code repo.
If you’re new to developing ArcGIS Maps SDKs for Native Apps, each SDK (.NET, Qt, Java, Kotlin and Swift) has rich guide documentation, API Reference, Tutorials, and samples. Simply sign up for a free ArcGIS Developer account and you’ll be able to access everything you need to develop your app.