Page 1 of 1

[Program] YS FLD/Scenery Parser

Posted: Thu Mar 23, 2023 10:19 pm
by Skipper
This has been an absolute slog to get working... But it's working now.
As a part of my radar program, I needed something to provide background maps for the radar screen. I toyed with the idea of doing screenshots from scenery editor like the YS Log viewer, but thought I'd prefer something that can be customised a bit more in terms of colouring, and be quickly and easily created for any map, so I started writing a parser for the .fld scenery files.
As Decaff44 will be able to verify, it was not a road paved in success....
But finally I've got a working prototype done.

The script will take a .fld file, and create a geoJSON file from the geometry in that scenery file.
This geoJSON will form the basis of my radar mapping in future, but can equally be converted to a .PNG, or a .SVG, or any other image format you'd like, so it should slot quite comfortably into any ideas you've got, like the Decaff's log viewer.
It's a work in progress, but I thought I'd get it released as I am quite sick of looking at the code, and want to move on with the more interesting radar side.

I should highlight that this creates a geoJSON, not the image straight away, some light lifting is required on your part! You can convert the geoJSON to something like an SVG, or render it to a PNG, or load it in a GIS package like QGIS. The coordinates, if you load it in a GIS, are in meters, and are the same as the positions in YS (so it'll slow together with the radar in future)