#  This macro thins verticies & snaps to straight frame, templates & adj maps
#  The "+t" indicates that it snaps to TEMPLATES  

# clear graphics & display entire map
graphics 
view zoom 0 0

# create set 22 containing the map border polygon
crit_clear
crit_type  16
crit_exec  22  map border polygon

# create set 21, segments which make up the map border polygon
crit_type  1
crit_subel  22
crit_exec  21  segments on map border

# create set 20, all segments
crit_type 1
crit_exec 20 all segments

# create set 19, all segments not on map border
set_exclude 20 21 19 segments NOT on map border

# create set 18, nodes on the map border polygon 
crit_type  0
crit_subel  22
crit_exec  18  nodes on the map border

# clear graphics
graphics
view zoom 0 0

# thin verticies not on border using a radius of 1.1  pixels
vertex_thin  19  0  1.100000  0

#  snap all map-type objects (set 0) to all data on levels 85-87 (templates)
level_snap  0  85  87  2.500000  0  3

# snap set 22 to straight line map frame (level 33) adding verticies as needed.
level_snap  22  33  33  2.500000  0  3

# thin map border verticies using a radius of 0.01 pixels
# (this eliminates verticies on a line)
vertex_thin  22  0  0.010000  0

#  snap all nodes of the map border polygon to the adjacent maps.
level_snap  18  88  91  3.000000  0  4

# thin verticies to eliminate verticies on straight lines
vertex_thin  0  2  0.05  0

#  now, display the map vectors in 'normal' & adjacent maps in 'highlight'
view map 0 0
graphics 
graphics +n0 +h85 +h86 +h87 +h88 +h89 +h90 +h91 
veiw map

#  finally, inform the user of the deprivations to which s/he has be subjected
wait Map data has been thinned, snapped to the FRAME, ADJ. MAPS, & TEMPLATE(S). 
wait Manually CHECK FOR MISMATCHES, CORRECT the RASTER & RE-ASSEMBLE IF NECESSARY.
