Ejemplo n.º 1
0
        public static void Serialize(XmlWriter writer, AbstractGeometryType gmlObject)
        {
            XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();

            namespaces.Add(string.Empty, string.Empty);
            namespaces.Add("gml", "http://www.opengis.net/gml");

            if (gmlObject is MultiPolygonType)
            {
                MultiPolygonSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            if (gmlObject is MultiCurveType)
            {
                MultiCurveSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            if (gmlObject is MultiLineStringType)
            {
                MultiLineStringSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            if (gmlObject is MultiSurfaceType)
            {
                MultiSurfaceSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            if (gmlObject is MultiPointType)
            {
                MultiPointSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            if (gmlObject is LinearRingType)
            {
                LinearRingSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            if (gmlObject is LineStringType)
            {
                LineStringSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            if (gmlObject is PolygonType)
            {
                PolygonSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            if (gmlObject is PointType)
            {
                PointSerializer.Serialize(writer, gmlObject, namespaces);
                return;
            }

            throw new NotImplementedException();
        }