Hide or remove the rest map?

Hello, we are making a specific area project, and we need to remove or better hide the rest earth map and objects (buildings etc).

also prevent camera to move outside the specific area.

any tips? thank you in advance

Hi @maxtorgr,

Thank you for your question!

To remove Cesium World Terrain, simply add the following line to your code:

viewer.scene.terrainProvider = false;

Here is a sandcastle example that showcases how this can be implemented.

I recommend using the member position of the Camera object to restrict where the Camera travels. Here is our documentation for Camera:

https://cesium.com/learn/cesiumjs/ref-doc/Camera.html?classFilter=camera#position

Please let me know if you have any other questions or concerns. I am looking forward to learning more about your application.

-Sam

https://i.ibb.co/hY4dKTY/Screenshot-37.png

How to remove this? we need only Manhattan.

Hi @maxtorgr,

Thank you for sending over that screenshot. Are you looking to remove the OSM buildings or the terrain?

Best,
Sam

We are looking to remove terrain + map outside manhattan. @sam.rothstein

  • Thanks!

Hi @maxtorgr,

You are going to want to use the ClippingPlane object in our API. This will allow you to only showcase data from a particular region on the WGS 84 globe. Here is a sandcastle demo with code that can help get you started:

I recommend looking at the Grand Canyon Isolated section of this demo in particular.

-Sam

2 Likes

Perfect it worked for map. now buildings are showing all over map , also ousite the clip area. how can we clip buildings also?

1 Like

Hi @maxtorgr,

I am happy to hear that my suggestion worked out for you! Regarding removing OSM buildings from the surrounding region, I am not sure what the optimal solution is for your application. I recommend reading through our 3D Tiles styling guide for more context.

The section “Show features based on a property” will be particularly useful for you. You will need to determine which property you will use to decide if a given OSM building will be shown. It seems like the “addr:city” property might be a good place to start. For instance, this code

  osmBuildingsTileset.style = new Cesium.Cesium3DTileStyle({
    show: "${feature['addr:city']} === 'New York'",
  });

produces

Please let me know if you have any other questions or concerns. I am looking forward to hearing from you.

-Sam

1 Like

We are using “New York City 3D Buildings” .
We need to keep only manhattan 3D Buildings and remove the rest. check the picture.

@sam.rothstein

@maxtorgr

The solution that I eluded to above is the easiest way to show only a subset of the Open Street Map buildings dataset. I recommend searching for a better query, or possibly numerous queries that will only showcase the buildings that you would like to display.

Best,
Sam

@sam.rothstein
Maybe if you can guide me on how to edit (remove partially buildings) CityGML from nyc maps here NYC 3-D Building Model - DoITT

i have tried FME inspector, but takes a lot of time. any easier way ? thank you in advance.

@maxtorgr

I would love to help out, but I honestly have very little expertise in editing/modifying CityGML datasets. I know very little about the data format. I’m not even sure what tools would be most appropriate for this task. Any suggestions from the rest of the community?

If this is a process that you do not plan to repeat for various cities, I tend to recommend just manually editing the dataset.

Best,
Sam

@maxtorgr
If you have access to FME, you could just clip the portion of data you need with a polygon and convert just that portion…provided you only need that portion.

Otherwise, it seems like there are only some different variants of the first 4 numbers of the building ID in this dataset. Maybe you could use that and the filter mechanism named by @sam.rothstein.

Another solution would be a clipping plane collection like in this Sandcastle. Be aware that in this sandcastle the clipping planes are build by clicking on the map, but you could alter the code to have a fixed collection at the start.

Cheers, Lennart

we are trying to use boundaries BIN filtering NYC Boundaries Map | CARTO

it works on sandcastle for manhattan BIN numbers 100xxx to 112xxx numbers filtering , but not on our testserver. @sam.rothstein do you know what might be the reason not working on our test server?

if (
Number(BIN) >= 1000000 &&
Number(BIN) <= 1130000
) {
feature.show = true;
} else {
feature.show = false;
}

it worked as i mention on the last post! thank you !

@maxtorgr

I am happy to hear that you found a solution! The styling language was always your best bet. It seems like you just had to figure out which building ID numbers are valid to show.

Best,
Sam