Пример #1
0
 public static CoordSys CreateCoordSys(
     CoordSysType type,
     Datum datum,
     /*double originLongitude,
     double originLatitude,
     double standardParallelOne,
     double standardParallelTwo,
     double azimuth,
     double scaleFactor,
     double falseEasting,
     double falseNorthing,
     double range,*/
     AffineTransform affineTransform)
 {
     CoordSys oCS = new CoordSys(type, datum, affineTransform);
     return oCS;
 }
Пример #2
0
        public static CoordSys CreateCoordSys(string name)
        {
            if (name == "Mercator Datum(WGS84)")
            {
                AffineTransform at = new AffineTransform();

                // uklad wsp:
                // at zamiania wgs84 na px (256x256) i dalej na [m]
            //                at.MultiplyInPlace(256.0 / 360.0, -256.0 / 180.0);
            //                at.OffsetInPlace(-128, 128);
            //                at.MultiplyInPlace(Math.PI * r / 180, Math.PI * r / 180.0);

                CoordSys oCS = new CoordSys(CoordSysType.Mercator, new Datum(DatumID.WGS84), at);
                return oCS;
            }
            else
                throw new Exception("Unsupported coordsys");
        }
Пример #3
0
        private double zoomElevateUpscale = 1024 * 8; //1024;

        #endregion Fields

        #region Constructors

        public LayerTiles()
        {
            Datum datumWGS84Sphere = CoordSysFactory.CreateDatum(Ellipsoid.Sphere, 0, 0, 0, 0, 0, 0, 0, 0);

            double r = datumWGS84Sphere.SemiMajorAxis;

            // scale =256/360, offset=128, this is calculated for zoom=0 (one tile)
            // converts merc deg (-180;180 , -90;90) into pixels (0;256 , 0;256)
            AffineTransform affineTransform = new AffineTransform();
            //zoomElevate = 1024; // zwieksz gestosc wspolrzednych o 10 pozomow zoom
            //            affineTransform.MultiplyInPlace(256.0 / 360.0 * zoomElevateUpscale, -256.0 / 360.0 * zoomElevateUpscale);
            //            affineTransform.OffsetInPlace(-128, 128);

            affineTransform.MultiplyInPlace(256.0 / (2.0 * Math.PI * r) * zoomElevateUpscale, -256.0 / (2.0 * Math.PI * r) * zoomElevateUpscale);
            affineTransform.OffsetInPlace(128 * zoomElevateUpscale, 128 * zoomElevateUpscale);

            layerCoordSys = new CoordSys(CoordSysType.Mercator, datumWGS84Sphere, affineTransform);

            // depending o tile zoom lever (1,2,3,...,17) there is different AT

            // tiles loader
            WindowsFormsImageProxy wimg = new WindowsFormsImageProxy();
            GMaps.Instance.ImageProxy = wimg;
        }
Пример #4
0
        public Map(Control oParentControl)
        {
            m_oParentControl = oParentControl;

            DisplayCoordSys = new CoordSys(CoordSysType.Mercator, new Datum(DatumID.WGS84), new AffineTransform());
        }
Пример #5
0
 bool Equal(CoordSys coordSys)
 {
     if (type != coordSys.type) return false;
     return true;
 }
Пример #6
0
 public CoordSys Clone()
 {
     CoordSys oCS = new CoordSys(type, datum, affineTransform);
     return oCS;
 }