One of the desirable features for COD-AB datasets is a line shapefile with an 'admLevel' attribute field designating the administrative level of each line segment i.e., '0' representing international borders (but '99' representing coastlines), '1' representing lines between distinct administrative level 1 units, etc.  These files are necessary for the best cartographic symbology.  The alternative is to symbolize all polygon boundaries so that higher level boundaries have multiple symbols.  (Even if these are carefully disguised by symbol size and order, shorelines cannot be symbolized properly.)  ITOS makes these line shapefiles when they process your countries but if a country is not yet ITOS processed the coded line file can also be made with these instructions.

The process may be unnecessary for island or landlocked countries containing only administrative level 0 polygons.


INSERT EXAMPLE 

STEP 1:  Create the polyline shapefile. 

The goal is to create a shapefile with individual line features between nodes and left and right polygon identifiers.  (Polygon shapefile exterior features have their left polygon identified as '-1'.)  This can be performed with ArcGIS 'Advanced' license or the registered version of ET GeoWizards.

Software environmentMethodology
ArcGIS ('Advanced' license)

Run the ArcGIS ‘Polygon to Polyline’ tool (Toolbox > Data Management Tools > Features > Polygon To Line) with:  "Input Features" = (input polygon shapefile); "Output Feature Class" = (as desired); "Identify and store polygon neighboring information (optional)" selected; and all environment settings set as default.


Sample input parameters:


Sample output:

ET GeoWizards registered version

Run the Polygons TO Polylines Advanced tool

Select the 'OBJECTID' field for the 'Link field'.  Do not select 'Export points'.  With newer versions of ET GeoWizards it may be necessary to make and select a new item, with values equal to 'FID' for this purpose.



The remaining processes are completed in ArcGIS, regardless of the software environment used above.

STEP 2:  PREPARE THE P-CODE FIELDS IN THE POLYLINE SHAPEFILE


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)

'admLevell' (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 numeric.  The LEFT and RIGHT fields can be removed after the process is complete, so their names do not have to be those shown.


STEP 3:  POPULATE THE POLYLINE P-CODE FIELDS


Administrative levels in boundary polygon shapefileRequired calculations
Administrative levels 0 and 1

polyline shapefile 'LEFT_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'


Tip
Usually when the Field Calculator is re-opened during an editing session it maintains the previous calculation expression ("[tl_admbnda_adm3_who_ocha_C.adm2code]" in the above example.  Therefore is is usually only necessary to edit the administrative level number to prepare the next calculation.

STEP 4:  CALCULATE THE ADMINISTRATION LEVELS

ADMINISTRATIVE LEVEL 0

SHORELINE TREATMENT

TIP:  Displaying the input polygon shapefile can suggest the location of individual line shapefile segments, which makes them easier to select.
















TIP:  For complex cases, select and calculate the line segments in sections.  Establish line symbology that clearly distinguishes the calculated segments.



Check carefully for discontinuities

HIGHER ADMINISTRATIVE LEVELS

Administrative level 1

Set a definition query for LEFT_A0 = RIGHT_A0 and LEFT_A1 <> RIGHT_A1.  

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.

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


Explanation

International borders and shorelines



Administrative level 1 lines:



Administrative level 2 lines




Administrative level 3 lines




Related articles




Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.




Related issues








PREREQUISITE:

  • ArcGIS Desktop Advanced, OR