Create a 2D surface from geo coordinates

I have a set of geo coordinates which represent the boundary of an area and I need to create a terrain whose boundary is the given coordinates. Currently I obtain the coordinates by calling an API via C++ and convert the to unreal world coordinates. I have also draw a debug line connecting all the points.

So you’re looking to load a tileset with Cesium only within the bounds of coordinates which you’ll obtain at runtime, is that correct? If so, I’d recommend checking out the example level of our cesium-unreal-samples repository that shows how to use the CesiumTileExcluder. You can extend this component from C++ or Blueprint to define exactly which tiles get included and excluded.

image
This data is a simple 2D flood map. in layman terms, I would like to have a different look for the area within the boundary.

I see! That’s a bit more complicated of a task than can be accomplished using CesiumTileExcluder, but still definitely possible. Take a look at the CesiumPolygonRasterOverlay class. This is responsible for turning a spline into the editor into a raster overlay that can be used to exclude parts of the tile. Since you’re loading your boundaries at runtime, you might need to make a custom class that loads the polygons from your endpoitn instead of using the values specified on a UPROPERTY, but the principle is the same.

Then, once you’ve turned your boundary into a raster overlay, you can do one of two things with it. One, you can enable ExcludeSelectedTiles on the CesiumPolygonRasterOverlay which will remove the selected bounds from the tile. Then you can do the same on another copy of the same tileset with InvertSelection checked on the CesiumPolygonRasterOverlay, which will remove everything but those selected bounds. You now have two separate tilesets which you can style independently. Alternatively, you can use the texture from the CesiumPolygonRasterOverlay in a custom material for your tileset, with the overlay controlling which styles to apply. Either way that should achieve your goals!