Skip to content
ballisticfox edited this page Jan 6, 2025 · 6 revisions

screenshot174

This workflow is only for areas in the US, and creates 1x1 degree lat - long tiles at 10m/px

If you have not completed Developer Set‐up, do that first

At this point you should have all packages installed, and a directory created with the script inside that you want to work in.


Downloading Heightmap Data:

image

To gather heightmap data we're going to use https://apps.nationalmap.gov/downloader/.

You may have to create an account to download the tiles.

Select the area of interest, select Elevation Products (3DEP) and search products, find the tile you want to download and hit Download Link (TIF)

Place this tif file inside of the same folder as the script.

image

Inside of the _workflow.py, replace the bottom command with workflows.NGP_3DEP("HEIGHTMAP", "MY_MODPATH")

where HEIGHTMAP is the heightmap name, and MY_MODPATH is the path to your textures folder.

For my example this is: workflows.NGP_3DEP("USGS_13_n27w100_20240925.tif", "Sol-Addons/PluginData/03_Earth/Tiles")

Downloading Colormap Data:

image

To gather colormap data we're going to be using SASPlanet.

To start, I highly advise pressing image on the top bar and pressing z15. A grid should appear, this will disappear as we start to download our imagery.

I also suggest you press View > Lat/Long Grid > 1°

On the top bar press the image down arrow and select by coordinate, then press the button

image

For this example I'm using USGS_13_n27w100_20240925. The coordinates listed in the 3DEP images are the upper left corner, meaning the first Lat should just be the same, and the first Long should be the same.

The second lat will be the lat -1, so N26 in this case, and the second long will be the long -1, or 99 in this case. Press apply.

image

Zooming in should yield something similar to this.

In the selection manager, go to the download section, on the left press 15. I personally check Close download window once finish but this is personal preference. Press start.

After the window disappears, hit the green selection button again, and press apply.

Go to the stitch section, select GeoTIFF as the output format, input the path to your work directory into the save to box, the colormap name must be the coords followed by _color.tif

For USGS_13_n27w100_20240925 -> n27w100_color.tif

Select which mapping service you'd like to use, I traditionally use Google - Satellite, select Zoom: 15, Press Start.

image

Your working directory should now look like this image

Open a terminal and use python _workflow.py and the script should start.

You should be left with:

image


Moving to KSP

The text file the script generates is not recognized by KSP itself, but can simply be put in a module manager patch.

The raw output from the script:

BoundedDecal
{
	heightMap = Sol-Addons/PluginData/03_Earth/Tiles/n27w100_Height.dds
	colorMap  = Sol-Addons/PluginData/03_Earth/Tiles/n27w100_Color.dds
	offset = 42.361211566338596
	deformity = 1478.4522392614633
	maxLong = -99
	minLong = -100
	maxLat = 27
	minLat = 26
	order = 21
}

To turn this into a module manager patch we can wrap our BoundedDecal in:

@Kopernicus:AFTER[RealSolarSystem]
{
    @Body[Earth]
    {
        @PQS
        {
            @Mods
            {
                // PQS Mods go here
            }
        }
    }
}

Giving us the final form

@Kopernicus:AFTER[RealSolarSystem]
{
    @Body[Earth]
    {
        @PQS
        {
            @Mods
            {
                BoundedDecal
                {
	                heightMap = Sol-Addons/PluginData/03_Earth/Tiles/n27w100_Height.dds
	                colorMap  = Sol-Addons/PluginData/03_Earth/Tiles/n27w100_Color.dds
	                offset = 42.361211566338596
	                deformity = 1478.4522392614633
	                maxLong = -99
	                minLong = -100
	                maxLat = 27
	                minLat = 26
	                order = 21
                }
            }
        }
    }
}

After placing our .DDS textures at the specified locations, the game should load our tiles properly.

Clone this wiki locally