Exemplo n.º 1
0
 public utmpos(PointLatLngAlt pos)
 {
     double[] dd = pos.ToUTM();
     this.x    = dd[0];
     this.y    = dd[1];
     this.zone = pos.GetUTMZone();
     this.Tag  = null;
 }
Exemplo n.º 2
0
        double[] convertCoords(PointLatLngAlt plla)
        {
            if (utmzone < -360)
            {
                utmzone = plla.GetUTMZone();
            }

            var utm = plla.ToUTM(utmzone);

            Array.Resize(ref utm, 3);

            utm[2] = plla.Alt;

            return(utm);
        }
Exemplo n.º 3
0
        double[] convertCoords(PointLatLngAlt plla)
        {
            if (utmzone != plla.GetUTMZone())
            {
                utmzone = plla.GetUTMZone();

                utmcenter = plla.ToUTM(utmzone);

                textureid.ForEach(a => a.Value.Cleanup());

                textureid.Clear();
            }

            var utm = plla.ToUTM(utmzone);

            Array.Resize(ref utm, 3);

            utm[0] -= utmcenter[0];
            utm[1] -= utmcenter[1];

            utm[2] = plla.Alt;

            return(new[] { utm[0], utm[1], utm[2] });
        }
Exemplo n.º 4
0
        double[] convertCoords(PointLatLngAlt plla)
        {
            if (utmzone < -360)
            {
                utmzone = plla.GetUTMZone();
            }

            var minlat = (int)plla.Lat - 1;
            var maxlat = (int)plla.Lat + 1;
            var minlng = (int)plla.Lng - 1;
            var maxlng = (int)plla.Lng + 1;

            var id       = maxlat * 1e10 + minlng;
            var diagdist = 0.0;

            if (!coordcache.ContainsKey(id))
            {
                diagdist       = new PointLatLngAlt(maxlat, minlng).GetDistance(new PointLatLngAlt(minlat, maxlng));
                coordcache[id] = diagdist;
            }
            else
            {
                diagdist = coordcache[id];
            }

            var lat = MathHelper.map(plla.Lat, minlat, maxlat, 0, diagdist);
            var lng = MathHelper.map(plla.Lng, minlng, maxlng, 0, diagdist);

            //var utm = plla.ToUTM(utmzone);

            //Array.Resize(ref utm, 3);

            //utm[2] = plla.Alt;

            return(new[] { lng, lat, plla.Alt });
        }