Browse Source

rasterize --original_color, cf #6

master
Olivier Courtin 4 months ago
parent
commit
a04cfde36c
2 changed files with 7 additions and 3 deletions
  1. +4
    -2
      docs/tools.md
  2. +3
    -1
      neat_eo/tools/rasterize.py

+ 4
- 2
docs/tools.md View File

@@ -223,8 +223,9 @@ Web UI:
```nosyn
usage: neo rasterize [-h] --cover COVER [--config CONFIG] --type TYPE
[--geojson GEOJSON [GEOJSON ...]] [--sql SQL] [--pg PG]
[--buffer BUFFER] --out OUT [--append] [--ts TS]
[--workers WORKERS] [--web_ui_base_url WEB_UI_BASE_URL]
[--buffer BUFFER] --out OUT [--append] [--original_color]
[--ts TS] [--workers WORKERS]
[--web_ui_base_url WEB_UI_BASE_URL]
[--web_ui_template WEB_UI_TEMPLATE] [--no_web_ui]

optional arguments:
@@ -242,6 +243,7 @@ Inputs [either --sql or --geojson is required]:
Outputs:
--out OUT output directory path [required]
--append Append to existing tile if any, useful to multiclasses labels
--original_color if set, don't use complementary color
--ts TS output tile size [default: 512,512]

Performances:


+ 3
- 1
neat_eo/tools/rasterize.py View File

@@ -34,6 +34,7 @@ def add_parser(subparser, formatter_class):
out = parser.add_argument_group("Outputs")
out.add_argument("--out", type=str, required=True, help="output directory path [required]")
out.add_argument("--append", action="store_true", help="Append to existing tile if any, useful to multiclasses labels")
out.add_argument("--original_color", action="store_true", help="if set, don't use complementary color")
out.add_argument("--ts", type=str, default="512,512", help="output tile size [default: 512,512]")

perf = parser.add_argument_group("Performances")
@@ -77,7 +78,8 @@ def main(args):
args.pg = config["auth"]["pg"] if not args.pg and "pg" in config["auth"].keys() else args.pg
assert not (args.sql and not args.pg), "With --sql option, --pg dsn setting must also be provided"

palette, transparency = make_palette([classe["color"] for classe in config["classes"]], complementary=True)
complementary = not (args.original_color)
palette, transparency = make_palette([classe["color"] for classe in config["classes"]], complementary=complementary)
index = [config["classes"].index(classe) for classe in config["classes"] if classe["title"] == args.type]
assert index, "Requested type is not contains in your config file classes."
burn_value = index[0]


Loading…
Cancel
Save