encoding  utf-8
source StarkCaverns.th

# Load the Metapost code for custom symbols
input ../TherionMasterFiles/CustomSymbolsCode.txt

# Defind a layout for the profile drawings.
layout profiles
                  language en_US
                  units imperial
                  legend off
                  symbol-colour group centerline [80 20 0]
                  map-header 0 0 off
                  color map-fg [70 66 46]
                  symbol-set UIS
                  debug station-names
endlayout

select MainPlan

# This layout is for the main 2D map, all on one page
layout basics
	language en_US
	units imperial
	scale-bar 20 feet
	page-numbers on
	scale 1 200
	north true
                 symbol-colour area water [10 10 80]
                 symbol-colour group centerline [80 20 0]
	map-comment "A compass and tape survey of Stark Caverns (MIL001), Missouri"
	statistics explo all
	legend on
#	map-header 3 60 w
	symbol-set UIS

# Section for PDF properties
	doc-author "Bill Gee"
	doc-title "Map of Stark Caverns"
                 doc-subject "Plan map of Stark Caverns"

# Section for map photos

# Add in the elevations maps

#  map-image 0 0 sw StarkCavernsElevations.pdf
   
# Bring in the custom symbols
  copy CustomSymbols
  
# Set point height symbols to be enclosed in boxes
  code metapost
    p_label_mode_height:=6;
  endcode

# Reassign names 
  symbol-assign point gradient AMER
  symbol-assign point stalagmite AMER
  symbol-assign point stalactite AMER
  symbol-assign point pillar AMER
  symbol-assign point popcorn AMER

endlayout

# Layouts to specify colors
layout MainMapNoColor
  copy basics
  color map-fg [100 86 66]
  symbol-show group centerline
  debug station-names
endlayout

layout MainMapColorized
  copy basics
  color map-fg altitude
endlayout

# Change the legend callouts
input ../TherionMasterFiles/LegendCallouts.txt

# Create the profiles map first
export map -proj extended -layout profiles -o StarkCavernsElevations.pdf

# Basic plan map, normal colors
export map -proj plan -layout MainMapNoColor -o StarkCaverns.pdf

# Basic plan map, colorized for elevations
export map -proj plan -layout MainMapColorized -o StarkCavernsColored.pdf

# Basic plan map as an atlas
export atlas -proj plan -layout MainMapNoColor -o StarkCavernsAtlas.pdf

# 3D map for use with Loch
export model -fmt loch -o StarkCaverns.lox

# 3D map for use with Aven
export model -fmt 3d -o StarkCaverns.3d

# KML file for overlay in Google Earth - Requires lat-long specified in the survey data file
export map -proj plan -fmt kml -o StarkCaverns.kml

# Create a Compass PLT file
export model -fmt compass -enable all -wall-source all -o StarkCaverns.plt

# Create a list of surveys
export survey-list -fmt txt -o StarkCavernsSurveys.txt
