예제 #1
0
        internal static void RunTest(MapFile mapFile)
        {
            int  tileX = MercatorProjection.LongitudeToTileX(0, ZOOM_LEVEL);
            int  tileY = MercatorProjection.LatitudeToTileY(0, ZOOM_LEVEL);
            Tile tile  = new Tile(tileX, tileY, ZOOM_LEVEL, 256);

            MapReadResult mapReadResult = mapFile.ReadMapData(tile);

            mapFile.Close();

            Assert.AreEqual(mapReadResult.PointOfInterests.Count, 0);
            Assert.AreEqual(1, mapReadResult.Ways.Count);

            LatLong latLong1 = new LatLong(0.0, 0.0, true);
            LatLong latLong2 = new LatLong(0.0, 0.1, true);
            LatLong latLong3 = new LatLong(-0.1, 0.1, true);
            LatLong latLong4 = new LatLong(-0.1, 0.0, true);

            LatLong[][] latLongsExpected = new LatLong[][]
            {
                new LatLong[] { latLong1, latLong2, latLong3, latLong4, latLong1 }
            };

            Way way = mapReadResult.Ways[0];

            // TODO: Was ArrayEquals()
            Assert.AreEqual(latLongsExpected, way.LatLongs);
        }
예제 #2
0
 internal PolylineContainer(Way way, Tile tile)
 {
     this.coordinatesAbsolute       = null;
     this.coordinatesRelativeToTile = null;
     this.tags = way.Tags;
     this.tile = tile;
     layer     = way.Layer;
     this.way  = way;
     this.isClosedWay_Renamed = IsClosedWay(way.LatLongs[0]);
 }
        private static void CheckWay(Way way)
        {
            Assert.AreEqual(4, way.Layer);
            Assert.Null(way.LabelPosition);

            LatLong latLong1 = new LatLong(0.00, 0.00, true);
            LatLong latLong2 = new LatLong(0.04, 0.08, true);
            LatLong latLong3 = new LatLong(0.08, 0.00, true);

            LatLong[][] latLongsExpected = new LatLong[][]
            {
                new LatLong[] { latLong1, latLong2, latLong3 }
            };

            AssertLatLongsEquals(latLongsExpected, way.LatLongs);
            Assert.AreEqual(3, way.Tags.Count);
            Assert.True(way.Tags.Contains(new Tag("highway=motorway")));
            Assert.True(way.Tags.Contains(new Tag("name=ÄÖÜ")));
            Assert.True(way.Tags.Contains(new Tag("ref=äöü")));
        }