Quantcast
Channel: OpenCities Map Wiki
Viewing all articles
Browse latest Browse all 1284

Creating a Domain List in Microsoft SQL Server Spatial or Oracle Spatial

$
0
0
Revision 6 posted to Bentley Map - Wiki by Inga Morozoff on 11/22/2017 4:37:07 PM

Introduction


The products used for this article are:

  • Bentley Map Enterprise (SELECTseries4)
  • Microsoft SQL Server Spatial 2008 R2

By default, the registering features from of an Oracle or MSSQL spatial table will define properties as Text Properties. To enhance this, the Bentley Map provides the ability to identify lookup tables in the database and use them as XFM domain lists. This way, properties can be defined as pick lists.

In the following example, the creek attribute Flow will be created as a picklist with three possible values: Ephemeral, Intermittent and Perennial.


 

Configuring database tables for use as domain list is a two-step process.

  • Create a lookup a lookup table, and
  • Define a foreign key to define the relationship between the lookup table and the parent table.

  

 

Step 1 – Create Lookup Table

First, a lookup table needs to be either created or be present in the database. The following creates a new table called Creek_Flow_LUT with a single column named CreekFlow that is also set as the primary key:


Create table Creek_Flow_LUT

(CreekFlow varchar(36) constraint CreekFlow Primary Key);

 

Step 2 - Populate with values

The table is then populated with values that will be displayed in the pick list. In this case, those values are Ephemeral, Intermittent and Perennial.

Insert into CreekFlow_LUT (Flow)

values  ('Ephemeral'),  ('Intermittent'),  ('Perennial');

 

Step 3 – Add a Foreign Key

Then, a foreign key is added to formalize the relationship between the lookup table named Creek_Type_LUT and the parent table named Creeks

 

alter table Creeks

add constraint creek_fk

foreign key (Flow)

references creek_flow_lut(CreekFlow);

 

Step 4 – Register Features in Bentley Geospatial Administrator

With the lookup table and the foreign key in place, the foreign key relationship will be acknowledged by Bentley Geospatial Administrator when the feature is registered.

Ensure that you register both Spatial and Non-spatial features. 

As a consequence, the feature’s property will be of type ComboBox,

 

A domain list entry will be added to the schema and be populated with the values specified in the lookup table.



 

Ensure that the Value and Edit Col Name fields are specified. If incorrect, the values may display in the Place or Edit dialog in an open Bentley Map session.

 

Step 5 – Verify in Bentley Map

Lastly, update the features metadata, export and run the workspace. When done correctly, the lookup table will display as a picklist when placing or editing the feature.


 

 

Creating-a-Domain-List-in-Microsoft-SQL-Server-Spatial-or-Oracle-Spatial.pdf

Tags: Interoperability, SQL Server, Bentley Map

Viewing all articles
Browse latest Browse all 1284

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>