Esempio n. 1
0
    public bool IsSubset(LegLatLngBox box)
    {
        var ll1 = new LegLatLng(box.latmin, box.lngmin);

        if (!IsIn(ll1))
        {
            return(false);
        }
        var ll2 = new LegLatLng(box.latmax, box.lngmax);

        if (!IsIn(ll2))
        {
            return(false);
        }
        return(true);
    }
Esempio n. 2
0
    public void InitMapFromLatLongBox(LegLatLngBox latLngBox, int lod)
    {
        mapcoord = new LegMapCoordblock(this);
        var llbl        = latLngBox.GetBottomLeft();
        var llul        = latLngBox.GetUpperLeft();
        var llbr        = latLngBox.GetBottomRight();
        var llur        = latLngBox.GetUpperRight();
        var llmp        = latLngBox.GetMidPoint();
        var pixToMeters = TileSystem.GroundResolution(llmp.lat, lod);
        var orgpix      = llbl.GetPixelCoords(lod);
        var orgmeters   = new Vector2d(orgpix.x * pixToMeters, orgpix.y * pixToMeters);

        mapcoord.AddRowLngLat(llbl, lod, pixToMeters, orgmeters);
        mapcoord.AddRowLngLat(llul, lod, pixToMeters, orgmeters);
        mapcoord.AddRowLngLat(llbr, lod, pixToMeters, orgmeters);
        mapcoord.AddRowLngLat(llur, lod, pixToMeters, orgmeters);
        mapcoord.AddRowLngLat(llmp, lod, pixToMeters, orgmeters);
        glbllm      = this;
        maps.latmap = mapcoord.DoRegression("lat = x + z");
        maps.lngmap = mapcoord.DoRegression("lng = x + z");
        maps.xmap   = mapcoord.DoRegression("x = lng + lat");
        maps.zmap   = mapcoord.DoRegression("z = lng + lat");
    }