TransWikia.com

Cesium Polygon entity get all positions and holes

Geographic Information Systems Asked by MK83 on December 28, 2020

I could not find a nice way to get the all positions and holes from Cesium polygon (see the coordinates structure in attached image), and as far as possible not to use recursive function to get all the coordinates. Also checked API and there is nothing that I can use, ex. "getCoordiantes" or something like that.

Usage to check all the coordinates height for comparing.

Here is also the GeoJSON example:

{
    "type": "FeatureCollection",
    "features": [{
        "type": "Feature",
        "properties": {
            "dataType": "AirspaceType",
            "geometryExtension": {
                "extruded": {
                    "maxHeight": 10000,
                    "minHeight": 0
                }
            },
            "id": "d50b2df0-9447-4a27-8710-eb62dff66ade",
            "name": "Unnamed Layer",
            "category": "default"
        },
        "geometry": {
            "type": "Polygon",
            "coordinates": [
                [
                    [0, 0, 0],
                    [0.2, 0, 0],
                    [0.2, 0.2, 0],
                    [0, 0.2, 0],
                    [0, 0, 0]
                ],
                [
                    [0.03504, 0.096817],
                    [0.035384, 0.18917],
                    [0.18132, 0.18917],
                    [0.174109, 0.020599],
                    [0.03504, 0.096817]
                ],
                [
                    [0.059077, 0.100937],
                    [0.059077, 0.173034],
                    [0.157283, 0.173034],
                    [0.157283, 0.100937],
                    [0.059077, 0.100937]
                ],
                [
                    [0.07968, 0.154838],
                    [0.13153, 0.156555],
                    [0.136681, 0.124626],
                    [0.094102, 0.118446],
                    [0.07968, 0.154838]
                ]
            ]
        }
    }]
}

Cesium structure for polygon

One Answer

Use myEntity.polygon.hierarchy.valueOf();

See this working Cesium Sandcastle example

Answered by A. Mort on December 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP