I have the following definitions in my schema file:
union UGeometry { Polygon, Point, Linestring }
table Point {
point:Vec2;
}
table Polygon {
points:[Vec2List];
}
table Geometry {
g:UGeometry;
}
(Removed some boilerplate code for type checking and other things)
The table Geometry stores geometries of type Point, Polygon and LineString. I can access this in C++ and Javascript as usual, e.g. in Javascript I use the following to get a Polygon type:
var rawPolygon = flatBufGeometry.g( new storage.Polygon() );
However, I cannot find such accessor in the generated Python code. The following won't work:
rawPolygon = rawGeometry.G()(storage.Polygon.Polygon())
How can I access Flatbuffers union objects in a table using Python?