Shape File Metadata

Maprosoft Shape File Metadata

Maprosoft shape file metadata is an XML format providing supplementary information about the features contained in shape files. This information helps Maprosoft to organise and present various types of features.

An outline of the XML structure is defined as follows:

<?xml version="1.0" encoding="UTF-8">
<shapeFileMetaData>
  <shapeTypeMetaData>
    <featureType>
      ...
    </featureType>
    <featureTypeConfig>
      ...
    </featureTypeConfig>
    <dbfFieldMapping>
      ...
    </dbfFieldMapping>
  </shapeTypeMetaData>
  <featureMetaData>
    <feature key="TEMPLATE">
      ...
    </feature>
    <feature key="key-1">
      ...
    </feature>
    <feature key="key-2>">
      ...
    </feature>
    .
    .
    .
    <feature key="key-n">
      ...
    </feature>
  </featureMetaData>
</shapeFileMetaData>

It may also help to view some example data showing this structure as shown in Metadata and Microformat Examples and Example Data for Maprosoft.

Sub-sections of the above structure are described in detail below.

Contents

<featureType>
<featureTypeConfig>
<dbfFieldMapping>
<featureMetaData>
<feature>

<featureType> Element

This section provides basic details about each type of feature.

  • <featureTypeName> the content of this element is used to identify the name of the features contained in the shape file. The name is also used in map controls as shown below right. This field is mandatory.
  • <shapeType> the shape type must correspond to the shape type of the shape file. The allowed values are:
    • POINT
    • POLYGON
    • POLYLINE
    This field is mandatory.
  • <areaOfInterest> This element is used to indicate if the shape file identifies the area of boundary. If this is the case, the shape file (and DBF file) should contain only a single record which is a polygon corresponding to the shape of the area of interest boundary. Maprosoft used this for display purposes (the area outside the area of interest is dulled to give greater attention to the area of interest). Maprosoft also uses this for validation when users add geographic based data to ensure the data is within the area of interest. This field value must be either 'yes' or 'no'.

<featureType> Example

The following is a simple example:

<featureType>
	<featureTypeName>
		Garbage Collection
	</featureTypeName>
	<shapeType>
		POLYGON
	</shapeType>
	<areaOfInterest>
		no
	</areaOfInterest>
</featureType>

<featureTypeConfig> Element

This section provides configuration details relating to the presentation of features relating to the shape type.

  • <groupName> feature types can be grouped together so their controls appear together. This is done by assigning the same group name to all the relevant shape types. This field is mandatory.
  • <displayOrder> the display order value is an integer identifying the order in which feature types of a single group are presented. This field is mandatory.
  • <initiallyVisible> this indicates if (in the absence of any other overriding directives) the features of this shape type should be automatically displayed. This field is mandatory.
  • <edgeColor> for shapeType POLYGON only: identifies the color of the edge of the features. Valid values are any HTML color code.
  • <edgeOpacity> for shapeType POLYGON only: identifies the opacity of the edge of the features. Valid range is 0.0 (transparent) to 1.0 (opaque).
  • <fillColor> for shapeType POLYGON only: identifies the feature fill color. Valid values are any HTML color code.
  • <fillOpacity> for shapeType POLYGON only: identifies the feature fill color opacity. Valid range is 0.0 (transparent) to 1.0 (opaque).
  • <pointIconType> for shape type POINT only: identifies an icon to use for the map marker. Valid values are listed on the Point Icons page.
  • <pointIconURL> for shape type POINT only: identifies the ULR of a custom map marker icon.

<featureTypeConfig> Example

The following is a simple example:

<featureTypeConfig>
	<groupName>
		Zones
	</groupName>
	<displayOrder>
		10
	</displayOrder>
	<initiallyVisible>
		no
	</initiallyVisible>
	<edgeColor>
		green
	</edgeColor>
	<edgeOpacity>
		0.8
	</edgeOpacity>
	<fillColor>
		green
	</fillColor>
	<fillOpacity>
		0.2
	</fillOpacity>
	<pointIconType>
		POOL
	</pointIconType>
	<pointIconURL>
		http:/www.etc
	</pointIconURL>
</featureTypeConfig>

<dbfFieldMapping> Element

This section identifies how to interpret the data in the DBF file.

  • <keyFieldName> The content of this field is used to determine how the XML elements within the <featureMetaData> element are associated with the records in the DBF file. The field content must correspond to the name of one of the DBF fields. The DBF field should contain unique values so they can be referenced unambiguously. Futhermore, the values contained in the field referenced here are used as a identifiers for the features. Maprosoft uses the 'uniqueness' of these identifiers to prevent duplicating features. For example, if the same feature is imported multiple times into Maprosoft, only the last feature will remain.
    Sometimes there is no field within the DBF file that has unique values or can be used as a key for the records. For such circumstances, the value 'Record Number' can be used. This field is mandatory.
  • <keyDelimeter> This field can be used to identify a delimeter for use when referring to DBF key fields. This allows a single <featureMetaData> element to be associated with multiple DBF records. This field is optional.
  • <nameFieldName> The content of this field is used to identify the DBF field that provides a human understandable name for each feature in the shape file. This is used by Maprosoft for presentation purposes. This field is mandatory.

<dbfFieldMapping> Examples

The following is a simple example:

<dbfFieldMapping>
	<keyFieldName>
		PARK_ID
	</keyFieldName>
	<nameFieldName>
		Name
	</nameFieldName>
</dbfFieldMapping>

The following is an example that shows the use of 'Record Number' to indicate there is no DBF field that can be used as a key:

<dbfFieldMapping>
	<keyFieldName>
		Record Number
	</keyFieldName>
	<nameFieldName>
		Name
	</nameFieldName>
</dbfFieldMapping>

<featureMetaData> Element

This section is a container for feature elements.

<feature> Element

This section allows for the ability to provide formatted data for each feature in the shape file. Each <feature> can contain any number of the elements identified in the following sections. The elements can also be repeated if, but only if it makes sense. For example, multiple contact details are often necessary, however, multiple titles are not accepted since each feature can only have one title/name.

  • <key parameter> This parameter identifies the shape file record for which the remainder of the content of this element corresponds to. Depending on the strategy chosen for the element (see the dbfFieldMapping section), the content of this parameter will either be:
    • 'TEMPLATE' to indicate the contents of the element act as a template for all features in the shape file except where overridden by an association from another key (see notes below); OR
    • the value of the DBF field referenced by the element; OR
    • the number of the record to be associated with the element.
    This field is mandatory.
  • <Feature content elements> Any of the elements contained in the following sections are allowed within the <feature> element. These elements are presented within popup windows on Maprosoft maps. This field is mandatory.
Notes:
  • The template feature allows DBF fields to be referenced using the syntax:
      {@Field DBF field name}
  • DBF field references can be embedding in other text as per the following example:
      There are {@Field NUM_COURTS} tennis courts.

<feature> Example

The following example shows three <feature> elements. The first is a template that will be used in the absense of any specific <feature> element. The second is a specific element which provides custom details for 'Central Park' and the third element provides custom details for two separate records representing 'Hyde Park'. Note also how the <title> element is used to transform the feature names into mixed case form since they are in upper case in the DBF file.

<featureMetaData>
	<feature key="TEMPLATE">
		<title>
			{@TitleCase{@Field NAME}}
		</title>
	</feature>
	<feature key="CENTRAL PARK">
		<title>
			Central Park
		</title>
	</feature>
	<feature key="HYDE PARK NORTH,HYDE PARK SOUTH">
		<title>
			Hyde Park
		</title>
	</feature>
</featureMetaData>