-
Notifications
You must be signed in to change notification settings - Fork 483
Export DF world map for use in GIS tools #5376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
@@ -71,6 +71,7 @@ if(BUILD_SUPPORTED) | |||
#dfhack_plugin(dwarfmonitor dwarfmonitor.cpp LINK_LIBRARIES lua) | |||
#add_subdirectory(embark-assistant) | |||
dfhack_plugin(eventful eventful.cpp LINK_LIBRARIES lua) | |||
dfhack_plugin(export-map export-map.cpp COMPILE_FLAGS_GCC -fno-gnu-unique) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is requiring -fno-gnu-unique
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably a STL template; it can be hard to figure out which one because you have to pore over the libc++ implementation and that's very timeconsuming.
-fno-gnu-unique
should always be safe for DFHack plugins, as long as they don't crossload another another plug-in module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing is actually requiring this. Is what a (failed) attempt to make the plugin unload. I will have to check whether it unloads, now that I have removed the GDAL dependency. Keeping this there and the conversation open in the meantime.
using coord = df::coord2d; | ||
|
||
// static int wdim = 768; // dimension of a world tile | ||
static int rdim = 48; // dimension of a region tile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be constexpr
instead of static
?
The goal of this plugin is to export the world map at the region-tile (i.e., embark tile or midmap-tile) level for use with GIS programs like ArcGIS or QGIS. For a medium-sized map, this amounts to (129*16)^2 = 4260096 region tiles with biome information for every region tile fetched from one of the surrounding world tiles.
In order to keep the output down to a manageable size (17 MB of CSV for a medium-sized world), region tiles are clustered by the world tile they take their information from, and every cluster is exported as a single feature with its geometry described as a WKT (MULTI)POLYGON, resulting in an export of only 129^2 = 16641 features.