示例#1
0
        /// <summary>
        /// Writes a Geometry as KML to a string, using
        /// a specified Z value.
        /// </summary>
        /// <param name="geometry">the geometry to write</param>
        /// <param name="z">the Z value to use</param>
        /// <returns>a string containing the KML geometry representation</returns>
        public static string WriteGeometry(IGeometry geometry, double z)
        {
            KMLWriter writer = new KMLWriter {
                Z = z
            };

            return(writer.Write(geometry));
        }
示例#2
0
        /// <summary>
        /// Writes a Geometry as KML to a string, using
        /// a specified Z value, precision, extrude flag,
        /// and altitude mode code.
        /// </summary>
        /// <param name="geometry">the geometry to write</param>
        /// <param name="z">the Z value to use</param>
        /// <param name="precision">the maximum number of decimal places to write</param>
        /// <param name="extrude">the extrude flag to write</param>
        /// <param name="altitudeMode">the altitude model code to write</param>
        /// <returns>a string containing the KML geometry representation</returns>
        public static string WriteGeometry(IGeometry geometry, double z, int precision,
                                           bool extrude, string altitudeMode)
        {
            KMLWriter writer = new KMLWriter
            {
                Z            = z,
                Precision    = precision,
                Extrude      = extrude,
                AltitudeMode = altitudeMode
            };

            return(writer.Write(geometry));
        }
示例#3
0
 /// <summary>
 /// Writes a Geometry as KML to a string, using
 /// a specified Z value.
 /// </summary>
 /// <param name="geometry">the geometry to write</param>
 /// <param name="z">the Z value to use</param>
 /// <returns>a string containing the KML geometry representation</returns>
 public static string WriteGeometry(IGeometry geometry, double z)
 {
     KMLWriter writer = new KMLWriter { Z = z };
     return writer.Write(geometry);
 }
示例#4
0
 /// <summary>
 /// Writes a Geometry as KML to a string, using
 /// a specified Z value, precision, extrude flag,
 /// and altitude mode code.
 /// </summary>
 /// <param name="geometry">the geometry to write</param>
 /// <param name="z">the Z value to use</param>
 /// <param name="precision">the maximum number of decimal places to write</param>
 /// <param name="extrude">the extrude flag to write</param>
 /// <param name="altitudeMode">the altitude model code to write</param>
 /// <returns>a string containing the KML geometry representation</returns>
 public static string WriteGeometry(IGeometry geometry, double z, int precision,
     bool extrude, string altitudeMode)
 {
     KMLWriter writer = new KMLWriter
     {
         Z = z,
         Precision = precision,
         Extrude = extrude,
         AltitudeMode = altitudeMode
     };
     return writer.Write(geometry);
 }
 private void CheckEqual(KMLWriter writer, IGeometry geom, string expected)
 {
     string actual = writer.Write(geom);
     string actualNorm = normalizeKML(actual);
     string expectedNorm = normalizeKML(expected);
     bool isEqual = String.Equals(actualNorm, expectedNorm, StringComparison.InvariantCultureIgnoreCase);
     Assert.IsTrue(isEqual, String.Format("\nGenerated KML:  {0}\n  Expected KML: {1}", actualNorm, expectedNorm));
 }