public void TestManholesPropertiesPdok()
    {
        Config.activeConfiguration = new ConfigurationFile();
        Config.activeConfiguration.sewerageApiType = Amsterdam3D.Sewerage.SewerageApiType.Pdok;
        SewerageLayer seweragelayer = new SewerageLayer();

        GeoJSON geojson = new GeoJSON(testStringManholesPdok);

        geojson.GotoNextFeature();
        var putdekselhoogte1 = geojson.getPropertyFloatValue(seweragelayer.PutdekselhoogteString);
        var point1           = geojson.getGeometryPoint2DDouble();

        Assert.AreEqual(1.530, putdekselhoogte1, 0.001);
        Assert.AreEqual(2, point1.Length);
        Assert.AreEqual(132303.35, point1[0], 0.001);
        Assert.AreEqual(457990.35, point1[1], 0.001);

        geojson.GotoNextFeature();
        var putdekselhoogte2 = geojson.getPropertyFloatValue(seweragelayer.PutdekselhoogteString);
        var point2           = geojson.getGeometryPoint2DDouble();

        Assert.AreEqual(1.540, putdekselhoogte2, 0.001);
        Assert.AreEqual(2, point2.Length);
        Assert.AreEqual(132347.73, point2[0], 0.001);
        Assert.AreEqual(457958.06, point2[1], 0.001);
    }
    public void TestManholesPropertiesAmsterdam()
    {
        Config.activeConfiguration = new ConfigurationFile();
        Config.activeConfiguration.sewerageApiType = Amsterdam3D.Sewerage.SewerageApiType.Amsterdam;
        SewerageLayer seweragelayer = new SewerageLayer();

        GeoJSON geojson = new GeoJSON(testStringManholesAmsterdam);

        geojson.GotoNextFeature();
        var putdekselhoogte1 = geojson.getPropertyFloatValue(seweragelayer.PutdekselhoogteString);
        var point1           = geojson.getGeometryPoint2DDouble();

        Assert.AreEqual(0.20, putdekselhoogte1, 0.001);
        Assert.AreEqual(2, point1.Length);
        Assert.AreEqual(4.91561158208928, point1[0], 0.001);
        Assert.AreEqual(52.342962335247, point1[1], 0.001);

        geojson.GotoNextFeature();
        var putdekselhoogte2 = geojson.getPropertyFloatValue(seweragelayer.PutdekselhoogteString);
        var point2           = geojson.getGeometryPoint2DDouble();

        Assert.AreEqual(0.68, putdekselhoogte2, 0.001);
        Assert.AreEqual(2, point2.Length);
        Assert.AreEqual(4.90876406244186, point2[0], 0.001);
        Assert.AreEqual(52.3425051475584, point2[1], 0.001);
    }
示例#3
0
        private IEnumerator SpawnManHoleObjects(string geoJSONtext, TileChange tileChange, Tile tile, System.Action <TileChange> callback = null)
        {
            tile.gameObject.SetActive(isEnabled);
            GeoJSON customJsonHandler = new GeoJSON(geoJSONtext);

            yield return(null);

            double[] point2D;
            Vector3  point;

            int parseCounter = 0;

            while (customJsonHandler.GotoNextFeature())
            {
                parseCounter++;
                if ((parseCounter % maxParsesPerFrame) == 0)
                {
                    yield return(new WaitForEndOfFrame());
                }
                if (customJsonHandler.PropertyValueStringEquals("objectsoort", "Knikpunt"))
                {
                    point2D = customJsonHandler.getGeometryPoint2DDouble();

                    double putdekselhoogte = customJsonHandler.getPropertyFloatValue("putdekselhoogte");
                    point = ConvertCoordinates.CoordConvert.WGS84toUnity(new Vector3WGS(point2D[0], point2D[1], putdekselhoogte + Config.activeConfiguration.zeroGroundLevelY));
                    sewerManholeSpawner.CreateManhole(point, 1.50f, tile.gameObject);
                }
            }
            StartCoroutine(CombineSewerage(tileChange, tile, callback));
        }