Doing DotSpatial in Visual C# 2010 Express: Using the existing points in Microsoft Excel 2007 to create Polylines and Polygons-FID0 & name in Attribute Table?

Mar 2, 2011 at 9:14 PM
Edited Mar 3, 2011 at 4:07 PM

Hi Jiri,

(1) Instead of doing:

//add feature set to the map

                 map1.Layers.Add(fs);

 I did the following:

//Scott Chang: save the fs to C:\Temp folder

              fs.SaveAs(@"C:\Temp\FtMN8PtsExcel.shp", true);

 

               //add feature set to the map

               //map1.Layers.Add(fs);

 

               MessageBox.Show("It passed here!!");

Your nice C# code worked and the FtMN8PtsExcel.shp file was saved in my C:\Temp folder. 

It was so wonderful to see the 8 points on the map of MapWindow 6.0 (Orlando)!!!

(2) I want to write C# code to create 2 polylines: (i) FtMcNairLine1- connecting Point Id #s 1, 2 and 3, and

     (ii) FtMcNairLine2 - connecting Point Id #s 1, 4, 5, and 6.

     (iii) Also I want to write C# code to create 1 polygon:  FtMcNairCircle - connection Point Id #s 1, 2, 3, 8, 6, 5, 4 and 1.

I studied the DotSpatial Tutorial (4) - Shapefile and Attribute table operations in DotSpatial (in Visual Basic) that uses

the Mouse to click the points to create the polylines in Fig 7 and a polygon in Fig 8.  The DotSpatial Tutorial (4) was not helpful to me.

I started reading the big file of SDK-style documentation online that is hard  for me/new users to find the necessary infornation

and techniques to create the 2 polylines and the polygon I want.  Could you please kindly give me the key DotSpatial Classes/Methods,

 and C# code statements to do the creating 2 polylines (FtMcNairLine1 and FtMcNairLine2) and the polygon (FtMcNairCircle)?

Many Thanks in advance,

Scott Chang

 

Coordinator
Mar 3, 2011 at 9:56 AM

Check the tutorials on the documentation page. I think #3 shows how to make features in code.

- Dan
--------
Daniel P. Ames Ph.D.
Idaho State University Dept. of Geosciences
dan.ames@isu.edu
--------
Sent from my Droid

On Mar 2, 2011 2:14 PM, "Scott_H_Chang" <notifications@codeplex.com> wrote:
> From: Scott_H_Chang
>
> Hi Jiri,(1) In stead of doing://add feature set to the map map1.Layers.Add(fs); I did the following://Scott Chang: save the fs to C:\Temp folder fs.SaveAs(@"C:\Temp\FtMN8PtsExcel.shp",true); //add feature set to the map //map1.Layers.Add(fs); MessageBox.Show("It passed here!!");Your nice C# code worked and the FtMN8PtsExcel.shp file was saved in my C:\Temp folder. It was so wonderful to see the 8 points on the map of MapWindow 6.0 (Orlando)!!!(2) I want to write C# code to create 2 polylines: (i) FtMcNairLine1- connecting Point Id #s 1, 2 and 3, and (ii) FtMcNairLine2 - connecting Point Id #s 1, 4, 5, and 6. (iii) Also I want to write C# code to create 1 polygon: FtMcNairCircle - connection Point Id #s 1, 2, 3, 8, 6, 5, 4 and 1.1 studied the DotSpatial Tutorial (4) - Shapefile and Attribute table operations in DotSpatial (in Visual Basic) that usesthe Mouse to click the points to create the polylines in Fig 7 and a polygon in Fig 8. The DotSpatial Tutorial (4) id helpful to me.I started reading the big file of SDK-style documentation online that is hard for me/new users to find the necessary infornationand techniques to create the 2 polylines and the polygon I want. Could you please kindly give me the key DotSpatial Classes/Methods, and C# code statements to do the creating 2 polylines (FtMcNairLine1 and FtMcNairLine2) and the polygon (FtMcNairCircle)?Many Thanks in advance,Scott Chang
>
>
Mar 3, 2011 at 2:49 PM

Hi Dan, Thanks for your response.

I have been studying the Tutorials of DotSpatial and MapWindow Six. The DotSpatial Tutorial (3) - Raster data operations in DotSpatial (in Visual Basic) and

the Tutorials of "Create New Vectors" (using many random points, e.Button, etc.) in MapWindow Six are above my head.  I/new users of DotSptial still need the basic and straight-forward DotSpatial Classes and Methods, and C# Code Statements for creating the FtMcNairLine1, FtMcNairLine2, and FtMcNairCircle

from Jiri.  So I can gain the basic skills of doing the DotSpatial C# programming.  

Thanks again,

Scott Chang

P. S.  By the way, creating the Points from the finite data (not the random points) stored in the Microsoft Excel (or Access or SQL servers) database, creating the Polylines from the finite Points, and creating the Polygons from the finite points/polylines may be the logic and basic topics for teaching your DotSpatial GIS classes in ISU.  This is just a suggestion from me.    

Developer
Mar 3, 2011 at 6:47 PM

Hi Scott,

The following example shows how to create the point shapefile, line shapefile and polygon shapefile from the Excel sheet. To run the code, change 'excelFileName='c:\Users\Jiri\Desktop\scott.xlsx' to the proper file name of the excel file. This example is using the ToolStripMenuItem click events. In your Form1, you can add the MenuStrip and add the menu items.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Windows.Forms;
using DotSpatial.Topology;
using DotSpatial.Projections;
using DotSpatial.Data;

namespace ExcelDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void pointsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string excelFileName = "c:\\Users\\Jiri\\Desktop\\scott.xlsx";
            string sheetName = "FtMcNair";

            //this is the connection string to the xlsx file (excel2007)
            string connstr = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1\";", excelFileName);
            using (OleDbConnection conn = new OleDbConnection(connstr))
            {
                string strSQL = string.Format("SELECT * FROM [{0}$]", sheetName);

                OleDbCommand cmd = new OleDbCommand(strSQL, conn);
                System.Data.DataSet ds = new System.Data.DataSet();
                OleDbDataAdapter da = new OleDbDataAdapter(cmd);
                da.Fill(ds);
                DataTable excelTable = ds.Tables[0];

                //creating the point features set
                DotSpatial.Data.FeatureSet fs = new DotSpatial.Data.FeatureSet(FeatureType.Point);
                //set the projection to WGS1984
                fs.Projection = KnownCoordinateSystems.Geographic.World.WGS1984;

                //copy the attribute table column names from the excel table
                fs.DataTable = excelTable.Clone();

                //populate the point features
                foreach (DataRow row in excelTable.Rows)
                {
                    //get x, y
                    double x = Convert.ToDouble(row["x"]);
                    double y = Convert.ToDouble(row["y"]);

                    //creates a new coordinate 
                    Coordinate c = new Coordinate(x, y);
                    //passes the coordinate to a new point
                    DotSpatial.Topology.Point p = new DotSpatial.Topology.Point(c);

                    DotSpatial.Data.IFeature currentFeature = fs.AddFeature(p);

                    //add the cell values for each row
                    for (int i = 0; i < excelTable.Columns.Count; i++)
                    {
                        currentFeature.DataRow[i] = row[i];
                    }
                }
                //save to a shapefile
                string pointFileName = @"c:\temp\ftMN8PointsExcel.shp";
                fs.SaveAs(pointFileName, true);
                //add shapefile to map
                map1.AddLayer(pointFileName);
            }
        }

        private void linesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string excelFileName = "c:\\Users\\Jiri\\Desktop\\scott.xlsx";
            string sheetName = "FtMcNair";

            //this is the connection string to the xlsx file (excel2007)
            string connstr = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1\";", excelFileName);
            using (OleDbConnection conn = new OleDbConnection(connstr))
            {
                string strSQL = string.Format("SELECT * FROM [{0}$]", sheetName);

                OleDbCommand cmd = new OleDbCommand(strSQL, conn);
                System.Data.DataSet ds = new System.Data.DataSet();
                OleDbDataAdapter da = new OleDbDataAdapter(cmd);
                da.Fill(ds);
                DataTable excelTable = ds.Tables[0];

                //creating the line feature set
                DotSpatial.Data.FeatureSet fs = new DotSpatial.Data.FeatureSet(FeatureType.Line);
                //set the projection to WGS1984
                fs.Projection = KnownCoordinateSystems.Geographic.World.WGS1984;

                //add a 'name' attribute
                fs.DataTable.Columns.Add(new DataColumn("name", typeof(string)));

                //populate the line one, connecting points #1, #2, #3
                List<Coordinate> coordList1 = new List<Coordinate>();
                //point #1
                DataRow row1 = excelTable.Rows[0];
                double x1 = Convert.ToDouble(row1["x"]);
                double y1 = Convert.ToDouble(row1["y"]);
                coordList1.Add(new Coordinate(x1, y1));
                //point #2
                DataRow row2 = excelTable.Rows[1];
                double x2 = Convert.ToDouble(row2["x"]);
                double y2 = Convert.ToDouble(row2["y"]);
                coordList1.Add(new Coordinate(x2, y2));
                //point #3
                DataRow row3 = excelTable.Rows[2];
                double x3 = Convert.ToDouble(row3["x"]);
                double y3 = Convert.ToDouble(row3["y"]);
                coordList1.Add(new Coordinate(x3, y3));
                //create line #1
                LineString line1 = new LineString(coordList1);
                IFeature feature1 = fs.AddFeature(line1);
                //set attributes of line one
                feature1.DataRow["name"] = "LINE 1";

                //populate the line two, connecting #1, #4, #5, #6
                List<Coordinate> coordList2 = new List<Coordinate>();
                //point #1
                coordList2.Add(new Coordinate(x1, y1));
                //point #4
                DataRow row4 = excelTable.Rows[3];
                double x4 = Convert.ToDouble(row4["x"]);
                double y4 = Convert.ToDouble(row4["y"]);
                coordList2.Add(new Coordinate(x4, y4));
                //point #5
                DataRow row5 = excelTable.Rows[4];
                double x5 = Convert.ToDouble(row5["x"]);
                double y5 = Convert.ToDouble(row5["y"]);
                coordList2.Add(new Coordinate(x5, y5));
                //point #6
                DataRow row6 = excelTable.Rows[6];
                double x6 = Convert.ToDouble(row6["x"]);
                double y6 = Convert.ToDouble(row6["y"]);
                coordList2.Add(new Coordinate(x6, y6));
                //create line #2
                LineString line2 = new LineString(coordList2);
                IFeature feature2 = fs.AddFeature(line2);
                //set attributes of line one
                feature2.DataRow["name"] = "LINE 2";
              
                //save to a shapefile
                string lineFileName = @"c:\temp\ftMN2LinesExcel.shp";
                fs.SaveAs(lineFileName, true);
                //add shapefile to map
                map1.AddLayer(lineFileName);
            }
        }

        private void polygonsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string excelFileName = "c:\\Users\\Jiri\\Desktop\\scott.xlsx";
            string sheetName = "FtMcNair";

            //this is the connection string to the xlsx file (excel2007)
            string connstr = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1\";", excelFileName);
            using (OleDbConnection conn = new OleDbConnection(connstr))
            {
                string strSQL = string.Format("SELECT * FROM [{0}$]", sheetName);

                OleDbCommand cmd = new OleDbCommand(strSQL, conn);
                System.Data.DataSet ds = new System.Data.DataSet();
                OleDbDataAdapter da = new OleDbDataAdapter(cmd);
                da.Fill(ds);
                DataTable excelTable = ds.Tables[0];

                //creating the polygon feature set
                DotSpatial.Data.FeatureSet fs = new DotSpatial.Data.FeatureSet(FeatureType.Polygon);
                //set the projection to WGS1984
                fs.Projection = KnownCoordinateSystems.Geographic.World.WGS1984;

                //add a 'name' attribute
                fs.DataTable.Columns.Add(new DataColumn("name", typeof(string)));

                //populate the polygon one, connecting points #1, #2, #3, #8, #6, #5, #4 and #1
                List<Coordinate> coordList1 = new List<Coordinate>();
                //point #1
                DataRow row1 = excelTable.Rows[0];
                double x1 = Convert.ToDouble(row1["x"]);
                double y1 = Convert.ToDouble(row1["y"]);
                coordList1.Add(new Coordinate(x1, y1));
                //point #2
                DataRow row2 = excelTable.Rows[1];
                double x2 = Convert.ToDouble(row2["x"]);
                double y2 = Convert.ToDouble(row2["y"]);
                coordList1.Add(new Coordinate(x2, y2));
                //point #3
                DataRow row3 = excelTable.Rows[2];
                double x3 = Convert.ToDouble(row3["x"]);
                double y3 = Convert.ToDouble(row3["y"]);
                coordList1.Add(new Coordinate(x3, y3));
                //point #8
                DataRow row8 = excelTable.Rows[7];
                double x8 = Convert.ToDouble(row8["x"]);
                double y8 = Convert.ToDouble(row8["y"]);
                coordList1.Add(new Coordinate(x8, y8));
                //point #6
                DataRow row6 = excelTable.Rows[5];
                double x6 = Convert.ToDouble(row6["x"]);
                double y6 = Convert.ToDouble(row6["y"]);
                coordList1.Add(new Coordinate(x6, y6));
                //point #5
                DataRow row5 = excelTable.Rows[4];
                double x5 = Convert.ToDouble(row5["x"]);
                double y5 = Convert.ToDouble(row5["y"]);
                coordList1.Add(new Coordinate(x5, y5));
                //point #4
                DataRow row4 = excelTable.Rows[3];
                double x4 = Convert.ToDouble(row4["x"]);
                double y4 = Convert.ToDouble(row4["y"]);
                coordList1.Add(new Coordinate(x4, y4));
                //closing point #1
                coordList1.Add(new Coordinate(x1, y1));

                //create polygon #1
                Polygon polygon1 = new Polygon(coordList1);
                IFeature feature1 = fs.AddFeature(polygon1);
                //set attributes of polygon one
                feature1.DataRow["name"] = "POLYGON 1";

                //save to a shapefile
                string polygonFileName = @"c:\temp\ftMN1PolygonExcel.shp";
                fs.SaveAs(polygonFileName, true);
                //add shapefile to map
                map1.AddLayer(polygonFileName);
            }
        }
    }
}

Mar 3, 2011 at 8:59 PM

Hi Jiri,  Thanks for your nice response and valuable C# code.

I used the regular Button from the All Windows Forms of Toolbox to do  private void btnExcel_Click(object sender, EventArgs e) in the last example.

This time, I am not sure about "This example is using the ToolStripMenuItem click events. In your Form1, you can add the MenuStrip and add the menu items." related to:

private void pointsToolStripMenuItem_Click(object sender, EventArgs e),
private void linesToolStripMenuItem_Click(object sender, EventArgs e), and
private void polygonsToolStripMenuItem_Click(object sender, EventArgs e).

I see ToolStrip and MenuStrip in the All Windows Forms of Toolbox in the left pane.  Which one (ToolStrip or MenuStrip) should I drag from Toolbox to Form1 for

the 3 ToolStripMenuItem click events?  Please clarify.

Thanks again,

Scott Chang  

Developer
Mar 3, 2011 at 10:37 PM

Hi Scott,

You can also use 3 regular Buttons from the All Windows Forms of Toolbox. You can add three buttons to Form1 and rename the three buttons to btnPoints, btnLines and btnPolygons. Then you change

pointsToolStripMenuItem_Click to btnPoints_Click, change linesToolStripMenuItem_Click to btnLines_Click and change polygonsToolStripMenuItem_Click to btnPolygons_Click .

 

In my example, I was using "MenuStrip". You can find "MenuStrip" in the "All Windows Forms" part of the Visual Studio Toolbox. After you drag the MenuStrip on

Form1 and click on the MenuStrip in the "Design view" of Form1, then you can enter the menu item names and generate the pointsToolStripMenuItem_Click, linesToolStripMenuItem_Click and polygonsToolStripMenuItem_Click events.

I used the example with "MenuStrip" instead of regular buttons, because with "MenuStrip" the menustrip and map and legend can easily coexist on Form1.

 

Regards,

Jiri

Mar 4, 2011 at 2:56 PM

Hi Jiri,  Thanks for your nice response that helps me understand (i) using one MenuStrip to create 3 clicking events, and (ii) why you have "// add feature set to the map   map1.Layers.Add(fs);" in your C# code examples-Great!!!

(1) Using MenuStrip to create the pointsToolStripMenuItem clicking event:  I tried it and I added toolStripMenuItem1 in Items Collection Editor (points ToolMenuItem ToolStripMenuItemToolStripMenuItem.DropDownItem).

     I managed to get the following code: 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DotSpatial.Controls;
using DotSpatial.Data;
using DotSpatial.Projections;
using DotSpatial.Symbology;
using DotSpatial.Topology;

namespace JiriPtsLinesPolygonFtMN8Pts
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void pointsToolStripMenuItemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string excelFileName = "c:\\DotSpatial\\FtMcNair8Pts.xlsx";
            string sheetName = "FtMcNair";

            //this is the connection string to the xlsx file (excel2007)
            string connstr = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1\";", excelFileName);
            using (OleDbConnection conn = new OleDbConnection(connstr))
            {
                string strSQL = string.Format("SELECT * FROM [{0}$]", sheetName);

                OleDbCommand cmd = new OleDbCommand(strSQL, conn);
                System.Data.DataSet ds = new System.Data.DataSet();
                OleDbDataAdapter da = new OleDbDataAdapter(cmd);
                da.Fill(ds);
                DataTable excelTable = ds.Tables[0];

                //creating the point features set
                DotSpatial.Data.FeatureSet fs = new DotSpatial.Data.FeatureSet(FeatureType.Point);
                //set the projection to WGS1984
                fs.Projection = KnownCoordinateSystems.Geographic.World.WGS1984;

                //copy the attribute table column names from the excel table
                fs.DataTable = excelTable.Clone();

                //populate the point features
                foreach (DataRow row in excelTable.Rows)
                {
                    //get x, y
                    double x = Convert.ToDouble(row["x"]);
                    double y = Convert.ToDouble(row["y"]);

                    //creates a new coordinate 
                    Coordinate c = new Coordinate(x, y);
                    //passes the coordinate to a new point
                    DotSpatial.Topology.Point p = new DotSpatial.Topology.Point(c);

                    DotSpatial.Data.IFeature currentFeature = fs.AddFeature(p);

                    //add the cell values for each row
                    for (int i = 0; i < excelTable.Columns.Count; i++)
                    {
                        currentFeature.DataRow[i] = row[i];
                    }
                }
                //save to a shapefile
                string pointFileName = @"c:\temp\ftMN8PointsExcel.shp";
                fs.SaveAs(pointFileName, true);
                //add shapefile to map
               // map1.AddLayer(pointFileName);
            }
 
        }
    }
}

I got the following 6 errors: 

Error 1 The type or namespace name 'OleDbConnection' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\e1enxshc\my documents\visual studio 2010\Projects\JiriPtsLinesPolygonFtMN8Pts\JiriPtsLinesPolygonFtMN8Pts\Form1.cs 31 20 JiriPtsLinesPolygonFtMN8Pts
Error 2 The type or namespace name 'OleDbConnection' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\e1enxshc\my documents\visual studio 2010\Projects\JiriPtsLinesPolygonFtMN8Pts\JiriPtsLinesPolygonFtMN8Pts\Form1.cs 31 47 JiriPtsLinesPolygonFtMN8Pts
Error 3 The type or namespace name 'OleDbCommand' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\e1enxshc\my documents\visual studio 2010\Projects\JiriPtsLinesPolygonFtMN8Pts\JiriPtsLinesPolygonFtMN8Pts\Form1.cs 35 17 JiriPtsLinesPolygonFtMN8Pts
Error 4 The type or namespace name 'OleDbCommand' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\e1enxshc\my documents\visual studio 2010\Projects\JiriPtsLinesPolygonFtMN8Pts\JiriPtsLinesPolygonFtMN8Pts\Form1.cs 35 40 JiriPtsLinesPolygonFtMN8Pts
Error 5 The type or namespace name 'OleDbDataAdapter' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\e1enxshc\my documents\visual studio 2010\Projects\JiriPtsLinesPolygonFtMN8Pts\JiriPtsLinesPolygonFtMN8Pts\Form1.cs 37 17 JiriPtsLinesPolygonFtMN8Pts
Error 6 The type or namespace name 'OleDbDataAdapter' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\e1enxshc\my documents\visual studio 2010\Projects\JiriPtsLinesPolygonFtMN8Pts\JiriPtsLinesPolygonFtMN8Pts\Form1.cs 37 43 JiriPtsLinesPolygonFtMN8Pts

I guess that I missed something in setting the right property/properties in the pointsToolStripMenu.  I do not know how to fix these 6 errors.  Please help and advise me on this matter.

(2)  I do not want to do ""// add feature set to the map   map1.Layers.Add(fs);" in this new project.  I want to get the fs.SaveAs(pointFilename, true); done to save the results to my C:\Temp folder.  Then I will see the

  results in the MapWindow 6.0 (Orlando) program.   If this "Using the MenuStrip/add menu items" works for me, I will do the "map1.Layers.Add(fs)" thing in the future.  

Please respond.

Thanks again,

Scott Chang 

Developer
Mar 4, 2011 at 5:35 PM

Hi Scott,

On the start of your code, add the statement:

using System.Data.OleDb;

Regards,
Jiri




Mar 4, 2011 at 9:35 PM
Edited Mar 7, 2011 at 3:19 PM

Hi Jiri,

(1) Good News & Bad News to tell you:  Good News is that it generated the results for 8 Points, 2 PolyLines, and 1 Polygon I want.

                                                       Bad News is that when I clicked on the Attribute Table Editor for each shapefile on MapWindow 6.0 (Orlando), it gives me

                                                        the following box:             |X|

                                                                                       Test!

                                                                                       |OK|

I clicked on |OK| and it does not quit and I can not end the program for exiting out of the C# project!!??    What is it going wrong with the results or with MapWindow 6.0 (Orlando)?

 (2)  I saw new "FID0" in the Attribute Table for each output!!  Is "FID0" generated from the project for all the 3 shapfiles: 8 Points, 2 PolyLines and 1 Polygon?

      In the ArcGIS, different FID is used for different Points, PolyLines and Polygons.  I did not have the FID column in my last project.  Should I use the FID columnn?

(3)  I added the concentration of benzene in a column of my 8-Point Excel file and they are successfully saved in the Attribute Table - wonderful!!!  How can I show the

     the concentration of benzene on the map of MaoWindow 6.0 (Orlando? I want to show the Point Ids too.  How can I do this kind of task in MapWindow 6.0(Orlando).

Please help,comment and respond.

Thanks,

Scott Chang 

=====================================================================

Hi Jiri,

This morning (Monday, 7 March 2011),  I checked Form1.cs(Design) and found  that LinesToolStripMenuItem and polygonsToolStripMenuItem did not have

toolStripMenuItem2 and tooStripMenuItem3 clicked (I forgot to clicked last week).  I corrected these 2 Items and executed my project again - The problem in (1) is resolved!!!

Thus, you need not pay attention to the (1).  But I need your help on (2) about Attribute Table: This morning, I saw the following 2 tables in Attribute Table Editor-

  (i)     name      FID0

          LINE 1      0

          LINE2       1

   (ii)    name           FID0

          POLYGON 1    0

I really need to bring Line 1,  Line 2,  POLYGON 0, and the concentrations of benzene out and put them as annotations on the map.  Please kindly help and advise.

Thanks again,

Scott Chang