Read shapefile metadata

View inWPFUWPFormsiOSAndroid
View on GitHub
Sample viewer app

Read a shapefile and display its metadata.

Image of read shapefile metadata

Use case

You can display information about the shapefile your user is viewing, like tags, credits, and summary.

How to use the sample

The shapefile's metadata will be displayed when you open the sample.

How it works

  1. Call ShapefileFeatureTable.OpenAsync("path_to_shapefile") to create the ShapefileFeatureTable.
  2. Get the ShapefileInfo from the feature table's Info property.
  3. Get the image from fileInfo.Thumbnail and display it.
  4. Display the Summary, Credits, and Tags properties from the shapefile info.

Relevant API

  • ShapefileFeatureTable
  • ShapefileFeatureTable.Info
  • ShapefileFeatureTable.OpenAsync
  • ShapefileInfo
  • ShapefileInfo.Credits
  • ShapefileInfo.Summary
  • ShapefileInfo.Tags
  • ShapefileInfo.Thumbnail

Offline data

Aurora Colorado Shapefiles is available as an item hosted on ArcGIS Online].

About the data

This sample uses a shapefile showing bike trails in Aurora, CO. The Aurora Colorado Shapefiles are available as an item on ArcGIS Online.

Tags

credits, description, metadata, package, shape file, shapefile, summary, symbology, tags, visualization

Sample Code

ReadShapefileMetadata.xamlReadShapefileMetadata.xaml.cs
                                         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<UserControl
    x:Class="ArcGISRuntime.WPF.Samples.ReadShapefileMetadata.ReadShapefileMetadata"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <Grid>
        <esri:MapView x:Name="MyMapView" />
        <Border Style="{StaticResource BorderStyle}" Width="300">
            <Grid x:Name="InfoPanel">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="160" />
                    <RowDefinition Height="100" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                           FontWeight="Bold" HorizontalAlignment="Center"
                           Text="{Binding Credits}" />
                <TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                           Margin="5"
                           TextWrapping="Wrap"
                           Text="{Binding Summary}" />
                <Image x:Name="ShapefileThumbnailImage"
                       Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                       Margin="5" />
                <TextBlock FontWeight="Bold" Margin="5"
                           VerticalAlignment="Center"
                           Grid.Row="3" Grid.Column="0"
                           Text="Tags:" />
                <ListBox Height="80" HorizontalAlignment="Stretch"
                         Grid.Row="3" Grid.Column="1"
                         Margin="0,5,5,0"
                         ItemsSource="{Binding Tags}" />
            </Grid>
        </Border>
    </Grid>
</UserControl>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.