图层显示地图或场景中的地理数据。地图和场景是图层和表的容器。表是数据的来源;表中的地理数据可以由某些类型的图层使用。Runtime支持多种类型的图层。
A layer displays geographic data in a map or scene. Maps and scenes are containers for layers and tables. A table is a source of data; geographic data in tables can be consumed by some types of layers. Runtime supports many types of layers.
图层在你的地图中有两种角色:
- 基础地图图层(Basemap layers )provide context for the information in your map. For example, the imagery or street map backgrounds on consumer mapping services are basemaps.
- 操作图层(Operational layers): contain the primary content of the map. For example, a layer with all of the gas stations nearby would be an operational layer.
在Runtime中图层能够被当作操作图层或者基础地图图层,你可以灵活地使用图层。图层定义信息如何显示。它们可以使用来自表、本地文件或远程服务的数据。如果只需要在地图上放置点,或者使用没有底层模型(underlying model)的临时数据,那么可以考虑使用图形(graphic)。
一、Layer
1、常见的图层属性
所有的图层都支持以下常见特性:
- Name — a human-readable name
- Description — a human-readable description of the layer's content
- Extent — the geographic area that contains the layer's content
- Spatial reference — defines how coordinates should be interpreted. See Spatial references for more information.
- Visibility — lets you hide or show the layer without removing it from the map.
- Scale range — controls layer visibility based on how far the user has zoomed into the map using the MinScale and MaxScale properties.
- Opacity
2、为地图选择图层
当为应用程序选择图层类型时,可以考虑以下问题:
- Do users need to compare data with a time component?
- Do users have an always-on internet connection?
- Do users need to be able to query, analyze, or select data?
- Do users need to be able to edit layer content
- Do you or your users need control over the style (colors, fill patterns, icons, etc.) of the layer?
- Does your app need to interoperate with other systems or ArcGIS Portal?
(1)选择基础地图图层
基础地图是地图的基础,为数据提供背景,定义地图整体风格。选择正确的基础地图能够:
- Align your map with your brand
- Help tell your story
- Make your map layers and graphics easier to see and understand
- Make your app feel like a part of your user's Geographic Information System (GIS) when your app connects to portal
在ArcGIS Online上有许多有吸引力的基础地图。如果您正在创建编辑或浏览体验,您的用户可能已经习惯于通过门户使用某些基础地图。此外,您可以在用户的ArcGIS门户中获得一组功能基本地图,也可以发布您自己的基础地图或自定义现有矢量基础地图的样式。
补充:
下图归纳了ArcGIS Runtime 支持的图层类型以及各个图层支持的数据源、渲染方案等信息,具体如下:
3、时态感知(Time-aware)图层
虽然所有图层都支持地理信息,但是时间感知图层也支持时间信息。当一个图层支持时间,你可以:
- 根据时间过滤图层内容
- 使用时间偏移量比较数据
4、Image adjustment layers
Image adjustment layers allow you to change brightness, contrast, and gamma for imagery. See Layer types described for more information
5、图层性能考虑
(1)矢量&栅格数据
矢量和栅格数据是展示和管理地理数据的两种主要格式。
- Vector — data is described by points, lines, and polygons (vectors). The client renders the vector content into raster images for display on the device.
- Raster — data is transmitted via pre-rendered images; the client doesn't have information about the underlying features that were rendered into the image.
因为矢量图层是在设备上呈现的,所以它们总是非常适合客户端显示的大小和分辨率。矢量数据也非常小,非常适合离线或在低带宽环境中使用。矢量不适合表示来自栅格源(如卫星图像)的数据。
一些基础地图结合栅格和矢量数据,例如:ArcGIS Online的world images with streets (vector) 基础地图使用栅格切片图层作为图像,矢量图层作为要素和标注。这确保了显示栅格图像时,要素和标注总是清晰的。
(2)动态和切片图层
服务可以采用两种方法之一来提供数据。
- Dynamic — Generate a map for each request based on information provided by the client, like desired image size & extent.
- Tiled — Generate tiles ahead of time, then serve them as needed by the client.
因为动态地图是根据需要生成的,所以它们更适合于具有经常更改的数据的地图。动态地图的缺点是它们需要更多的服务器资源——渲染地图图像是一项昂贵的操作。对于不经常更改的内容,切片服务更合适。
二、表(Tables)
Tables provide a source of data that can be worked with directly, or perhaps displayed in a feature layer. Tables in ArcGIS define a schema for features – a consistent set of fields that features are expected to have. Tables can have many features. Entries in spatial tables can have geometries. Tables can come from several sources:
- Shapefiles
- Geopackages
- Maps
- Feature services
- Geodatabases
表的功能:
- Queried
- Edited (depending on the source)
- Shown in a feature layer
- Taken offline
补充:Non-spatial tables
Non-spatial tables are just like other tables, except they don't have a geometry column. Because they don't have geometry, they can't be rendered in a layer. Although non-spatial tables can't be rendered, they can still be added to maps as data sources for querying. Features (entries) in spatial tables can be related to the features in non-spatial tables. Non-spatial tables are represented by the same Runtime types as spatial tables.
1、Table performance concepts
A table might have hundreds of thousands of features. How your app requests features from the table is a performance-critical decision.
When working with tables that come from a service (rather than a local file), feature request modes control how often features are retrieved and how they are cached. There are three feature request modes:
- On interaction cache (default)
- Manual cache
- On interaction, no cache
参考链接:
https://developers.arcgis.com/android/latest/guide/layers.htm
https://developers.arcgis.com/android/latest/guide/layer-types-described.htm