Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            GISShapefile sf = new GISShapefile();

            layer = sf.ReadShapefile(@"D:\课程\大三上\地理信息系统底层开发\data\china_cities_gdf_prj.shp");
            layer.DrawAttributeOrNot = false;
            MessageBox.Show("read " + layer.FeatureCount() + " point objects");
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = "Shapefile文件|*.shp";
            openFileDialog.RestoreDirectory = true;
            openFileDialog.FilterIndex      = 1;
            openFileDialog.Multiselect      = false;
            if (openFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            layer = GISShapefile.ReadShapefile(openFileDialog.FileName);
            layer.DrawAttributeOrNot = false;
            MessageBox.Show("read " + layer.FeatureCount() + "objects");
            view.UpdateExtent(layer.Extent);
            UpdateMap();
        }