Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Improved methodology

...

Administrative levels in boundary polygon shapefile

Required new fields in boundary polyline shapefile

Administrative level 0'AdmLevel' (integer)
Administrative levels 0 and 1

'LEFT_A0', 'RIGHT_A0' (normally text)

'AdmLevel' (integer)

Administrative levels 0, 1, and 2

'LEFT_A1', 'LEFT_A0', 'RIGHT_A0', 'RIGHT_A1' (normally text)

'AdmLevel' (integer)

Administrative levels 0, 1, 2, and 3

'LEFT_A2', 'LEFT_A1', 'LEFT_A0', 'RIGHT_A0', 'RIGHT_A1', 'RIGHT_A2' (normally text)

'AdmLevel' (integer)

Note that in the unusual case of numeric P-codes, the new fields should also be of the same typenumericThese The LEFT and RIGHT fields can be removed after the process is complete, so their names do not have to be those shown.

...

    • Optionally, click the ‘Validate Join’ button.  Do not expect all records to match - because the ‘left’ side of all exterior lines will have no neighboring polygon.  Do not worry if you receive a “Field names that match reserved words should not be used in database schema and can cause the join to fail. The following fields match reserved words….” message.  Close the 'Join Validation' dialogue box after inspecting the result.


    • Click ‘OK’
  • Begin editing the polyline shapefile
  • Open the output polyline shapefile attribute table
  • Use the Field Calculator to calculate all the LEFT_Ax values (for the LEFT_Ax files recently added to the polyline shapefile ) equal to the corresponding administrative levels of the polygon shapefile.
Administrative levels in boundary polygon shapefileRequired calculations
Administrative levels 0 and 1

polyline shapefile 'LEFT_A0 A'0 = polygon shapefile 'ADM0_PCODE'

Administrative levels 0, 1, and 2

polyline shapefile 'LEFT_A0' = polygon shapefile 'ADM0_PCODE'

polyline shapefile 'LEFT_A1' = polygon shapefile 'ADM1_PCODE'

Administrative levels 0, 1, 2, and 3

polyline shapefile 'LEFT_A0' = polygon shapefile 'ADM0_PCODE'

polyline shapefile 'LEFT_A1' = polygon shapefile 'ADM1_PCODE'

polyline shapefile 'LEFT_A2' = polygon shapefile 'ADM2_PCODE'


  • Close the attribute table, remove the join, and establish a new join basing on 'RIGHT_FID'.  Anticipate all records matching.
  • This time there should be no need to make a definition query, as there should be no null values.
  • Open the output polyline shapefile attribute table.
  • Use the Field Calculator to calculate all the RIGHT_Ax values (for the RIGHT_Ax files recently added to the polyline shapefile ) equal to the corresponding administrative levels of the polygon shapefile.
  • Create a definition query to select the line segments with different LEFT_A0 and RIGHT_A0 attributes.

...

Required calculations

...

polyline shapefile RIGHT_A0 = polygon shapefile ADM0_PCODE

...

polyline shapefile RIGHT_A0 = polygon shapefile ADM0_PCODE

polyline shapefile RIGHT_A1 = polygon shapefile ADM1_PCODE

...

polyline shapefile RIGHT_A0 = polygon shapefile ADM0_PCODE

polyline shapefile RIGHT_A1 = polygon shapefile ADM1_PCODE

polyline shapefile RIGHT_A2 = polygon shapefile ADM2_PCODE

  • Remove all joinsRemove the join.

STEP 4:  CALCULATE THE ADMINISTRATION LEVELS

...

  • Open attribute table and calculate AdminLevel = 0 for all features.  (This was probabably automaticly done by the field creation process.)  (Higher administrative level features will be adjusted later.) 
  • Create a definition query to select the line segments with different 'LEFT_A0' and 'RIGHT_A0' attributes.
  • Recall that shoreline features need to be coded especially as '99'.  If the country has a shoreline follow the SHORELINE TREATMENT steps.

SHORELINE TREATMENT

  • Open an editing session for the line shapefile.
  • Manually select line segments that represent shorelines (splitting line segments where an international border meets the water).  It may be useful to add a world country layer or neighboring country layers.

...

Explanation:   Definition query "LEFT_A0 = RIGHT_A0 and LEFT_A1 <> RIGHT_A1" will select the line features that are not administrative level 0 borders (either shorelines or international borders) but are separating administrative level 1 units.

In this map the administrative level 1 polygons are shaded to show that the lines separate administrative level 1 units.

...

  • calculate AdminLevel = 1.
  • set a definition query for LEFT_A1 = RIGHT_A1 and LEFT_A2 <> RIGHT_A2;
  • calculate AdminLevel = 2.

In this map the administrative level 1 polygons are colored to show that the lines are only inside the polygons

...