Exercise 4: Add a property

A set of feature classes and their properties is called a schema. The schema can have properties that are constrained. The constraints determine which objects you can add to a particular feature class. For example, to be added to the Roads feature class, an object must be a line. Properties are like attributes—they are characteristics of all objects in the feature class. For example, a Roads feature class property can specify the number of lanes it has, or its speed limit. The values vary, but all Roads features have a speed limit and a certain number of lanes.

You cannot change the schemas for all data source types, but you can edit the schemas for SDF files. In this lesson, you edit an SDF schema to add a property to the Roads feature class. The new property is constrained, so only certain values are valid for it.

Note: This exercise uses the map you modified in Exercise 2: Connect to the new SDF data.

Properties that are constrained to ranges of values

You can specify that only values within a particular range are valid. You can include or exclude each extreme of the range: the lowest possible value and the highest. For example, you can make a range 1 - 100 inclusive. You can specify a range of any value higher than 1 and lower than 100, but not 1 or 100. You can specify any combination.

To add a property to the Roads feature class that is constrained by range

  1. Switch the Task pane to Map Explorer.
  2. Select the SDF data source at the top of the pane.
  3. Click SchemaEdit Schema.

    Edit the SDF schema.

  4. In the Schema Editor, expand the schema tree on the left to see the three feature classes.
  5. Select the Roads feature class.
  6. Click New Property at the top of the window.

    Property1 appears on the left, under the existing properties.

  7. Specify the characteristics of the new property using the information shown in this illustration:

    Create a property with these values. The last four fields appear after setting the Constraint Type.

    These values create a property that represents the number of lanes for a road. The value must be a whole number from 1 through 5, inclusive. There is no default value for this property.

    By setting Min Value Included and Max Value Included to true, the highest and lowest values in the range are acceptable entries.

  8. Click Apply and confirm your changes.

    The "Property1" entry on the left is updated to show the new name.

  9. Click OK and confirm your changes to close the Schema Editor.

To continue this tutorial, go to Exercise 5: Populating the new properties with values.