Error: Two angles expected At line ###

Solution or Workaround


MIFSHAPE returns a message like this:

Error: Two angles expected
Pen (1,2,0)
At line ###

When the conversion is complete, portions of the data are missing.


The cause is a variance with the published MIF standard for the ARC command. ARC is a PLINE command that describes literal arcs, circles or portions of circles. The published standard for the ARC command is two coordinate pairs followed by two angles on the next line. However, some MIFs may be written with the coordinates and the angles on the same line. For example:

Arc -74.176906 40.849729 -74.173018 40.854981 
180 270

May appear as:

Arc -74.176906 40.849729 -74.173018 40.854981 180 270  


In ArcView, the MIFTOSHAPE script in the conversion script library can handle these MIFs somewhat better than the MIFSHAPE executable. Instead of stopping when it encounters the illegal ARC instruction, MIFTOSHAPE will continue processing and simply omit the line. One disadvantage of the MIFTOSHAPE script is that text will not be converted, since text is not a shapefile feature and cannot be handled directly. The MIFSHAPE executable does convert text by bringing in the insertion point of the text with a Mif_text attribute item which then can be brought out with the labeling function in ArcView.

Another option is to bring the MIF file up in a text editor and place a carriage return between the last coordinate value and the first angle:

1. Open the MIF either in Notepad, or if the MIF is large, in a word processing program.
2. Do a string search for the word ARC.
3. Make sure the angles appear on the line following each line containing the ARC command.
4. If opened MIF a word processor, make sure you save it as ASCII text.
5. Run the MIFSHAPE executable again.