Exemple #1
0
        public int CreateFeatureClass(string dsname, string fcname, IGeometryDef geomDef, IFields fields)
        {
            if (geomDef == null || fields == null)
            {
                return(-1);
            }

            string filename = _directoryName + @"\" + fcname;
            Fields f        = new Fields();

            foreach (IField field in fields)
            {
                f.Add(field);
            }

            if (!SHPFile.Create(filename, geomDef, f))
            {
                return(-1);
            }

            return(0);
        }
Exemple #2
0
        public Task <int> CreateFeatureClass(string dsname, string fcname, IGeometryDef geomDef, IFields fields)
        {
            if (geomDef == null || fields == null)
            {
                return(Task.FromResult(-1));
            }

            string filename = _directoryName + @"/" + fcname;
            Fields f        = new Fields();

            foreach (IField field in fields.ToEnumerable())
            {
                f.Add(field);
            }

            if (!SHPFile.Create(filename, geomDef, f))
            {
                return(Task.FromResult(-1));
            }

            return(Task.FromResult(0));
        }