public void CreateTest(string subDirectory, string shapefile)
        {
            string            shapefileDirectory = System.IO.Path.Combine(_dataDirectory, subDirectory);
            IWorkspace        workspace          = GeodatabaseUtil.GetShapefileWorkspace(shapefileDirectory);
            IFeatureWorkspace featureWorkspace   = workspace as IFeatureWorkspace;
            IFeatureClass     featureClass       = featureWorkspace.OpenFeatureClass(shapefile);

            AoGISFields fields = new AoGISFields(featureClass.Fields);

            Assert.IsNotNull(fields, "Creating 'AoGISFields' failed.");
            Assert.IsNotNull(fields.GeometryType, "The geometry column was not found");
            Assert.AreEqual(fields.GeometryType, "MultiPolygon", "The geometry type does not match.");
            Assert.AreEqual(fields.AttributeFieldCount, 11, "The attribute field count does not match");
        }
示例#2
0
        /// <summary>
        /// Searches the FeatureClass using the specified queryfilter.
        /// </summary>
        /// <param name="queryfilter">The query should be of type [IQueryfilter].</param>
        public void Search(object queryFilter)
        {
            if (queryFilter != null)
            {
                if (!(queryFilter is IQueryFilter))
                {
                    throw new ArgumentException("The query should be of type [IQueryFilter].", "queryfilter");
                }
            }

            _query = queryFilter as IQueryFilter;

            _featureCursor = _featureClass.Search(_query, true);
            _gisFields     = new AoGISFields(_featureCursor.Fields);
        }
示例#3
0
        public AoFCLayer(IFeatureClass featureClass, string layerName, string keyFieldName)
        {
            if (featureClass == null)
            {
                throw new ArgumentNullException("featureClass");
            }
            if (string.IsNullOrEmpty(layerName))
            {
                throw new ArgumentNullException("layerName");
            }
            if (string.IsNullOrEmpty(keyFieldName))
            {
                throw new ArgumentNullException("keyFieldName");
            }

            _gisFields = new AoGISFields(featureClass.Fields);

            _featureClass = featureClass;
            _layerName    = layerName;
            _keyFieldName = keyFieldName;
        }