English

Problem: An example of MAPPROJECTION and NEATLINE commands

Solution or Workaround

Description:

A tutorial AML that uses NEATLINE commands.
/* GENERIC_NEATLINE.AML
/*
/* PURPOSE:
/* CREATES/DISPLAYS A POLYGON COVERAGE OF MONTANA IN A UTM
/* PROJECTION USING MAPPROJECTION AND DISPLAYS VARIOUS
/* NEATLINE COMMANDS.
/*
/* ARGUMENTS:
/* COVER - THE OUTPUT COVER NAME
/*
/* NOTES:
/* 1) DATA IS NOT REQUIRED TO RUN THIS AML. ALL DATA FOR AML
/* IS GENERATED ON THE FLY.
/* 2) THE MAPPROJECTION SEQUENCE IS GEOGRAPHIC > UTM.
/* 3) NEATLINE/NEATLINETIC COMMANDS DISPLAY IN UTM PROJECTION.
/* 4) NEATLINEGRID/NEATLINEHATCH/NEATLINELABELS DISPLAY IN
/* GEOGRAPHIC
/*
/*============================DISCLAIMER================================
/*You may use, copy, modify, merge, distribute, alter, reproduce and/or
/*create derivative works of this AML for your own internal use. All
/*rights not specifically granted herein are reserved to ESRI.
/*
/*THIS AML IS PROVIDED "AS-IS" WITHOUT WARRANTY OF ANY KIND, EITHER
/*EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
/*WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
/*WITH RESPECT TO THE AML.
/*
/*ESRI shall not be liable for any damages under any theory of law
/*related to your use of this AML, even if ESRI is advised of the
/*possibilites of such damage. This AML is not supported by ESRI.
/*======================================================================
&severity &warning &ignore
&severity &error &routine exit.aml

&args cover
/*&echo &on

/* PATHS, VARIABLES, ECT...
/*
&if [null %cover%] &then
&return Usage: &run generic_neatline <outcover>
&sv mapproj geo2utm
&sv nline1 geo
&sv nline2 utm

/* CLEANUP
/*
/*&if [exists %cover% -cover] &then kill %cover% all
/*&if [exists %mapproj% -file] &then [delete %mapproj% -file]
/*&if [exists %nline1% -file] &then [delete %nline1% -file]
/*&if [exists %nline2% -file] &then [delete %nline2% -file]

/* CREATING TEST COVERAGE IN GEO PROJECTION
/*
generate %cover%
polygon
17 -110.208755 47.057896
-116.062500 48.999996
-114.728333 49.000000
-114.062500 49.000000
-113.662323 49.000000
-113.625000 48.993095
-113.594849 49.000004
-112.187500 48.999996
-111.281876 49.000000
-110.750000 49.000000
-109.500000 48.999996
-108.250000 48.999996
-107.187500 48.999996
-106.125000 48.999996
-105.062500 48.999996
-104.062500 49.000000
-104.062500 49.000000
-104.051826 48.645798
-104.051620 48.390995
-104.047935 48.000061
-104.046822 47.400002
-104.045441 47.333817
-104.046951 46.642937
-104.046219 46.542530
-104.047348 46.280876
-104.048416 45.942993
-104.048416 45.942993
-104.049026 45.883053
-104.043358 45.212887
-104.042580 44.997818
-104.059349 44.997349
-104.059349 44.997349
-105.041260 45.001091
-105.084465 44.999832
-106.020576 44.997227
-106.258644 44.996174
-107.893715 44.999813
-108.258568 45.000160
-108.624573 44.997643
-109.798653 44.999580
-109.994789 45.002853
-110.392006 44.998688
-110.428894 44.992348
-111.052650 44.995766
-111.050842 44.664562
-111.050789 44.473396
-111.050789 44.473396
-111.093857 44.486198
-111.128143 44.500832
-111.133583 44.527977
-111.169464 44.545261
-111.177986 44.564926
-111.218727 44.573246
-111.233452 44.602638
-111.219017 44.618057
-111.223190 44.626984
-111.269882 44.642288
-111.269424 44.673878
-111.294884 44.683014
-111.314690 44.705269
-111.318436 44.727940
-111.349190 44.726254
-111.371521 44.745163
-111.384171 44.737770
-111.394295 44.708946
-111.442841 44.713257
-111.474632 44.702240
-111.480011 44.691494
-111.459900 44.670101
-111.457474 44.652634
-111.469376 44.640789
-111.506897 44.637768
-111.500954 44.616051
-111.513733 44.593277
-111.492111 44.551270
-111.462036 44.550022
-111.458534 44.538002
-111.481781 44.536224
-111.489449 44.528778
-111.566437 44.552948
-111.604454 44.543072
-111.684067 44.550835
-111.716202 44.533844
-111.766121 44.518909
-111.791809 44.518547
-111.807037 44.504066
-111.871696 44.556351
-111.939575 44.549812
-111.977005 44.529762
-112.022797 44.535130
-112.026260 44.522930
-112.058548 44.528698
-112.099075 44.518318
-112.123367 44.528339
-112.198830 44.531536
-112.216934 44.538582
-112.229568 44.559578
-112.255844 44.560059
-112.281509 44.541790
-112.341675 44.525188
-112.339745 44.497269
-112.366753 44.449360
-112.419922 44.449375
-112.457687 44.468925
-112.501007 44.463089
-112.538490 44.477589
-112.652351 44.480892
-112.713486 44.497025
-112.732872 44.484409
-112.779022 44.474010
-112.795387 44.458099
-112.825851 44.421173
-112.817871 44.394909
-112.816559 44.364292
-112.843437 44.353729
-112.869942 44.370068
-112.886467 44.392941
-112.937439 44.407280
-112.984406 44.435627
-113.011169 44.437801
-113.005814 44.452702
-113.019463 44.481861
-113.006866 44.510696
-113.036972 44.533043
-113.038811 44.556377
-113.082184 44.582764
-113.053436 44.624371
-113.072289 44.675606
-113.098099 44.695995
-113.100845 44.715252
-113.126572 44.737457
-113.137413 44.761517
-113.239471 44.811916
-113.256287 44.810562
-113.317810 44.780304
-113.339760 44.779076
-113.349152 44.807644
-113.420502 44.833775
-113.444695 44.851315
-113.495308 44.930744
-113.486465 44.939648
-113.462532 44.940849
-113.447884 44.949596
-113.440147 44.998268
-113.457970 45.027523
-113.454552 45.043423
-113.485420 45.058395
-113.489273 45.071293
-113.519722 45.082138
-113.509338 45.107910
-113.551384 45.107624
-113.573486 45.117786
-113.570694 45.134621
-113.593208 45.149818
-113.600037 45.181068
-113.644699 45.206867
-113.689224 45.262360
-113.687813 45.277866
-113.738182 45.321609
-113.740410 45.382465
-113.774124 45.410252
-113.784760 45.445713
-113.768265 45.477787
-113.771400 45.507133
-113.780029 45.516945
-113.832809 45.514988
-113.802849 45.583809
-113.821579 45.600716
-113.851120 45.609642
-113.902397 45.613571
-113.901291 45.637333
-113.922623 45.655205
-113.925789 45.671291
-113.963234 45.679459
-113.970238 45.697456
-114.008560 45.686413
-114.018967 45.672459
-114.010078 45.652592
-114.017120 45.640854
-114.055603 45.625225
-114.082054 45.586460
-114.117226 45.571209
-114.131134 45.550465
-114.171753 45.544006
-114.193893 45.528000
-114.241081 45.535374
-114.246964 45.503029
-114.261322 45.485943
-114.325516 45.457508
-114.349327 45.463467
-114.370537 45.485825
-114.418129 45.499092
-114.432632 45.527718
-114.461784 45.547932
-114.495667 45.546734
-114.526466 45.558277
-114.559998 45.548824
-114.540031 45.596481
-114.563751 45.624355
-114.500816 45.652477
-114.509781 45.674141
-114.496635 45.694485
-114.534050 45.723080
-114.541031 45.746082
-114.562614 45.762482
-114.516449 45.810150
-114.498238 45.842766
-114.472878 45.839550
-114.442307 45.852703
-114.406601 45.846535
-114.391914 45.870968
-114.412605 45.910732
-114.428535 45.921558
-114.404366 45.954060
-114.411522 45.972054
-114.483528 45.989887
-114.473602 46.009846
-114.493393 46.023491
-114.464828 46.050896
-114.455101 46.082310
-114.476440 46.107437
-114.505638 46.116222
-114.518013 46.136143
-114.508682 46.157497
-114.466087 46.155342
-114.439949 46.169048
-114.438622 46.220333
-114.471901 46.243862
-114.472862 46.253040
-114.430862 46.284790
-114.408859 46.392990
-114.396080 46.399624
-114.383087 46.428257
-114.409775 46.487450
-114.359528 46.506203
-114.349174 46.517467
-114.342377 46.587959
-114.323769 46.622917
-114.333740 46.654305
-114.383072 46.661674
-114.440590 46.645794
-114.483772 46.623653
-114.539444 46.637970
-114.609879 46.629128
-114.643791 46.660904
-114.644089 46.671001
-114.624977 46.687187
-114.672935 46.734802
-114.697479 46.733841
-114.747154 46.695213
-114.781967 46.703121
-114.776878 46.755798
-114.793076 46.766613
-114.839836 46.775620
-114.865646 46.797127
-114.901367 46.799515
-114.947449 46.852528
-114.939606 46.890968
-114.923164 46.907246
-114.963768 46.925293
-115.000610 46.958889
-115.036369 46.963081
-115.054672 46.973438
-115.080368 47.026604
-115.134537 47.063629
-115.147713 47.091820
-115.171524 47.097649
-115.192101 47.124104
-115.295258 47.179626
-115.324249 47.245224
-115.342682 47.255096
-115.407227 47.263668
-115.425659 47.274448
-115.500946 47.281719
-115.522079 47.292057
-115.554535 47.334686
-115.598549 47.370075
-115.637794 47.380116
-115.665489 47.399239
-115.749336 47.422546
-115.749115 47.434036
-115.731491 47.445374
-115.655098 47.449249
-115.642197 47.457863
-115.639153 47.475304
-115.691780 47.489609
-115.700531 47.520962
-115.741837 47.533760
-115.691093 47.590790
-115.697289 47.616150
-115.733070 47.639950
-115.732666 47.695625
-115.774727 47.709805
-115.789536 47.744911
-115.835739 47.756355
-115.848320 47.805256
-115.868805 47.827526
-115.902916 47.841148
-115.936836 47.867199
-115.997925 47.925217
-116.024307 47.965015
-116.052483 47.976269
-116.054497 48.208549
-116.055679 48.498726
-116.062500 48.999996
END
END
quit
&echo &off

/* CREATING PROJECTION FILE(GEO2UTM.PRJ) FOR MAPPROJECTION COMMAND.
/*
/* OPEN FILE
&sv fileunit = [OPEN %mapproj%.prj openstat -WRITE]
&if %openstat% <> 0 &then &do
&type Unable to open file for writing
&delvar fileunit
&end

/* WRITE FILE
/*
&s line1 'input'
&s line2 'projection geographic'
&s line3 'units dd'
&s line4 'datum nad27'
&s line5 'parameters'
&s line6 'output'
&s line7 'projection utm'
&s line8 'units meters'
&s line9 'datum nad27'
&s line10 'zone 11'
&s line11 'parameters'
&s line12 'end'

&do i = 1 &to 12
&s line [value line%i%]
&ty %line%
&s writestat [write %fileunit% %line%]
&end

/*CLOSE FILE
/*
&sv closestat = [CLOSE %fileunit%]

/* CREATING PROJECTION FILE(GEO.PRJ) FOR NEATLINE COMMANDS.
/*
/* OPEN FILE
&sv fileunit = [OPEN %nline1%.prj openstat -WRITE]
&if %openstat% <> 0 &then &do
&type Unable to open file for writing
&delvar fileunit
&end

/* WRITE FILE FOR GEOGRAPHIC PROJECTION
/*
&s line1 'projection geographic'
&s line2 'units dd'
&s line3 'datum nad27'
&s line4 'parameters'

&do i = 1 &to 4
&s line [value line%i%]
&ty %line%
&s writestat [write %fileunit% %line%]
&end

/*CLOSE FILE
/*
&sv closestat = [CLOSE %fileunit%]

/* CREATING PROJECTION FILE(UTM.PRJ) FOR NEATLINE COMMANDS.
/*
/* OPEN FILE
&sv fileunit = [OPEN %nline2%.prj openstat -WRITE]
&if %openstat% <> 0 &then &do
&type Unable to open file for writing
&delvar fileunit
&end

/*
/*
/* WRITE FILE FOR UTM PROJECTION
/*
&s line1 'projection utm'
&s line2 'units meters'
&s line3 'zone 11'
&s line4 'datum nad27'
&s line5 'parameters'

&do i = 1 &to 5
&s line [value line%i%]
&ty %line%
&s writestat [write %fileunit% %line%]
&end

/*CLOSE FILE
/*
&sv closestat = [CLOSE %fileunit%]

build %cover%
build %cover% line

/* ARCPLOT
/*
ap
display 9999

/* SYMBOL SETS
/*
shadeset colornames
lineset color

/* PAGE LAYOUT
/*
map junk1.map
mape %cover%
pagesize 20 20
box .5 .5 19.5 19.5
/*mapangle 450

/* MAPPROJECTION
/**ALWAYS USE THE MAPEXTENT COMMAND(AGAIN) 'AFTER' THE MAPPROJECTION COMMAND IS USED.**
/*
mapprojection %mapproj%.prj
mape %cover%

clipmapextent off
mapposition cen cen
maplimits 1 1 19 19

/* FEATURE DISPLAY
/*
polygonshades %cover% 76
linesym 1
arclines %cover% 8
move 10.5 10.5
text 'Montana' cc

/* NEATLINE COMMANDS(EXCLUDING NEATLINELABELS)
/*
linecolor 2
neatline mapextent %nline2%.prj /*(DISPLAYS IN COLOR RED)
linecolor 4
neatlinegrid 1 1 %nline1%.prj /*(DISPLAYS IN COLOR BLUE)
linecolor 1
neatlinehatch .5 .5 .1 0 %nline1%.prj /*(DISPLAYS IN COLOR WHITE OR BLACK
DEPENDING ON CANVAS COLOR)
linecolor 7
neatlinetics 100000 100000 .1 %nline2%.prj /*(DISPLAYS IN COLOR YELLOW)

/* NEATLINELABLES DISPALY IN COLOR GREEN
/*
/* NEATLINELABELS FOR BOTTOM
/*
textset font.txt
textsymbol 1
textsize .075
textcolor green
textjustification uc
textoffset 0 -.1
textstyle typeset
neatlinelabels .5 bottom all %nline1%.prj dd

/* NEATLINELABELS FOR LEFT
/*
textset font.txt
textsymbol 1
textsize .075
textcolor green
textjustification cr
textoffset -.05 0
neatlinelabels .5 left all %nline1%.prj dms

/* NEATLINELABELS FOR TOP
/*
textset font.txt
textsymbol 1
textsize .075
textcolor green
textjustification lc
textoffset 0 .1
neatlinelabels .5 top all %nline1%.prj dms

/* NEATLINELABELS FOR RIGHT
/*
textset font.txt
textsymbol 1
textsize .075
textcolor green
textjustification cl
textoffset .1 0
textstyle typeset
neatlinelabels .5 right all %nline1%.prj DMS '%1%!pat1628;%2%!pat7255;%3%!pat7256;'

&ty
&ty THE MAP COMPOSITION WILL CEASE ONCE <RETURN> IS PRESSED. UNTIL THEN, THE PLOT
&ty CAN BE ZOOMED INTO/OUT OF TO SEE NEATLINE FEATURES AT LARGER SCALE.
&pause

map end
killmap junk1.map

&return

/* EXIT ROUTINE
&routine exit.aml
&severity &error &ignore
&ty [close -all]
&echo &off
&return &error 'an error has been encountered.'