Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

One of the desirable features for COD-AB datasets is a line shapefile with codes 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 so that, for instance, they avoid an administrative level 2 boundary symbol appearing along an international border.  ITOS makes these line shapefiles when they process your countries but if you are not yet ITOS processed you can also make them yourself with these instructions 

Step-by-step guide

Load the input polygon shapefile ArcMap

  • Create the polyline shapefile, either with ArcGIS Advanced or ET GeoTools.
    • ArcGIS Advanced option (option 1 of 2):
      • 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

...

PREREQUISITE:

...

Image Added

The output polyline shapefile will have the fields:

    • FID
    • Shape*

    • LEFT_FID
    • RIGHT_FID
    • ET GeoWizard

...

    • option (two steps) (option 2 of 2):
      • Step 1:  Run the ‘Polygon to Polyline’ tool

Image Added

Image Added

This will create lines that close all polygons - one line per polygon.


Step 2:  Run the ‘Clean PolyLine Layer’ tool

Image Added

Image Added

  • Add the following fields to the output polyline shapefile:
    • LEFT_A2, LEFT_A1, LEFT_A0, RIGHT_A0, RIGHT_A1, RIGHT_A2 (if the input polygon shapefile is administrative level 3), with the field type (typically TEXT) and length being compatible with the input polygon shapefile administrative level 3 P-code field.  Note that the necessary fields correspond to the administrative levels above the input polygon shapefile.  
    • AdminLevel or similar, type integer
  • Open the output polyline shapefile properties, select the ‘Joins & Relates’ tab, and add a join as follows:
    • What do you want to join to this layer? = Join attributes from a table
    • Choose the field in this layer that the join will be based on: = LEFT_FID
    • Choose the table to join to this layer, or load the table from disk:  = (the input polygon shapefile)
    • Choose the field in the table to base the join on = OBJECTID
    • (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
    • Click ‘OK’
  • Set a definition query to exclude the ‘NULL’ values of the input polygon shapefile.  (This might refer to a .FID or a .OBJECTID)

Image Added


  • Open the output polyline shapefile attribute table
  • Use the Field Calculator to calculate the LEFT_A2 = adm2code, that is, each LEFT_A2 value will be made equal to the adm2code of the joined input polygon shapefile feature.

Image Added

  • Similarly LEFT_A1 = adm1code, and LEFT_A0 = adm0code.
  • 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 the RIGHT_A2 = adm2code, RIGHT_A1 = adm1code, and RIGHT_A0 = adm0code.

Image Added

Image Added

  • calculate AdminLevel = 0
  • 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.

Image Added

Image Added

Image Added

Image Added

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

Image Added













Image Added




  • calculate AdminLevel  = 99.

Image Added

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

Image AddedImage Added


Image Added


Check carefully for discontinuities

Image Added

Image Added

  • Set a definition query for LEFT_A0 = RIGHT_A0 and LEFT_A1 <> RIGHT_A1; calculate AdminLevel  = 1.

Image Added

Explanation:   LEFT_A0 = RIGHT_A0 and LEFT_A1 <> RIGHT_A1 will find the lines that not administrative level 0 borders (either shorelines or international borders) but are separating administrative level 1 units

Image Added

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

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

Image Added

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


Set a definition query for LEFT_A2 = RIGHT_A2; calculate AdminLevel  = 3.

Explanation

Image Added

International borders and shorelines



Image Added

Administrative level 1 lines:



Image Added

Administrative level 2 lines




Image Added

Administrative level 3 lines









Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@c6fd2f8f
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "imtoolbox"
labelskb-how-to-article

...

Page Properties
hiddentrue



Related issues








Info

PREREQUISITE:

  • ArcGIS Desktop Advanced, OR