示例#1
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(LookupField))
                {
                    writer.WriteAttributeString("lookupfield", LookupField);
                }

                foreach (Classification classification in _classifications)
                {
                    classification.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#2
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Accuracy != 0)
                {
                    writer.WriteAttributeString("accuracy", Accuracy.ToString());
                }

                if (Compact)
                {
                    writer.WriteAttributeString("compact", "true");
                }

                if (DensifyTolerance != 0)
                {
                    writer.WriteAttributeString("densifytolerance", DensifyTolerance.ToString());
                }

                if (Envelope)
                {
                    writer.WriteAttributeString("envelope", "true");
                }

                if (Environment != null)
                {
                    Environment.WriteTo(writer);
                }

                _fromCoordSys.WriteTo(writer);
                _toCoordSys.WriteTo(writer);

                foreach (IGeometry shape in _shapes)
                {
                    if (shape.OgcGeometryType == OgcGeometryType.Point)
                    {
                        GeometrySerializer.WriteAsMultiPointTo(writer, (IPoint)shape);
                    }
                    else
                    {
                        GeometrySerializer.WriteTo(writer, shape);
                    }
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#3
0
        public virtual void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Accuracy > 0)
                {
                    writer.WriteAttributeString("accuracy", Accuracy.ToString());
                }

                if (FeatureLimit > 0)
                {
                    writer.WriteAttributeString("featurelimit", FeatureLimit.ToString());
                }

                if (!String.IsNullOrEmpty(JoinExpression))
                {
                    writer.WriteAttributeString("joinexpression", JoinExpression);
                }

                if (!String.IsNullOrEmpty(JoinTables))
                {
                    writer.WriteAttributeString("jointables", JoinTables);
                }

                if (!String.IsNullOrEmpty(Subfields))
                {
                    writer.WriteAttributeString("subfields", Subfields);
                }

                if (!String.IsNullOrEmpty(Where))
                {
                    writer.WriteAttributeString("where", Where);
                }

                if (Buffer != null)
                {
                    Buffer.WriteTo(writer);
                }

                if (FeatureCoordSys != null)
                {
                    FeatureCoordSys.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#4
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (CoordinateSeparator != ' ')
                {
                    writer.WriteAttributeString("cs", CoordinateSeparator.ToString());
                    writer.CoordinateSeparator = new char[] { CoordinateSeparator };
                }

                if (TupleSeparator != ';')
                {
                    writer.WriteAttributeString("ts", TupleSeparator.ToString());
                    writer.TupleSeparator = new char[] { TupleSeparator };
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#5
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(Label))
                {
                    writer.WriteAttributeString("label", Label);
                }

                if (Symbol != null)
                {
                    Symbol.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#6
0
        public static void WriteTo(ArcXmlWriter writer, IMultiPoint multiPoint)
        {
            try
            {
                writer.WriteStartElement("MULTIPOINT");

                foreach (IPoint point in multiPoint.Geometries.Cast <IPoint>())
                {
                    WriteTo(writer, point);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException("Could not write MultiPoint object.", ex);
                }
            }
        }
示例#7
0
        public static void WriteTo(ArcXmlWriter writer, IMultiLineString multiLineString)
        {
            try
            {
                writer.WriteStartElement("POLYLINE");

                foreach (ILineString lineString in multiLineString.Geometries.Cast <ILineString>())
                {
                    WriteLineStringTo(writer, "PATH", lineString);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException("Could not write MultiLineString object.", ex);
                }
            }
        }
示例#8
0
        public static void WriteTo(ArcXmlWriter writer, IMultiPolygon multiPolygon)
        {
            try
            {
                writer.WriteStartElement("POLYGON");

                foreach (IPolygon polygon in multiPolygon.Geometries.Cast <IPolygon>())
                {
                    WriteRingTo(writer, polygon);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException("Could not write Polygon object.", ex);
                }
            }
        }
示例#9
0
        public static void WriteTo(ArcXmlWriter writer, IGeometry geometry)
        {
            switch (geometry.OgcGeometryType)
            {
            case OgcGeometryType.Point:
                WriteTo(writer, (IPoint)geometry);
                break;

            case OgcGeometryType.LineString:
                WriteTo(writer, (ILineString)geometry);
                break;

            case OgcGeometryType.Polygon:
                WriteTo(writer, (IPolygon)geometry);
                break;

            case OgcGeometryType.MultiPoint:
                WriteTo(writer, (IMultiPoint)geometry);
                break;

            case OgcGeometryType.MultiLineString:
                WriteTo(writer, (IMultiLineString)geometry);
                break;

            case OgcGeometryType.MultiPolygon:
                WriteTo(writer, (IMultiPolygon)geometry);
                break;

            default:
                throw new ArcXmlException(String.Format("Could not write {0} object, unsupported.", geometry.GetType().Name));
            }
        }
示例#10
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(ID))
                {
                    writer.WriteAttributeString("id", ID);
                }

                if (!String.IsNullOrEmpty(Value))
                {
                    writer.WriteAttributeString("value", Value);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#11
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                writer.WriteAttributeString("layerid", LayerID);
                writer.WriteAttributeString("x", X.ToString());
                writer.WriteAttributeString("y", Y.ToString());

                if (!String.IsNullOrEmpty(DataFrame))
                {
                    writer.WriteAttributeString("dataframe", DataFrame);
                }

                if (CoordSys != null)
                {
                    CoordSys.WriteTo(writer);
                }


                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#12
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Separators != null)
                {
                    Separators.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#13
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                foreach (Renderer renderer in _renderers)
                {
                    renderer.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#14
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (AutoResize)
                {
                    writer.WriteAttributeString("autoresize", "true");
                }

                foreach (DataFrame dataFrame in _dataFrames)
                {
                    dataFrame.WriteTo(writer);
                }

                if (Properties != null)
                {
                    Properties.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#15
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(ID))
                {
                    writer.WriteAttributeString("id", ID);
                }

                if (Type != LayerType.None)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(LayerType), Type));
                }

                if (Dataset != null)
                {
                    Dataset.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#16
0
        public static void WriteTo(ArcXmlWriter writer, Envelope envelope)
        {
            if (!envelope.IsNull)
            {
                try
                {
                    writer.WriteStartElement("ENVELOPE");

                    writer.WriteAttributeString("minx", envelope.MinX.ToString());
                    writer.WriteAttributeString("miny", envelope.MinY.ToString());
                    writer.WriteAttributeString("maxx", envelope.MaxX.ToString());
                    writer.WriteAttributeString("maxy", envelope.MaxY.ToString());

                    writer.WriteEndElement();
                }
                catch (Exception ex)
                {
                    if (ex is ArcXmlException)
                    {
                        throw ex;
                    }
                    else
                    {
                        throw new ArcXmlException("Could not write Envelope object.", ex);
                    }
                }
            }
        }
示例#17
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!TransparentColor.IsEmpty)
                {
                    writer.WriteAttributeString("transcolor", ColorConverter.ToArcXml(TransparentColor));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#18
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                foreach (GcTag gcTag in _gcTags)
                {
                    gcTag.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#19
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (CapType != CapType.Butt)
                {
                    writer.WriteAttributeString("captype", ArcXmlEnumConverter.ToArcXml(typeof(CapType), CapType));
                }

                if (!Color.IsEmpty && Color != Color.Black)
                {
                    writer.WriteAttributeString("color", ColorConverter.ToArcXml(Color));
                }

                if (JoinType != JoinType.Round)
                {
                    writer.WriteAttributeString("jointype", ArcXmlEnumConverter.ToArcXml(typeof(JoinType), JoinType));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (Type != LineType.Solid)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(LineType), Type));
                }

                if (Width > 1)
                {
                    writer.WriteAttributeString("width", Width.ToString());
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#20
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                string[] coords = new string[Count];

                for (int i = 0; i < Count; ++i)
                {
                    coords[i] = String.Format("{0}{1}{2}", this[i].X, writer.CoordinateSeparator[0], this[i].X);
                }

                writer.WriteString(String.Join(writer.TupleSeparator[0].ToString(), coords));

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#21
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                writer.WriteAttributeString("coords", X.ToString() + writer.CoordinateSeparator[0] + Y.ToString());
                writer.WriteAttributeString("type", Type.ToString());

                if (Angle != 0)
                {
                    writer.WriteAttributeString("angle", Angle.ToString());
                }

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!Outline.IsEmpty)
                {
                    writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (Size != 30)
                {
                    writer.WriteAttributeString("size", Size.ToString());
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString());
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#22
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Background != null)
                {
                    Background.WriteTo(writer);
                }

                if (!Envelope.IsNull)
                {
                    EnvelopeSerializer.WriteTo(writer, Envelope);
                }

                if (FeatureCoordSys != null)
                {
                    FeatureCoordSys.WriteTo(writer);
                }

                if (FilterCoordSys != null)
                {
                    FilterCoordSys.WriteTo(writer);
                }

                if (ImageSize != null)
                {
                    ImageSize.WriteTo(writer);
                }

                if (LayerList != null)
                {
                    LayerList.WriteTo(writer);
                }

                if (Output != null)
                {
                    Output.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#23
0
        private static void WriteLineStringTo(ArcXmlWriter writer, string arcXmlName, ILineString lineString)
        {
            writer.WriteStartElement(arcXmlName);

            for (int i = 0; i < lineString.Coordinates.Length; ++i)
            {
                WriteAsPointTo(writer, lineString.Coordinates[i]);
            }

            writer.WriteEndElement();
        }
示例#24
0
        private static void WriteAsPointTo(ArcXmlWriter writer, Coordinate coordinate)
        {
            writer.WriteStartElement("POINT");

            if (coordinate == null)
            {
                writer.WriteAttributeString("x", coordinate.X.ToString());
                writer.WriteAttributeString("y", coordinate.Y.ToString());
            }

            writer.WriteEndElement();
        }
示例#25
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Height > 0)
                {
                    writer.WriteAttributeString("height", Height.ToString());
                }

                if (Width > 0)
                {
                    writer.WriteAttributeString("width", Width.ToString());
                }

                if (Dpi > 0)
                {
                    writer.WriteAttributeString("dpi", Dpi.ToString());
                }

                if (PrintHeight > 0)
                {
                    writer.WriteAttributeString("printheight", PrintHeight.ToString());
                }

                if (PrintWidth > 0)
                {
                    writer.WriteAttributeString("printwidth", PrintWidth.ToString());
                }

                if (ScaleSymbols)
                {
                    writer.WriteAttributeString("scalesymbols", "true");
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#26
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!FinishColor.IsEmpty)
                {
                    writer.WriteAttributeString("finishcolor", ColorConverter.ToArcXml(FinishColor));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (!StartColor.IsEmpty)
                {
                    writer.WriteAttributeString("startcolor", ColorConverter.ToArcXml(StartColor));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (Type != GradientFillType.BDiagonal)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(GradientFillType), Type));
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#27
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(ID))
                {
                    writer.WriteAttributeString("id", ID);
                }

                if (!Envelope.IsNull)
                {
                    EnvelopeSerializer.WriteTo(writer, Envelope);
                }

                if (FeatureCoordSys != null)
                {
                    FeatureCoordSys.WriteTo(writer);
                }

                if (FilterCoordSys != null)
                {
                    FilterCoordSys.WriteTo(writer);
                }

                if (LayerList != null)
                {
                    LayerList.WriteTo(writer);
                }

                if (Scale != null)
                {
                    Scale.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#28
0
        private static void WriteRingTo(ArcXmlWriter writer, IPolygon polygon)
        {
            writer.WriteStartElement("RING");

            for (int i = 0; i < polygon.ExteriorRing.Coordinates.Length; ++i)
            {
                WriteAsPointTo(writer, polygon.ExteriorRing.Coordinates[i]);
            }

            foreach (ILineString lineString in polygon.InteriorRings)
            {
                WriteLineStringTo(writer, "HOLE", lineString);
            }

            writer.WriteEndElement();
        }
示例#29
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!String.IsNullOrEmpty(Image))
                {
                    writer.WriteAttributeString("image", Image);
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (!String.IsNullOrEmpty(Url))
                {
                    writer.WriteAttributeString("url", Url);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
示例#30
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(BaseUrl))
                {
                    writer.WriteAttributeString("baseurl", BaseUrl);
                }

                if (!String.IsNullOrEmpty(Name))
                {
                    writer.WriteAttributeString("name", Name);
                }

                if (!String.IsNullOrEmpty(Path))
                {
                    writer.WriteAttributeString("path", Path);
                }

                if (Type != ImageType.Default)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(ImageType), Type));
                }

                if (!String.IsNullOrEmpty(Url))
                {
                    writer.WriteAttributeString("url", Url);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }