[x3d-public] Open Street Map to GeoJSON to X3D JSON

Andreas Plesch andreasplesch at gmail.com
Sat Dec 19 10:36:10 PST 2015


Date: Sat, 19 Dec 2015 02:55:17 +0100

> From: Clement IGONET <clement at igonet.fr>
>
> For those who could be interested, I've coded a little converter
> focused on Open Street Map buildings.
> This converts OSM data to GeoJSON and then, to X3D JSON.
> Source code here:
> https://git.framasoft.org/pizaninja/OpenEarthView/tree/master/osm2x3d
> also available as npm package: osm2x3d


Hey, this looks great. I was wondering if it would be possible to use x3d
GeoCoordinates in the x3d output but after looking into the code I realized
that it is hard to use those with 2d geometries. So this leads to a more
general x3d question:

While there is a Coordinate SFNode for 3d geometries, there is not an
equivalent 2DCoordinate SFNode for 2d geometries. Instead Polyline2D,
Polypoint2D and TriangleSet2D use MFVec2f fields such as linesegments,
point [should be plural?] and vertices to specify 2d coordinates.

If instead a 2DCoordinate SFNode would used, there could also be an
equivalent Geo2DCoordinate. The Y=0 equivalent would 0 elevation (eg. the
third component would be zero).

The cross-section of the Extrusion node is related. How do you deal with a
building foot print given in geographic coordinates that you would like to
extrude vertically ? This is the typical KML, GeoJSON, OSM setup.

Currently one has to produce local coordinates for the cross-section (foot
print) of the building first, then use Extrusion and GeoLocation.

Is it necessary to have a GeoExtrusion node ?

On the other hand it is not too hard to programmatically construct a
IndexedFaceSet with the necessary connectivity between the vertices to
produce an extrusion.

And instead of the 2D geometries one could use the 3d equivalents: LineSet,
PointSet and TriangleSet.

So I guess it comes to down to a question of design and convenience.

-Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20151219/d1e21691/attachment.html>


More information about the x3d-public mailing list