-
Notifications
You must be signed in to change notification settings - Fork 499
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
Open
chdoc
wants to merge
18
commits into
DFHack:develop
Choose a base branch
from
chdoc:export-map-2
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,098
−7
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d0e8207
region map export using neither GDAL nor boost
chdoc d7a04d6
clean up and reinstate export of the remaining biome and region values
chdoc d899a2a
comments and cleanup
chdoc 7043d2c
convert site export to CSV and remove GDAL dependency
chdoc 3468e6f
use proper site classification and remove gdal include
chdoc 5856c80
move sites classification to map module and additional cleanup
chdoc b8f92d8
Merge branch 'develop' into export-map-2
chdoc b53b44f
first version of river export in C++
chdoc f495b6d
Merge branch 'develop' into export-map-2
chdoc 95eab7f
default to exporting all layers
chdoc 4473f09
Merge branch 'develop' into export-map-2
chdoc 9075ba4
add elevation export
chdoc 721ca8e
Merge branch 'develop' into export-map-2
chdoc b6a3824
improve code quality
chdoc 2f1bb5f
fix river confluence points
chdoc 7c23828
more cleanup
chdoc 394718a
refactor region output into multiple functions
chdoc 70cb75e
documentation and changelog
chdoc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| export-map | ||
| ========== | ||
|
|
||
| .. dfhack-tool:: | ||
| :summary: Export world map data for GIS and other external tools. | ||
| :tags: inspection embark map | ||
|
|
||
| This plugin exports world-map information to files in the DFHack configuration | ||
| folder under the ``map-export`` directory. It must be run from the | ||
| embark-selection screen. The exports are generated at the granularity of | ||
| individual region tiles (16 x 16 per world tile). Those tiles are only generated | ||
| by DF as you scroll around on the zoomed-in embark map, which thus needs to be | ||
| done prior to running this export tool. | ||
|
|
||
| The supported export targets are: | ||
|
|
||
| - ``regions``: writes world tile regions and their biome information to ``map.csv``. | ||
| - ``sites``: writes site extents and ownership/civilization information to ``sites.csv``. | ||
| - ``rivers``: writes rivers to ``rivers.csv``. | ||
| - ``elevation``: writes elevation data to ``elevation.dat`` and ``elevation.vrt``. | ||
|
|
||
| Unless you have software such as ArcGIS or QGIS/GDAL available, these exports | ||
| will be of little use. | ||
|
|
||
| Usage | ||
| ----- | ||
|
|
||
| :: | ||
|
|
||
| export-map | ||
| export-map <topic> | ||
| export-map <topic> <topic> ... | ||
| export-map all | ||
|
|
||
| If no topic is given, or if ``all`` is supplied, every supported export target | ||
| is run. | ||
|
|
||
| Examples | ||
| -------- | ||
|
|
||
| ``export-map`` | ||
| Export all supported datasets. | ||
|
|
||
| ``export-map regions`` | ||
| Export only region boundary geometries. | ||
|
|
||
| ``export-map sites rivers`` | ||
| Export site and river geometries only. | ||
|
|
||
|
|
||
| Notes on file formats | ||
| --------------------- | ||
|
|
||
| To avoid depending on external libraries such as GDAL, the export formats are | ||
| kept as simple as possible to generate. This means raw bitmap data for the | ||
| elevation export and CSV files for the others. Before these files can be used | ||
| reasonably in software such as QGIS, they need to be assigned a coordinate | ||
| reference system (CRS) and converted into formats that can be accessed more | ||
| efficiently than CSV. While any CRS will do, WGS 84 / Pseudo-Mercator | ||
| (EPSG:3857) is the preferred choice. | ||
|
|
||
| For detailed map data (``regions`` and ``rivers``), Parquet is by far the | ||
| preferred format. The elevation export provides a VRT file to facilitate the | ||
| transformation into a GeoTIFF with the aforementioned CRS. | ||
|
|
||
| Assuming a recent version of GDAL built with Parquet support and with all | ||
| command-line tools in your PATH, this can be achieved with the following | ||
| commands: | ||
|
|
||
| :: | ||
|
|
||
| ogr2ogr -a_srs "EPSG:3857" -of Parquet map.parquet -oo 'GEOM_POSSIBLE_NAMES=*wkt' -oo 'KEEP_GEOM_COLUMNS=NO' -oo 'AUTODETECT_TYPE=YES' map.csv | ||
| ogr2ogr -a_srs "EPSG:3857" -of Parquet rivers.parquet -oo 'GEOM_POSSIBLE_NAMES=*wkt' -oo 'KEEP_GEOM_COLUMNS=NO' -oo 'AUTODETECT_TYPE=YES' rivers.csv | ||
| gdal raster convert elevation.vrt elevation.tif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-uniqueshould always be safe for DFHack plugins, as long as they don't crossload another another plug-in moduleThere 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.