Process narrative: Converting structure images from scanned USGS 7.5' quadrangle maps to GIS features



 

I.  Process summary

    1.  Processing by Full Pixel Search
    2.  Editing to remove non-structure elements
    3.  Importing to ArcInfo
            name changes
            wold files
            importing to grid
            connversion of image values
    4.  Production of point coverage
            regiongroup
            zonalcentroid
            gridpoint
    5.  Producing updated taxlot coverage
            intersecting points with taxlot coverage
            resulting point coverage attributes
            joining point coverage with taxlot coverage to indicate presence of at least one FPS structure image
    6.  Combing structure point coverages
    7.  Creating structure center and structure 2ac. zone grids
 

II. Process details

    The process consists of five steps:

    1.  Running the tolower.awk script
    2.  Running the fps.aml script
    3.  Running the apnd.aml script
    4.  Running the tlupd.aml script
    5.  Running the struct.aml script
 

    1.  Changing image file names

     The names of the image files as they are produced by the editing phase contain capital letters, which render them unreadable by the ArcInfo IMAGEGRID command, for example:  O44123A3.TIF, and the corresponding world file: O44123A3.TFW.  An gawk script, tolower.awk is used to convert
all upper case letters to lower, and move the files to a working directory.  A file containing the names
of the files to be processed is created first, one for the image files, another for their world files.  The -m option of the ls command separates the names with commas:
# tolower.awk
# MUST USE *GAWK* NOT AWK !
# uses input file 'names' produced by, e.g.: ls -m *.tif > names
# e.g.: gawk -f tolower.awk names

  BEGIN {RS = ","}
  {
    newname = tolower($1)
    system ("mv " $1 " " "fps/"newname)
    print newname
  }


  2.  Importing and processing

 1.   The next phase of processing converts the FPS structure patches into vector points, one point coverage for each source image, using the script fps.aml at the arc prompt.  The important issues in this process are:
 handling the fact that image patches representing structures may be coded either as zero within a non-zero background, or as a range of non-zero values within a zero background - 'flattened' vs. unflattened imagesavoiding duplication of structures due to overlap at map sheet image margins - clips each image's structure centroid points to quad sheet boundariesestablishing the correct cell size and geographic window for each gridded map sheet imagefiltering out small noise patchesgenerating a point coverage from the centroids of each structure patchremoving patch points from within Urban Growth Boundaries
  /*  processes FPS images  */
 

&s cnt = [filelist *.tif newtifs -file] /* make list of images
&if %cnt% <= 0 &then
  &return Error generating list file
&s listf = [open newtifs ok -read]
&s datf = [open fps.dat ok -write]
&s rec = [date -ufull]
&s wstat = [write %datf% %rec%]
&do indx = 1 &to %cnt%
  &s imgfile = [read %listf% ok]
  &s img = [before %imgfile% .]
  imagegrid %imgfile% %img%  /* import
  grid
    &s skip = 0
    &type Making binary grid %img%b
    buildvat %img%
    setcell %img%
    setwindow %img% %img%
    &type Inverting values
    &describe %img%
    /* make binary grid
    &if %GRD$NCLASS% = 1 &then &do
      &s rec = [quote %img% skipped, only one value present: %GRD$ZMAX%]
      &s wstat = [write %datf% %rec%]
      &skip = 1
    &end
    &if %skip% = 1 &then &goto skip
    &if %GRD$NCLASS% = 2 AND %GRD$MEAN% gt .90 &then
    &do
      %img%tmp = con (%img%b == 0, 1, 0)
      &s rec = [quote %img% has structures = 255]
      &s wstat = [write %datf% %rec%]
      &type Reversing %img%, structures = 255
      kill %img%b all
      %img%b = %img%tmp
      kill %img%tmp all
    &end
    &if %GRD$NCLASS% = 2 &then   /* flattened image
      &type %img% has two values
      %img%b = con (%img% == 0, 1, 0)
    &if %GRD$NCLASS% > 2 &then   /* unflattened
      %img%b = con ((%img% > 0 AND %img% < 255), 1, 0)
    &describe %img%b
    %img%bn = setnull (%img%b == 0, 1)  /* make background null
    &type Regiongroup
    %img%rg = regiongroup (%img%bn, #, eight, #, #, nolink)  /* unique value for each structure
    &describe %img%rg
    &s pfnpatches = %GRD$ZMAX%
    /* filter out small patches:
    /* delete any patch whose area <= 2 cells (13 sq m)
    &type Filtering
    %img%a = int (zonalarea (%img%rg))
    %img%al = con (%img%a > 13, %img%rg, 0)
    &type Zonalcentroid
    %img%zc = zonalcentroid (%img%al) /* center cell of each structure
    &describe %img%al
    &s npatches = %GRD$NCLASS%
    &type Point coverage
    %img%p = gridpoint (%img%zc)  /* point coverage
    &type  %img%p created
    /* logs completions in fps.dat
    &describe %img%p
    &s rec = [quote %img%p created with %DSC$POINTS% features from %npatches%/%pfnpatches% filtered/orig. patches]
    &s wstat = [write %datf% %rec%]
    kill %img% all
    kill %img%a all
    kill %img%al all
    kill %img%b all
    kill %img%bn all
    kill %img%rg all
    kill %img%zc all
    &label skip
  quit
&end

&s tot = [calc %indx% - 1]
&s rec = [quote %tot% images processed]
&s wstat = [write %datf% %rec%]

&s rec = [date -ufull]
&s wstat = [write %datf% %rec%]

&s cstat = [close %listf%]
&s cstat = [close %datf%]
 

2.   These point coverages are then appended to a single coverage by the script apnd.aml.  In the first step, it clips from image map sheet's set of sturcture center points, only those that lie within the quadrangle.  This eliminates the duplicates in the zone of overlap at the margins of the scanned images.

/*  writes and runs a script for appending
/*  point coverages
 

&s cnt = [filelist * pfiles -cover -point]
&if %cnt% <= 0 &then
  &return Error generating list file
&s apndf = apndr.aml
&s scrptf = [open %apndf% ok -write]
&if %ok% <> 0 &then &do
  &ty %ok%
  &return Error opening script file %apndf%
&end
&s listf = [open pfiles ok -read]
&s rec = [quote &s datf = [quote [open apnd.dat ok -write]]]
&s wstat = [write %scrptf% %rec%]

&s rec = append spoints point all
&s wstat = [write %scrptf% [quote %rec%]]
&do indx = 1 &to %cnt%
  &s fnm = [read %listf% ok]

  /* trim points to quadrangle limits */
  &s lat = [substr %fnm% 2 2]
  &s lon = [substr %fnm% 4 3]
  &s blk = [substr %fnm% 7 2]
  &s ohioc = %blk%%lat%%lon%

  reselect quadso %ohioc%
  [quote resel DATA = [quote [upcase %ohioc%]]]

  n
  n
  build %ohioc%

  clip %fnm% %ohioc% %fnm%c point
  build %fnm%c point
  &s rec = %fnm%c
  &s wstat = [write %scrptf% %rec%]

  kill %fnm% all
  kill %ohioc% all
  &type %fnm%c created
&end
&s rec = END
&s wstat = [write %scrptf% %rec%]
&s rec = [quote build spoints point]
&s wstat = [write %scrptf% %rec%]

&s rec = [quote &s wstat = [write %datf% [quote spoints built]]]
&s wstat = [write %scrptf% %rec%]]
&s rec = [quote &s cstat = [close %datf%]]
&s wstat = [write %scrptf% %rec%]

&s cstat = [close %scrptf%]
&s cstat = [close %listf%]

&r %apndf%


3.    County by county, taxlot records are updated for those taxlots containing at least one FPS structure point using the tlupd.aml script:

/*  updates taxlot coverages with FPS points  */

/* benton

intersect spoints bentonr bentp point
additem bentp.pat bentp.pat fps 2 2 B
&data tables
  sel bentp.pat
  calculate fps = 1
  quit
&end
joinitem bentonr.pat bentp.pat bentonr.pat bentonr-id isedescr

/* clackamas

intersect spoints clackr clackp point
additem clackp.pat clackp.pat fps 2 2 B
&data tables
  sel clackp.pat
  calculate fps = 1
  quit
&end
joinitem clackr.pat clackp.pat clackr.pat clackr-id isedescr

/* lane

intersect spoints lanetl lanep point
additem lanep.pat lanep.pat fps 2 2 B
&data tables
  sel lanep.pat
  calculate fps = 1
  quit
&end
joinitem laner.pat lanep.pat lanetl.pat lanetl-id isedescr

/* linn

intersect spoints linn linnp point
additem linnp.pat linnp.pat fps 2 2 B
&data tables
  sel linnp.pat
  calculate fps = 1
  quit
&end
joinitem linn.pat linnp.pat linn.pat linn-id isedescr
 

/* marion

intersect spoints marion marionp point
additem marionp.pat marionp.pat fps 2 2 B
&data tables
  sel marionp.pat
  calculate fps = 1
  quit
&end
joinitem marion.pat marionp.pat marion.pat marion-id isedescr
 

/* metro
 

/* polk

intersect spoints polk polkp point
additem polkp.pat polkp.pat fps 2 2 B
&data tables
  sel polkp.pat
  calculate fps = 1
  quit
&end
joinitem polk.pat polkp.pat polk.pat polk-id isedescr

4.  Using the struct.aml, a grid of FPS structure center points is made at 30m.  The point coverage is buffered out to a two acre zone and then gridded at 30m.