public Map GetMap()
        {
            var map   = new Map();
            var files = Directory.GetFiles(this._folder, "*.shp", SearchOption.TopDirectoryOnly);

            foreach (var file in files)
            {
                var importer = new ShapefileImporter(file);
                map.Layers.Add(importer.GetVectorLayer());
            }
            return(map);
        }
Example #2
0
        public VectorLayer GetVectorLayer()
        {
            var layer = new VectorLayer(Path.GetFileNameWithoutExtension(this._shp.FilePath), this.GetGeoType());

            for (var i = 0; i < this._shp.RecordCount; i++)
            {
                var f = new Feature(ShapefileImporter.GetGeoData(this._shp.GetShapeDataD(i)[0]));
                this.SetProperties(f, this._shp.GetAttributeFieldValues(i));
                layer.Features.Add(f);
            }
            return(layer);
        }