private static IEnumerable <uint> Encode(IPuntal puntal, TileGeometryTransform tgt)
        {
            const int CoordinateIndex = 0;

            var geometry = (Geometry)puntal;
            int currentX = 0, currentY = 0;

            var parameters = new List <uint>();

            for (int i = 0; i < geometry.NumGeometries; i++)
            {
                var point = (Point)geometry.GetGeometryN(i);
                (int x, int y) = tgt.Transform(point.CoordinateSequence, CoordinateIndex, ref currentX, ref currentY);
                if (i == 0 || x > 0 || y > 0)
                {
                    parameters.Add(GenerateParameterInteger(x));
                    parameters.Add(GenerateParameterInteger(y));
                }
            }

            // Return result
            yield return(GenerateCommandInteger(MapboxCommandType.MoveTo, parameters.Count / 2));

            foreach (uint parameter in parameters)
            {
                yield return(parameter);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Method to render the Point to the <see cref="Graphics"/> object.
 /// </summary>
 /// <param name="map">The map object</param>
 /// <param name="points">Location where to render the Symbol</param>
 /// <param name="g">The graphics object to use.</param>
 public void Render(MapViewport map, IPuntal points, Graphics g)
 {
     foreach (var pointSymbolizer in Items)
     {
         pointSymbolizer.Render(map, points, g);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Method to render the Point to the <see cref="Graphics"/> object.
        /// </summary>
        /// <param name="map">The map object</param>
        /// <param name="points">Location where to render the Symbol</param>
        /// <param name="g">The graphics object to use.</param>
        public void Render(MapViewport map, IPuntal points, Graphics g)
        {
            var combinedArea = RectangleF.Empty;

            foreach (var pointSymbolizer in Items)
            {
                pointSymbolizer.Render(map, points, g);
                combinedArea = pointSymbolizer.CanvasArea.ExpandToInclude(combinedArea);
            }
            CanvasArea = combinedArea;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Function to render the geometry
        /// </summary>
        /// <param name="map">The map object, mainly needed for transformation purposes.</param>
        /// <param name="geometry">The geometry to symbolize.</param>
        /// <param name="graphics">The graphics object to use.</param>
        public void Render(MapViewport map, IPuntal geometry, Graphics graphics)
        {
            var mp = geometry as IMultiPoint;

            if (mp != null)
            {
                foreach (var point in mp.Coordinates)
                {
                    RenderPoint(map, point, graphics);
                }
                return;
            }
            RenderPoint(map, ((IPoint)geometry).Coordinate, graphics);
        }
Ejemplo n.º 5
0
        public void Render(Map map, IPuntal geometry, Graphics graphics)
        {
            var mp = geometry as MultiPoint;

            if (mp != null)
            {
                foreach (Point point in mp.Points)
                {
                    RenderPoint(map, point, graphics);
                }
                return;
            }
            RenderPoint(map, geometry as Point, graphics);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Function to render the geometry
        /// </summary>
        /// <param name="map">The map object, mainly needed for transformation purposes.</param>
        /// <param name="geometry">The geometry to symbolize.</param>
        /// <param name="graphics">The graphics object to use.</param>
        public void Render(MapViewport map, IPuntal geometry, Graphics graphics)
        {
            var mp = geometry as IMultiPoint;

            if (mp != null)
            {
                var combinedArea = RectangleF.Empty;
                foreach (var point in mp.Coordinates)
                {
                    RenderPoint(map, point, graphics);
                    combinedArea = CanvasArea.ExpandToInclude(combinedArea);
                }
                CanvasArea = combinedArea;
                return;
            }
            RenderPoint(map, ((IPoint)geometry).Coordinate, graphics);
        }
Ejemplo n.º 7
0
 public PreparedPoint(IPuntal point)
     : base((IGeometry)point)
 {
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Function to render the geometry
        /// </summary>
        /// <param name="map">The map object, mainly needed for transformation purposes.</param>
        /// <param name="geometry">The geometry to symbolize.</param>
        /// <param name="graphics">The graphics object to use.</param>
        public void Render(Map map, IPuntal geometry, IGraphics graphics)
        {
            var mp = geometry as IMultiPoint;
            if (mp != null)
            {
                foreach (var point in mp.Coordinates)
                    RenderPoint(map, point, graphics);
                return;
            }
            RenderPoint(map, ((IPoint)geometry).Coordinate, graphics);

        }
 ///<summary>
 /// Computes the union of a <see cref="IPoint"/> geometry with 
 /// another arbitrary <see cref="IGeometry"/>.
 /// Does not copy any component geometries.
 ///</summary>
 ///<param name="pointGeom"></param>
 ///<param name="otherGeom"></param>
 ///<returns></returns>
 public static IGeometry Union(IPuntal pointGeom, IGeometry otherGeom)
 {
     var unioner = new PointGeometryUnion(pointGeom, otherGeom);
     return unioner.Union();
 }
 public PointGeometryUnion(IPuntal pointGeom, IGeometry otherGeom)
 {
     _pointGeom = (IGeometry)pointGeom;
     _otherGeom = otherGeom;
     _geomFact = otherGeom.Factory;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Computes the union of a <see cref="Point"/> geometry with
        /// another arbitrary <see cref="Geometry"/>.
        /// Does not copy any component geometries.
        /// </summary>
        /// <param name="pointGeom"></param>
        /// <param name="otherGeom"></param>
        /// <returns></returns>
        public static Geometry Union(IPuntal pointGeom, Geometry otherGeom)
        {
            var unioner = new PointGeometryUnion(pointGeom, otherGeom);

            return(unioner.Union());
        }
Ejemplo n.º 12
0
 public PointGeometryUnion(IPuntal pointGeom, Geometry otherGeom)
 {
     _pointGeom = (Geometry)pointGeom;
     _otherGeom = otherGeom;
     _geomFact  = otherGeom.Factory;
 }
Ejemplo n.º 13
0
 public PreparedPoint(IPuntal point)
     : base((IGeometry)point)
 {
 }
Ejemplo n.º 14
0
        public void Render(Map map, IPuntal geometry, Graphics graphics)
        {
            var mp = geometry as MultiPoint;
            if (mp != null)
            {
                foreach (Point point in mp.Points)
                    RenderPoint(map, point, graphics);
                return;
            }
            RenderPoint(map, geometry as Point, graphics);

        }