Esempio n. 1
0
        public ConvertToSHP(osm infile)
        {
            areas = 0;
            ways = 0;
            points = 0;

            this.infile = infile;

            foreach (way nWay in infile.wayCollection)
            {
                if (nWay.ndCollection[0].reff == nWay.ndCollection[nWay.ndCollection.Count - 1].reff)
                {
                    areas++;
                }
                else
                {
                    ways++;
                }

                foreach (nd nNd in nWay.ndCollection)
                {
                    node nNode = infile.nodeCollection.GetByRef(nNd.reff);
                    nNode.InWay = true;
                }

            }

            foreach (node nNode in infile.nodeCollection)
            {
                if (!nNode.InWay)
                {
                    points++;
                }
            }
        }
Esempio n. 2
0
        public ConvertToSHP(osm infile)
        {
            areas  = 0;
            ways   = 0;
            points = 0;

            this.infile = infile;

            foreach (way nWay in infile.wayCollection)
            {
                if (nWay.ndCollection[0].reff == nWay.ndCollection[nWay.ndCollection.Count - 1].reff)
                {
                    areas++;
                }
                else
                {
                    ways++;
                }

                foreach (nd nNd in nWay.ndCollection)
                {
                    node nNode = infile.nodeCollection.GetByRef(nNd.reff);
                    nNode.InWay = true;
                }
            }

            foreach (node nNode in infile.nodeCollection)
            {
                if (!nNode.InWay)
                {
                    points++;
                }
            }
        }
Esempio n. 3
0
        private void tsbOpen_Click(object sender, EventArgs e)
        {

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                content = new osm();
                OSMFile = openFileDialog1.FileName;
                content.ReadFromFile(OSMFile);
            }
            else return;

            export = new ConvertToSHP(content);
            txtOpen.Clear();
            txtOpen.Text = "File '" + OSMFile + "' opened successfully!" + Environment.NewLine;
            txtOpen.Text += "It contains " + content.nodeCollection.Count.ToString();
            txtOpen.Text += " nodes and " + content.wayCollection.Count.ToString()+" ways.";
            txtOpen.Text += Environment.NewLine + Environment.NewLine;
            //txtOpen.Text += "In terms of shapefiles there are:" + Environment.NewLine;
            //txtOpen.Text += "  -" + areas.ToString() + " polygons" + Environment.NewLine;
            //txtOpen.Text += "  -" + ways.ToString() + " polylines" + Environment.NewLine;
            //txtOpen.Text += "  -" + points.ToString() + " points" + Environment.NewLine;
            
        }
Esempio n. 4
0
        private void tsbOpen_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                content = new osm();
                OSMFile = openFileDialog1.FileName;
                content.ReadFromFile(OSMFile);
            }
            else
            {
                return;
            }

            export = new ConvertToSHP(content);
            txtOpen.Clear();
            txtOpen.Text  = "File '" + OSMFile + "' opened successfully!" + Environment.NewLine;
            txtOpen.Text += "It contains " + content.nodeCollection.Count.ToString();
            txtOpen.Text += " nodes and " + content.wayCollection.Count.ToString() + " ways.";
            txtOpen.Text += Environment.NewLine + Environment.NewLine;
            //txtOpen.Text += "In terms of shapefiles there are:" + Environment.NewLine;
            //txtOpen.Text += "  -" + areas.ToString() + " polygons" + Environment.NewLine;
            //txtOpen.Text += "  -" + ways.ToString() + " polylines" + Environment.NewLine;
            //txtOpen.Text += "  -" + points.ToString() + " points" + Environment.NewLine;
        }
Esempio n. 5
0
		    public void Remove(osm item)
		    {
			      _list.Remove(item);
		    }
Esempio n. 6
0
		    public void Add(osm item)
		    {
			      _list.Add(item);
		    }
Esempio n. 7
0
 public void Remove(osm item)
 {
     _list.Remove(item);
 }
Esempio n. 8
0
 public void Add(osm item)
 {
     _list.Add(item);
 }