Ejemplo n.º 1
0
        private Feature ReadFeature(DBI.Statement statement, int geometryColumnIndex)
        {
            var feature = new Feature();

            for (int i = 0; i < statement.FieldCount; ++i)
            {
                if (i == geometryColumnIndex)
                {
                    feature.Geometry = BinaryGeometry.Read(statement.Stream(i));
                    if (feature.Geometry == null)
                    {
                        continue;
                    }

                    /*
                     * if (TransformFrom == null)
                     *  continue;
                     * feature.Geometry.Transform(TransformFrom);
                     */
                    continue;
                }
                feature.Attributes[statement.Key(i)] = statement.Value(i);
            }
            return(feature);
        }
Ejemplo n.º 2
0
        static public Geometry Read(Stream stream)
        {
            var binaryGeometry = new BinaryGeometry();
            var reader         = new EndianBinaryReader(stream);

            if (!binaryGeometry.ReadHeader(reader))
            {
                return(null);
            }
            return(binaryGeometry.ReadGeometry(reader));
        }