Exemplo n.º 1
0
        /// <summary>
        /// This method populates the given sink with the data from this geography instance
        /// </summary>
        /// <param name="sink">Sink to be populated</param>
        public override void Populate(IGeographySink110 sink)
        {
            if (OuterRing?.Points == null || OuterRing.Points.Count == 0)
            {
                return;
            }

            sink.BeginGeography(OpenGisGeographyType.Polygon);

            // Populates the outer boundary
            sink.BeginFigure(
                OuterRing.Points[0].Latitude,
                OuterRing.Points[0].Longitude,
                OuterRing.Points[0].Altitude,
                OuterRing.Points[0].Measure);

            for (var i = 1; i < OuterRing.Points.Count; i++)
            {
                sink.AddLine(
                    OuterRing.Points[i].Latitude,
                    OuterRing.Points[i].Longitude,
                    OuterRing.Points[i].Altitude,
                    OuterRing.Points[i].Measure);
            }

            sink.EndFigure();

            if (InnerRing != null && InnerRing.Count > 0)
            {
                // Populates the inner boundaries

                foreach (var linearRing in InnerRing)
                {
                    if (linearRing.Points == null || linearRing.Points.Count == 0)
                    {
                        continue;
                    }

                    sink.BeginFigure(
                        linearRing.Points[0].Latitude,
                        linearRing.Points[0].Longitude,
                        linearRing.Points[0].Altitude,
                        linearRing.Points[0].Measure);

                    for (var i = 1; i < linearRing.Points.Count; i++)
                    {
                        sink.AddLine(
                            linearRing.Points[i].Latitude,
                            linearRing.Points[i].Longitude,
                            linearRing.Points[i].Altitude,
                            linearRing.Points[i].Measure);
                    }

                    sink.EndFigure();
                }
            }

            sink.EndGeography();
        }
        /// <summary>
        /// This method populates the given sink with the data from this geography instance
        /// </summary>
        /// <param name="sink">Sink to be populated</param>
        public override void Populate(IGeographySink110 sink)
        {
            CheckCoordinates();

            // The coordinates for this geography instance will be:
            // (west, south), (east, south), (east, north), (west, north), (west, south)
            sink.BeginGeography(OpenGisGeographyType.Polygon);

            // (west, south)
            sink.BeginFigure(South, West, Altitude, Measure);

            // (east, south)
            sink.AddLine(South, East, Altitude, Measure);

            // (east, north)
            sink.AddLine(North, East, Altitude, Measure);

            // (west, north)
            sink.AddLine(North, West, Altitude, Measure);

            // (west, south)
            sink.AddLine(South, West, Altitude, Measure);

            sink.EndFigure();

            sink.EndGeography();
        }
Exemplo n.º 3
0
 public void BeginFigure(double x, double y, double?z, double?m)
 {
     _sink.BeginGeography(OpenGisGeographyType.Point);
     _sink.BeginFigure(y, x, z, m);
     _sink.EndFigure();
     _sink.EndGeography();
 }
 public void BeginFigure(double latitude, double longitude, double?z, double?m)
 {
     if (_depth == 0)
     {
         _sink.BeginFigure(latitude, longitude, z, m);
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// This method populates the given sink with the data about this geography instance
        /// </summary>
        /// <param name="sink">Sink to be populated</param>
        public override void Populate(IGeographySink110 sink)
        {
            sink.BeginGeography(OpenGisGeographyType.Point);
            sink.BeginFigure(Latitude, Longitude, Altitude, Measure);

            sink.EndFigure();
            sink.EndGeography();
        }
 public void BeginFigure(double latitude, double longitude, double?z, double?m)
 {
     while (_types.Count > 0)
     {
         _sink.BeginGeography(_types.Dequeue());
     }
     _sink.BeginFigure(latitude, longitude, z, m);
 }
 public void BeginFigure(double latitude, double longitude, double?z, double?m)
 {
     if (_insidePolygon)
     {
         _figure.Clear();
         _figure.Add(new Vertex(latitude, longitude, z, m));
     }
     else
     {
         _sink.BeginFigure(latitude, longitude, z, m);
     }
 }
        /// <summary>
        /// This method populates the given sink with the data from this geography instance
        /// </summary>
        /// <param name="sink">Sink to be populated</param>
        public override void Populate(IGeographySink110 sink)
        {
            if (Points == null || Points.Count == 0)
            {
                return;
            }

            sink.BeginGeography(GeographyType);
            sink.BeginFigure(Points[0].Latitude, Points[0].Longitude, Points[0].Altitude, Points[0].Measure);

            for (var i = 1; i < Points.Count; i++)
            {
                sink.AddLine(Points[i].Latitude, Points[i].Longitude, Points[i].Altitude, Points[i].Measure);
            }

            sink.EndFigure();
            sink.EndGeography();
        }
 public void BeginFigure(double x, double y, double?z, double?m)
 {
     _projection.UnprojectPoint(x, y, out double latitude, out double longitude);
     _sink.BeginFigure(latitude, longitude, z, m);
 }
Exemplo n.º 10
0
 public void BeginFigure(IGeographySink110 sink)
 {
     sink.BeginFigure(_x, _y, _z, _m);
 }
 // Each BeginFigure call will just move the start point by the required amount.
 public void BeginFigure(double x, double y, double?z, double?m)
 {
     _target.BeginFigure(x, y, _z, m);
 }
 public void BeginFigure(double latitude, double longitude, double?z, double?m)
 {
     // Starting the figure, remembering the vector that corresponds to the first point.
     _startPoint = SpatialUtil.SphericalDegToCartesian(latitude, longitude);
     _sink.BeginFigure(latitude, longitude, z, m);
 }
Exemplo n.º 13
0
 public void BeginFigure(double latitude, double longitude, double?z, double?m)
 {
     _targetSink?.BeginFigure(latitude, longitude, z, m);
 }