MapBox 3d buildings styling based on buildings coordinates - mapbox-gl-js

I would like to change buildings colors, knowing buildings addresses/coordinates.
The dataset of buildings is frequently changed.
What's the best way to do that?

Related

How to add 3D model object in 3Doccupancy map?

I have created a 3D occupancy map to model a region where I want to test some path planning algorithms for an autonomous robot. I have created a 3D map along with obstacles, but my requirement is to add 3D model (eg, human,car,tree etc anything) to my map.
The example is difficult to understand. Can somebody help me in adding some model.
Note: I have made these buildings but i want to add some sort of models (like humans, tree,car etc)
Also can we add png,or gif to our map?
GIF of a Car
My 3D map
I have created a 3D map along with obstacles, but my requirement is to add 3D model (eg, human,car,tree etc anything) to my map.

Painting Polygon Shaped Areas on Terrain/Surface/Ground in Unity

I have a set of 2D polygon shapes, each one with a varying amount of points that are determined at runtime.
I need to draw (or "paint") these polygons on top of a surface.
I also need to fill in the areas of each polygon with a specific color that is also determined at runtime.
The polygons only really need to be drawn once, however solutions that would allow me to update/change the colors would be nice.The project will be built for WebGL.
The polygons are to mark of specific areas on a surface so they shouldn't repeat.
Polygons can overlap with eachother
What are the different/best solutions that may help me achieve this?
Am also open to suggestions and further reading
I'm a relative Beginner to Unity but a somewhat experienced programmer and know a slight bit about shader programming.
By polygons I don't mean geometry I just mean a regular shapes I would like to paint on to a surface. Its just that I will always have polygons with a varying amount of points that are loaded in at runtime.
First, u need to split the surface into that polygon then u need to have materials on them and the code that specifies the colour should update the colour of the material which is on that specific polygon. Creating materials could be done in code to avoid a lot of work in a simple loop.

Hide polygons that are within a specific area

I'm trying to create an experience where I have a couple of detailed 3D models of buildings on the map with extruded building footprints of neighboring buildings via a vector tile source. The 3D models would be the main focus point and the extruded footprints would be for reference. One challenge I'm running into is that I have a global building footprint layer and it has a footprint for the 3D buildings which doesn't match up perfectly. Additionally, when extruded, it ends up merging/overlapping the nice 3D models.
I'd like to be able to hide the individual footprints that overlap the 3D models. My original thought was to grab the bounding box of the 3D model and then use the new within style expression, but it looks like this will only filter points and lines, not polygons. The building footprint polygons have no unique information in them that I could use to filter on.
I know I could monitor map movements and query the rendered features and manually detect intersecting polygons, but since there is no unique property on the footprint, I can't filter or use feature state.
Any ideas of how to efficiently avoid rendering individual polygons in a specific area that come in from a vector tile source?
It is a common issue that the buildings layer in Mapbox Streets don't contain any unique attributes to allow filtering or rendering differently.
The best solution is usually to source a different buildings layer, and in this case, remove those redundant buildings in pre-processing.
I can think of one rather crazy workaround that might work here, although the performance may be poor.
Add the building layer with very low opacity, of type fill, essentially invisible. (Maybe invisible would work.) Call your main source buildings`.
Create a secondary building source of type geojson, and a secondary fill-extrusion layer. Call this source buildings-copy.
On map move or moveend, use querySourceFeatures to obtain a copy of all buildings.
Process this copy using Turf to remove the buildings you don't want, and call setData to set the copy as the data for buildings-copy.
You may need to do some clever caching to get reasonable performance.

Mapbox : Loading/Rendering 3D buildings at a large scale

I'm trying to display a 3D skyline/panoromic view of Manhattan using Mapbox yet with Mapbox GL extruded 3D buildings start to disappear below zoom level of 15. Is there a way to render/display them at zoom level around 11-12? Or an alternative way by clipping/filtering rendered/loaded data by mapbox?
I have tried to filter the map to the area of Manhattan and Roosevelt islands yet later found out it's not possible to clip/filter MapBox to a geographical area.
As the final result I'm hoping to render the buildings at the final view shown in the last image.

Measuring distance to national border

I have a list of addresses and would like to know how far they are from the Mexican border. Is that possible?
Personally I would add a shape file of Mexico to the map in GeoJSON as a layer.
Then you can use turf.js to calculate the distance between your point (which you can geocode) into GeoJson and the GeoJson geometry.
This is a good tutorial which introduces turf.js and distance calculation (presumably you are opting to use Mapbox GL).
https://www.mapbox.com/help/analysis-with-turf/
This is a good start you can amend this to add your own Mexican Shape geometry.