Skip to content

Commit

Permalink
adding style switching to flags and update readme to show new option
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdajack committed Jun 19, 2022
1 parent 312f85a commit aec24e2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@

**_includeLanduse_** - By default the program will download the appropriate landuse/landcover data and include it in the final output planet.mbtiles. If you do not wish to include the landcover overlay (for example to save a little space), then you can set this option to false. If false, the landuse data will not be downloaded either.

**_TilemakerConfig_** - **_[note capitalisation]_** The config file that will be passed to [Tilemaker](https://github.com/systemed/tilemaker). See the default used [here](https://github.com/lambdajack/tilemaker/blob/b90347b2a4fd475470b9870b8e44e2829d8e4d6d/resources/config-openmaptiles.json). This will affect things like tags etc which will affect your front end styles when serving. It is reccomended to leave as default (blank) unless you have a specific reason to make changes (for example, you require a language other than english to be the primary language for the generated maps, or wish to change the zoom level (14 by default)).
**_TilemakerConfig_** - **_[note capitalisation]_** The path to the config file that will be passed to [Tilemaker](https://github.com/systemed/tilemaker). See the default used [here](https://github.com/lambdajack/tilemaker/blob/b90347b2a4fd475470b9870b8e44e2829d8e4d6d/resources/config-openmaptiles.json). This will affect things like tags etc which will affect your front end styles when serving. It is reccomended to leave as default (blank) unless you have a specific reason to make changes (for example, you require a language other than english to be the primary language for the generated maps, or wish to change the zoom level (14 by default)).

**_TilemakerProcess_** - **_[note capitalisation]_** The process file that will be passed to [Tilemaker](https://github.com/systemed/tilemaker). See the default used [here](https://github.com/lambdajack/tilemaker/blob/b90347b2a4fd475470b9870b8e44e2829d8e4d6d/resources/process-openmaptiles.lua). It is reccomended to leave as default (blank) unless you have a specific reason to make changes (for example, you require a language other than english to be the primary language for the generated maps).
**_TilemakerProcess_** - **_[note capitalisation]_** The path to the process file that will be passed to [Tilemaker](https://github.com/systemed/tilemaker). See the default used [here](https://github.com/lambdajack/tilemaker/blob/b90347b2a4fd475470b9870b8e44e2829d8e4d6d/resources/process-openmaptiles.lua). Leaving blank will use the default. You can also use a special value to select one of the provided process files to match a given style. The special values are "**tileserver-gl-basic**", "**sgpm-bright**". Copies of the target styles can be viewed [here](configs/styles/). Feel free to copy one of the target styles to your front end project if necessary.

**_maxRamMb_** - Provide the maximum amount of RAM in MB that the process should use. If a linux os is detected, the total system RAM will be detected from /proc/meminfo and a default will be set to a reasonably safe level, maximising the available resources. This assumes that only a minimal amount of system RAM is currently being used (such as an idle desktop environment (<2G)). If you are having memory problems, consider manually setting this flag to a reduced value. NOTE THIS IS NOT GUARANTEED AND SOME SAFETY MARGIN SHOULD BE ALLOWED. On **non unix** operating systems the default is set to 4096.

Expand Down
8 changes: 6 additions & 2 deletions cmd/sequentially-generate-planet-mbtiles/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ func setConfigByFlags() {
func setAbsolutePaths() {

if cfg.TilemakerProcess == "" || strings.ToLower(cfg.TilemakerProcess) == "tileserver-gl-basic" {
cfg.TilemakerConfig = "third_party/tilemaker/resources/process-openmaptiles.json"
cfg.TilemakerConfig = "third_party/tilemaker/resources/process-openmaptiles.lua"
}

if cfg.TilemakerProcess == "sgpm-bright" {
cfg.TilemakerProcess = "third_party/tilemaker/resources/process-openmaptiles.json"
cfg.TilemakerProcess = "third_party/tilemaker/resources/process-bright.lua"
}

if cfg.TilemakerConfig == "" {
cfg.TilemakerConfig = "third_party/tilemaker/resources/config-openmaptiles.json"
}

cfg.PlanetFile = convertAbs(cfg.PlanetFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,17 @@ Config Flags:
-io, --include-ocean Include ocean tiles in final planet.mbtiles
-il, --include-landuse Include landuse layer in final planet.mbtiles
-tc, --tilemaker-config Provide path to tilemaker configuration file. The
-tc, --tilemaker-config Provide path to a tilemaker configuration file. The
default configuration is embedded into the release
binary. See the default used here:
https://github.com/lambdajack/tilemaker/blob/master/resources/config-openmaptiles.json
-tp, --tilemaker-process Provide path to tilemaker configuration file. The
default process file is embedded into the release
binary. See the default used here:
-tp, --tilemaker-process Provide path to a tilemaker process file OR
a special value. Special values are
"tileserver-gl-basic", "sgpm-bright". Setting a
special value will use one of the included configs
to match the appropriate target style. See the
default used here:
https://github.com/lambdajack/tilemaker/blob/master/resources/process-openmaptiles.lua
-r, --ram Provide the maximum amount of RAM in MB that the
Expand Down Expand Up @@ -189,11 +192,11 @@ func EntryPoint() int {
flag.BoolVar(&fl.includeLanduse, "il", true, "")
flag.BoolVar(&fl.includeLanduse, "include-landuse", true, "")

flag.StringVar(&fl.tilemakerConfig, "tc", "third_party/tilemaker/resources/config-openmaptiles.json", "")
flag.StringVar(&fl.tilemakerConfig, "tilemaker-config", "third_party/tilemaker/resources/config-openmaptiles.json", "")
flag.StringVar(&fl.tilemakerConfig, "tc", "", "")
flag.StringVar(&fl.tilemakerConfig, "tilemaker-config", "", "")

flag.StringVar(&fl.tilemakerProcess, "tp", "third_party/tilemaker/resources/process-openmaptiles.lua", "")
flag.StringVar(&fl.tilemakerProcess, "tilemaker-process", "third_party/tilemaker/resources/process-openmaptiles.lua", "")
flag.StringVar(&fl.tilemakerProcess, "tp", "", "")
flag.StringVar(&fl.tilemakerProcess, "tilemaker-process", "", "")

flag.Uint64Var(&fl.maxRamMb, "r", 0, "")
flag.Uint64Var(&fl.maxRamMb, "ram", 0, "")
Expand Down

0 comments on commit aec24e2

Please sign in to comment.