CREATE LOCALIZER Statement |
Some data providers do not include region data for each feature, instead region polygons are provided. The CREATE LOCALIZER statement is used to build a region description from the provided polygons. Using the localize function, this information may then be used to populate the L_REGION and R_REGION properties of a street.
CREATE LOCALIZER [NESTED] name ON col_list FROM file_list;
Note |
---|
The NESTED keyword indicates that a strict region hierarchy is present. That is, each subregion belongs in precisely one region. |
name | The name given to this localizer. This name will be used to identify the localizer when using the localize function |
col_list | A list of columns containing the names of each region |
file_list | A list of files containing the respective region geometry |
First we would create a nested localizer using the CREATE LOCALIZER statement:
CREATE LOCALIZER NESTED "myRegions" ON (%sbrb_name, %town_name, %cnty_name) FROM ("path_to\suburbs", "path_to\towns", "path_to\counties");
We would then use the localize function to populate the region fields of the street:
IMPORT STREETS { $regnames = localize("myRegions", %geom); } [ ... L_REGION 1 = $regnames[0], R_REGION 1 = $regnames[1], L_REGION 2 = $regnames[2], R_REGION 2 = $regnames[3], ... ] FROM "path_to\street_data";
Caution |
---|
The region types must be ordered most specific first when working with a localizer. In this example the suburb (smallest and most specific region type) is specified first, followed by the town and then the county. A smaller region number indicates a more specific region. |