question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set Classification Type on GeoJSON Entities

See original GitHub issue

Currently, there’s no way to set the classificationType on entities created from GeoJSONs. The reason you’d want this is if you’re using GeoJSONs to classify your 3D Tiles.

For example, this example uses the experimental 3D Tiles Vector format:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=3D Tiles Terrain Classification.html&label=All

But since no tools exist that can output this, you can’t actually do something like this in your own applications in CesiumJS. But you can totally do it if expose an option on GeoJSONDataSource to set the classification type.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
OmarShehatacommented, Oct 31, 2018

That’s fine then! That means there’s only one type to worry about (polygons). I think I saw some confusion on the forum about the difference between datasources and entities (the users weren’t aware that a datasource created entities) but it sounds like I can fix that by explaining in the doc/tutorials. That Sandcastle is definitely a good resource.

0reactions
Tonynovtopcommented, Nov 22, 2018

I tried,but it didn’t work @hpinkos, can you help me check it.the code is here: var tileset = new Cesium.Cesium3DTileset({ url: ‘…/…/…/data/20181102/tileset.json’, maximumScreenSpaceError: 2, maximumNumberOfLoadedTiles: 1000 }); viewer.scene.primitives.add(tileset); var buildingsPromise = Cesium.GeoJsonDataSource.load(‘…/…/…/data/test.json’); buildingsPromise.then(function (dataSource) { viewer.dataSources.add(dataSource); var buildings = dataSource.entities;

    var buildingsEntities = dataSource.entities.values;
    for (var i = 0;i < buildingsEntities.length;i++) {
        var entity = buildingsEntities[i];

        if(Cesium.defined(entity.polygon)) {
            entity.name = entity.properties.Id;
            entity.polygon.material = Cesium.Color.fromRandom({
                red : 0.2,
                minimumGreen : 0.5,
                maximumBlue : 0.5,
                alpha : 0.6
            });
            entity.polygon.outline = false;
            entity.polygon.classificationType = Cesium.ClassificationType.CESIUM_3D_TILE
        };
    }
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Set Classification Type on GeoJSON Entities #7208 - GitHub
Currently, there's no way to set the classificationType on entities created from GeoJSONs. The reason you'd want this is if you're using ...
Read more >
Set classification type on geojson entities,but failed. - CesiumJS
Your code is working for me. Please explain what failed means. Don't forget to include the version of CesiumJS, the browser version, and ......
Read more >
A primer on GeoJSON standard and visualization tools
Simply put, GeoJSON gives you an easy format for representing simple geographical ... Point, LineString and Polygon shapes are also known as single...
Read more >
Geojson floating and shifting on the terrain - Google Groups
This also has the advantage of more control over styling and classification of individual entities, based on feature property values, than bulk loading...
Read more >
GeoJSON classification - expert.ai Natural Language API
The geotax document classification resources can be used in a standard way, composing their endpoints as indicated in the article in the reference...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found