示例#1
0
        public abstract int GetLength(Geometry geometry);          //length in 16bit words

        public static Envelope GetEnvelopeExternal(PrecisionModel precisionModel, Envelope envelope)
        {
            // get envelopse in external coordinates
            Coordinate min = new Coordinate(envelope.MinX, envelope.MinY);
            Coordinate max = new Coordinate(envelope.MaxX, envelope.MaxY);

            min = precisionModel.ToExternal(min);
            max = precisionModel.ToExternal(max);
            Envelope bounds = new Envelope(min.X, max.X, min.Y, max.Y);

            return(bounds);
        }
示例#2
0
        /// <summary>
        /// Converts a Coordinate to &lt;Point&gt; format, then Appends
        /// it to the writer.
        /// </summary>
        /// <param name="coordinate">The Coordinate to process.</param>
        /// <param name="writer">The output writer to Append to.</param>
        /// <param name="precisionModel">The PrecisionModel to use to convert
        /// from a precise coordinate to an external coordinate</param>
        protected void AppendCoordinate(Coordinate coordinate, StringWriter writer, PrecisionModel precisionModel)
        {
            Coordinate externalCoordinate = new Coordinate();

            precisionModel.ToExternal(coordinate, externalCoordinate);
            writer.Write(WriteNumber(externalCoordinate.X) + " " + WriteNumber(externalCoordinate.Y));
        }
示例#3
0
        /// <summary>
        /// Converts a Coordinate to &lt;Point&gt; format, then Appends
        /// it to the writer.
        /// </summary>
        /// <param name="coordinate">The Coordinate to process.</param>
        /// <param name="writer">The output writer to Append to.</param>
        /// <param name="precisionModel">The PrecisionModel to use to convert
        /// from a precise coordinate to an external coordinate</param>
        protected void AppendCoordinate(Coordinate coordinate, TextWriter writer, PrecisionModel precisionModel)
        {
            //throw new NotFiniteNumberException();
            Coordinate externalCoordinate = new Coordinate();

            precisionModel.ToExternal(coordinate, externalCoordinate);
            writer.Write(" " + WriteNumber(externalCoordinate.X) + " " + WriteNumber(externalCoordinate.Y));
            //writer.Write(WriteNumber(coordinate.X) + " " + WriteNumber(coordinate.Y));
        }
示例#4
0
        /// <summary>
        /// Converts a Coordinate to &lt;Point Tagged Text&gt; format,
        /// then Appends it to the writer.
        /// </summary>
        /// <param name="coordinate">the <code>Coordinate</code> to process</param>
        /// <param name="writer">the output writer to Append to</param>
        /// <param name="precisionModel">the PrecisionModel to use to convert
        ///  from a precise coordinate to an external coordinate</param>
        protected void AppendPointTaggedText(Coordinate coordinate, TextWriter writer, PrecisionModel precisionModel)
        {
            Coordinate externalCoordinate = new Coordinate();

            precisionModel.ToExternal(coordinate, externalCoordinate);
            if (this._cssClass != "")
            {
                writer.WriteLine(String.Format("<{5}circle class=\"{0}\" style=\"{1}\" cx=\"{2}\" cy=\"{3}\" r=\"{4}\"/>", _cssClass, _style, WriteNumber(externalCoordinate.X), WriteNumber(externalCoordinate.Y), _radius, _namespace));
            }
            else
            {
                writer.WriteLine(String.Format("<{4}circle  style=\"{0}\" cx=\"{1}\" cy=\"{2}\" r=\"{3}\"/>", _style, WriteNumber(externalCoordinate.X), WriteNumber(externalCoordinate.Y), _radius, _namespace));
            }
        }