Ejemplo n.º 1
0
        public void RowCollection_GetEnumerator()
        {
            // Arrange
            var list = new RowCollection();

            // Act
            var enumerator = list.GetEnumerator();

            // Assert
            Assert.IsNotNull(enumerator);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Geodatabase geo = Geodatabase.Open("");

            List <Table> tables = new List <Table>();

            List <string> featureClasses = geo.GetChildDatasets("\\", "Feature Class").ToList();

            foreach (string featureClassName in featureClasses)
            {
                tables.Add(geo.OpenTable(featureClassName));
            }

            string createTableSqlCommand = CreateTableColumns(tables[0].FieldInformation);

            FieldInfo fieldInfo = tables[0].FieldInformation;
            var       fields    = new List <string>();

            for (int i = 0; i < fieldInfo.Count; i++)
            {
                fields.Add(fieldInfo.GetFieldName(i));
            }

            var           countStatements = $"SELECT * FROM VAULTSCOT_AUTH_POINT_OCT18";
            RowCollection rows            = geo.ExecuteSQL(countStatements);
            WKBReader     reader          = new WKBReader();

            foreach (Row row in rows)
            {
                MultiPointShapeBuffer geometry = row.GetGeometry();
                var point = geometry.Points;
                //MULTIPOINT (295512,712727,0) throwing format exception - Resolved in upcoming commit.
                var geometryWKT = processMultiPointBuffer(geometry);
            }

            var           countEnumerator = rows.GetEnumerator();
            List <object> fieldValues     = new List <object>();

            if (rows != null)
            {
                countEnumerator.MoveNext();
                var shape = countEnumerator.Current["Shape"];

                for (int i = 0; i < fieldInfo.Count - 1; i++)
                {
                    var count = countEnumerator.Current[fields[i]];
                    fieldValues.Add(count);
                }
            }

            InsertTableValues(fieldValues, fieldInfo);
        }
Ejemplo n.º 3
0
        public void GetEnumerator_ShouldReturnEnumerator()
        {
            var matrix = new Matrix <float>(new float[][]
            {
                new float [] { 0.12f, 0.00024f, 1, 1000 },
                new float [] { 0, 0, 1, -0.00134f }
            });
            var collection = new RowCollection <float>(matrix);

            IEnumerator <float[]> enumerator = collection.GetEnumerator();

            Assert.NotNull(enumerator);
        }