Question

Land XML to Cesium 3D Tiles

  • 11 December 2018
  • 11 replies
  • 29 views

Badge

Hello.

I'm trying to convert Land XML to 3D Tiles and running into some problems. I've tried both Cesium ION Connector and Cesium 3D tile writer, and an EsriReprojector to convert state plane coordinates to WGS 84 .

Both complete the conversion without errors in FME. However, each method has some additional issues.

 

Using the 3D Tile writer, I use a Land XML Reader, to EsriReprojector, and directly to 3D Tile writer (do not use ION connector). I cannot see the3D Tiles in Cesium. I do not get any errors in Cesium and Cesium viewer is successfully loading the tiles.

I've also tried LandXML, to CityGML, to 3D Tile Writer, but that does not create a data Directry. Creates the tileset.json file though.

 

Using the Cesium ION Connector, I followed this example:

https://knowledge.safe.com/articles/81161/uploading-assets-to-cesium-ion.html

I converted the Land XML to CityGML, then push that to the Cesium ION connector. When I go to the Cesium ION account assets, an error is displayed about this asset instructing me to contact Cesium. Found out the error was caused by ION tiler not supporting LineStringSegment.

Are both of these issues caused by LineStringSegments? So in the case of using the 3D Tile writer, is FME interpreting the polylines as LIneStringSegments? If so, how do I specify the CityGML writer to not use LineStringSegments and just use polylines?

If this isn't the case, what am I doing wrong here?


11 replies

Userlevel 2
Badge +17

Hi @bbehling,

Cesium is generally aimed at displaying 3D surface and pointcloud data. I don't think you can use it to display lines and polygons.

FME's Cesium 3DTiles writer supports only solid and surface geometries. All other geometries will be discarded by the writer.

Of the formats supported by the Cesium ION connecter, only CityGML allows lines and polygons, but it appears that they are not supported by ION's import process.

FME has tools that can convert your LandXML data to 3D surfaces suitable for use in Cesium. For example, you can use the FaceReplacer transformer to convert a polygon to a 3D surface.

Badge

Hello @DaveAtSafe

 

Cesium can be used to display vector data (lines, polylines, polygons). The lines can be clamped to surface to they can have elevation values. We are displaying vector data in Cesium.

 

Cesium told me the issues was the output I was generating added geometries cesium ION convertors doesn't support yet, i.e. LineStringSegments.

 

I think all I need to do is read the geometries out of the LandXML file and convert those to a CityGML linestring. I new to FME, so I really dont know how to do this.

Userlevel 2
Badge +17

Hi @bbehling,

Interesting - I did not know about the support for vector data. Thanks for informing me.

I dug into this a little, and it seems that Cesium can load the vectors from GeoJSON, which is format FME can write to. Please try using the GeoJSON writer for your output format.

This Cesium sandbox illustrates how to load the GeoJSON for display, with an extrusion by a feature attribute.

Badge

Hi @bbehling,

Interesting - I did not know about the support for vector data. Thanks for informing me.

I dug into this a little, and it seems that Cesium can load the vectors from GeoJSON, which is format FME can write to. Please try using the GeoJSON writer for your output format.

This Cesium sandbox illustrates how to load the GeoJSON for display, with an extrusion by a feature attribute.

@DaveAtSafe

 

Unfortunately, I cannot use GeoJSON due to project constraints. Has to be 3D Tiles. Cesium ION tilers does not support GeoJSON to 3D tiles either.

 

See this example from https://knowledge.safe.com/articles/81161/uploading-assets-to-cesium-ion.html

 

They are taking building footprints, converting it to CityGML, then creating 3D tiles from the GML.

 

All I should really need to do is convert the LandXML to CityGML with geometries supported by 3D Tiles, and this should work. But I'm not sure how to do the conversion between LandXML and CityGML. Somehow create features with linestrings in the CityGML file?

 

Example XML file I'm using: LandXML.xml

Example output from LandXML to to CityGML (rename to gml): city_gml.xml

Userlevel 2
Badge +17

Hi @bbehling,

Thanks for the example data - it really helps me grasp what you want to do.

The source LandXML file contains 3D polylines, but these are basically contour lines of a 3D surface. You can use the TINGenerator to produce a 3D surface from these lines that is suitable for Cesium 3D tiles. I am attaching workspace illustrating the process - you just need to set the source State Plane coordinate system on the LandXML reader.

There is no need to reproject to WGS 84 - the Cesium writer will automatically reproject the output data to the geocentric coordinate system required for 3D Tiles.

landxml2cesium3dtiles.fmw

Badge

Hi @bbehling,

Thanks for the example data - it really helps me grasp what you want to do.

The source LandXML file contains 3D polylines, but these are basically contour lines of a 3D surface. You can use the TINGenerator to produce a 3D surface from these lines that is suitable for Cesium 3D tiles. I am attaching workspace illustrating the process - you just need to set the source State Plane coordinate system on the LandXML reader.

There is no need to reproject to WGS 84 - the Cesium writer will automatically reproject the output data to the geocentric coordinate system required for 3D Tiles.

landxml2cesium3dtiles.fmw

Thanks @DaveAtSafe

 

This could be useful for displaying the land XML as a terrain or surface, but I need to display the lines.

There has to be a way to take the 3D polylines and convert them to CityGML line strings?

 

Here is a screen shot of how I need to display the line work -

 

Screen Shot 2018-12-11 at 5.07.27 PM.png

Userlevel 2
Badge +17

Thanks @DaveAtSafe

 

This could be useful for displaying the land XML as a terrain or surface, but I need to display the lines.

There has to be a way to take the 3D polylines and convert them to CityGML line strings?

 

Here is a screen shot of how I need to display the line work -

 

Screen Shot 2018-12-11 at 5.07.27 PM.png

Hi @bbehling,

There is something that may work, but I would like to try it first. What is the LandXML coordinate system?

Badge

Hi @bbehling,

There is something that may work, but I would like to try it first. What is the LandXML coordinate system?

Its a local CRS. You can define it as NAD_1983_2011_StatePlane_Colorado_North_FIPS_0501. The data will show up in Ontario; should be good enough to test with. After this exercise, I need to figure out how to reproject the coordinates in the XML using calibration file offsets.

If you find the data floating above the ground, I was able to fix that by using a BoundsExtractor and Offsetter. Let me know if you want more details on that.

Userlevel 2
Badge +17

Hi @bbehling,

OK, I did find a workable solution:

  • Rasterize the lines into a high-resolution image with the ImageRasterizer transformer
  • Convert the raster into a zero elevation surface textured with the image, with the FaceReplacer transformer

You can adjust the line thickness and color for the best results.

 

I am attaching a workspace to illustrate the process.

landxml2cesium3dtiles.fmw

Badge

Hi @bbehling,

OK, I did find a workable solution:

  • Rasterize the lines into a high-resolution image with the ImageRasterizer transformer
  • Convert the raster into a zero elevation surface textured with the image, with the FaceReplacer transformer

You can adjust the line thickness and color for the best results.

 

I am attaching a workspace to illustrate the process.

landxml2cesium3dtiles.fmw

Awesome. I'll try this soon. Curious to see of the lines are pixelated when zooming.

I'd still like to figure out how to convert LandXML directly to CityGML so we can keep this as a vector based solution. The GML coordinates are available in the LandXML. I just need to 1) figure out how to create GML geometries using these coords and 2) what GML geometries does Cesium support

Badge

Hi @bbehling,

OK, I did find a workable solution:

  • Rasterize the lines into a high-resolution image with the ImageRasterizer transformer
  • Convert the raster into a zero elevation surface textured with the image, with the FaceReplacer transformer

You can adjust the line thickness and color for the best results.

 

I am attaching a workspace to illustrate the process.

landxml2cesium3dtiles.fmw

@DaveAtSafe

 

Hi. We were able to convert the vector data to 3D tiles as polygons. However, Cesium doesn't support lineStrings at the moment.

Reply