Exemple #1
0
        /// <summary>
        /// Compares the current OSMObject with the specified object for equivalence.
        /// </summary>
        /// <param name="obj">The object to test for equivalence with the current object.</param>
        /// <returns>true if the OSMTag objects are equal, otherwise returns false.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj is OSMObject)
            {
                OSMObject other = (OSMObject)obj;

                return(_id.Equals(other._id));
            }
            else
            {
                return(base.Equals(obj));
            }
        }
        /// <summary>
        /// Writes OSMObject tags to the output
        /// </summary>
        /// <param name="item">OSMObject thats tags to be written to the output.</param>
        protected void WriteOSMObjectTags(OSMObject item)
        {
            foreach (OSMTag tag in item.Tags) {
                _xmlWriter.WriteStartElement("tag");

                _xmlWriter.WriteAttributeString("k", tag.Key);
                _xmlWriter.WriteAttributeString("v", tag.Value);

                _xmlWriter.WriteEndElement();
            }
        }
 /// <summary>
 /// Writes OSMObject attributes to the output
 /// </summary>
 /// <param name="item">OSMObject thats attibutes to be written to the output.</param>
 protected void WriteOSMObjectAttributes(OSMObject item)
 {
     _xmlWriter.WriteAttributeString("id", item.ID.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
     _xmlWriter.WriteAttributeString("visible", "true");
 }