From a01ab38beffd9f52accd5584cc1814678a71aca3 Mon Sep 17 00:00:00 2001 From: Martin Landa Date: Sun, 16 Jun 2024 15:09:29 +0200 Subject: [PATCH 001/137] very first draft --- doc/Makefile | 1 + doc/mkdocs.yml | 25 ++ include/Make/Grass.make | 1 + include/Make/Html.make | 10 +- include/Make/HtmlRules.make | 2 +- include/Make/Rules.make | 2 +- utils/Makefile | 4 +- utils/mkmarkdown.py | 831 ++++++++++++++++++++++++++++++++++++ 8 files changed, 867 insertions(+), 9 deletions(-) create mode 100644 doc/mkdocs.yml create mode 100644 utils/mkmarkdown.py diff --git a/doc/Makefile b/doc/Makefile index 042789d064a..d134506dfae 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -5,3 +5,4 @@ include $(MODULE_TOPDIR)/include/Make/Other.make FILES := $(wildcard *.html) default: $(patsubst %,$(HTMLDIR)/%,$(FILES)) + $(INSTALL_DATA) mkdocs.yml $(MDDIR)/ diff --git a/doc/mkdocs.yml b/doc/mkdocs.yml new file mode 100644 index 00000000000..3f1b7f6eab7 --- /dev/null +++ b/doc/mkdocs.yml @@ -0,0 +1,25 @@ +--- +site_name: GRASS GIS manual +site_url: https://grass.osgeo.org/grass-stable/manuals/ +docs_dir: source +theme: readthedocs +plugins: + - search +# - awesome-pages +# collapse_single_pages: true +# https://github.com/mkdocs/mkdocs/issues/991 +use_directory_urls: true +nav: + - Startup: grass.md + - Databases: database.md + - Display: display.md + - General: general.md + - Imagery: imagery.md + - Keywords: keywords.md + - Misc: miscellaneous.md + - Raster: raster.md + - Raster 3D: raster3d.md + - SQL: sql.md + - Temporal: temporal.md + - Variables: variables.md + - Vector: vector.md diff --git a/include/Make/Grass.make b/include/Make/Grass.make index 137a45d1955..15e6ada3f9d 100644 --- a/include/Make/Grass.make +++ b/include/Make/Grass.make @@ -59,6 +59,7 @@ DOCSDIR = $(ARCH_DISTDIR)/docs ETC = $(ARCH_DISTDIR)/etc GUIDIR = $(ARCH_DISTDIR)/gui HTMLDIR = $(ARCH_DISTDIR)/docs/html +MDDIR = $(ARCH_DISTDIR)/docs/md SCRIPTDIR = $(ARCH_DISTDIR)/scripts MSG_DIR = $(ARCH_DISTDIR)/etc/msgs MO_DIR = $(ARCH_DISTDIR)/locale diff --git a/include/Make/Html.make b/include/Make/Html.make index fa736d3405a..5b8c27f2fa6 100644 --- a/include/Make/Html.make +++ b/include/Make/Html.make @@ -3,15 +3,15 @@ include $(MODULE_TOPDIR)/include/Make/HtmlRules.make -$(HTMLDIR)/%.html: %.html %.tmp.html $(HTMLSRC) $(IMGDST) | $(HTMLDIR) +$(MDDIR)/source/%.md: %.md %.tmp.md $(HTMLSRC) $(IMGDST) | $(MDDIR) VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) MODULE_TOPDIR=$(MODULE_TOPDIR) \ - $(PYTHON) $(GISBASE)/utils/mkhtml.py $* > $@ + $(PYTHON) $(GISBASE)/utils/mkmarkdown.py $* > $@ $(MANDIR)/%.$(MANSECT): $(HTMLDIR)/%.html $(HTML2MAN) "$<" "$@" -%.tmp.html: $(HTMLSRC) - if [ "$(HTMLSRC)" != "" ] ; then $(call htmldesc,$<,$@) ; fi +%.tmp.md: $(HTMLSRC) + if [ "$(HTMLSRC)" != "" ] ; then $(call moduledesc,$<,$@) ; fi ifdef CROSS_COMPILING @@ -19,7 +19,7 @@ html: else -html: $(HTMLDIR)/$(PGM).html $(MANDIR)/$(PGM).$(MANSECT) +html: $(MDDIR)/source/$(PGM).md # $(MANDIR)/$(PGM).$(MANSECT) endif diff --git a/include/Make/HtmlRules.make b/include/Make/HtmlRules.make index 0c79a05a2ad..f0696d8d9a5 100644 --- a/include/Make/HtmlRules.make +++ b/include/Make/HtmlRules.make @@ -1,7 +1,7 @@ # common html rules (included by Html.make and GuiScript.make) -htmldesc = $(call run_grass,$(1) --html-description < /dev/null | grep -v '\|\| ' > $(2)) +moduledesc = $(call run_grass,$(1) --md-description < /dev/null | grep -v '\|\| ' > $(2)) IMGSRC := $(wildcard *.png) $(wildcard *.jpg) $(wildcard *.gif) IMGDST := $(patsubst %,$(HTMLDIR)/%,$(IMGSRC)) diff --git a/include/Make/Rules.make b/include/Make/Rules.make index 3681c667a02..9e765fab7a4 100644 --- a/include/Make/Rules.make +++ b/include/Make/Rules.make @@ -6,7 +6,7 @@ first: pre default ARCH_DIRS = $(ARCH_DISTDIR) $(ARCH_BINDIR) $(ARCH_INCDIR) $(ARCH_LIBDIR) \ $(BIN) $(ETC) \ $(DRIVERDIR) $(DBDRIVERDIR) $(FONTDIR) $(DOCSDIR) $(HTMLDIR) \ - $(MANBASEDIR) $(MANDIR) $(UTILSDIR) + $(MDDIR) $(MDDIR)/source $(MANBASEDIR) $(MANDIR) $(UTILSDIR) pre: | $(ARCH_DIRS) diff --git a/utils/Makefile b/utils/Makefile index fdff52b8e3d..692f3db1ef2 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -5,11 +5,11 @@ SUBDIRS = timer g.html2man include $(MODULE_TOPDIR)/include/Make/Dir.make include $(MODULE_TOPDIR)/include/Make/Compile.make -default: parsubdirs $(UTILSDIR)/mkhtml.py \ +default: parsubdirs $(UTILSDIR)/mkmarkdown.py \ $(UTILSDIR)/generate_last_commit_file.py \ $(UTILSDIR)/g.echo$(EXE) -$(UTILSDIR)/mkhtml.py: mkhtml.py +$(UTILSDIR)/mkmarkdown.py: mkmarkdown.py $(INSTALL) $< $@ $(UTILSDIR)/generate_last_commit_file.py: generate_last_commit_file.py diff --git a/utils/mkmarkdown.py b/utils/mkmarkdown.py new file mode 100644 index 00000000000..c7852fbd8c0 --- /dev/null +++ b/utils/mkmarkdown.py @@ -0,0 +1,831 @@ +#!/usr/bin/env python3 + +############################################################################ +# +# MODULE: Builds manual pages (Markdown) +# AUTHOR(S): Markus Neteler +# Glynn Clements +# Martin Landa +# PURPOSE: Create Markdown manual page snippets +# Inspired by mkhtml.py +# COPYRIGHT: (C) 2024 by the GRASS Development Team +# +# This program is free software under the GNU General +# Public License (>=v2). Read the file COPYING that +# comes with GRASS for details. +# +############################################################################# + +import os +import sys +import re +import string +import json +import subprocess +import http +import pathlib +from datetime import datetime +from urllib import request as urlrequest +import urllib.parse as urlparse +from urllib.error import HTTPError, URLError +from html.parser import HTMLParser + +try: + import grass.script as gs +except ImportError: + # During compilation GRASS GIS + gs = None + +from generate_last_commit_file import COMMIT_DATE_FORMAT + +HEADERS = { + "User-Agent": "Mozilla/5.0", +} +HTTP_STATUS_CODES = list(http.HTTPStatus) + + +def read_file(name): + try: + with open(name) as f: + s = f.read() + return s + except OSError: + return "" + + +def get_version_branch(major_version, addons_git_repo_url): + """Check if version branch for the current GRASS version exists, + if not, take branch for the previous version + For the official repo we assume that at least one version branch is present + + :param major_version int: GRASS GIS major version + :param addons_git_repo_url str: Addons Git ropository URL + + :return version_branch str: version branch + """ + version_branch = f"grass{major_version}" + if gs: + branch = gs.Popen( + [ + "git", + "ls-remote", + "--heads", + addons_git_repo_url, + f"refs/heads/{version_branch}", + ], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + branch, stderr = branch.communicate() + if stderr: + gs.fatal( + _( + "Failed to get branch from the Git repository" + " <{repo_path}>.\n{error}" + ).format( + repo_path=addons_git_repo_url, + error=gs.decode(stderr), + ) + ) + if version_branch not in gs.decode(branch): + version_branch = "grass{}".format(int(major_version) - 1) + return version_branch + + +def has_src_code_git(src_dir): + """Has core module or addon source code Git + + :param str src_dir: core module or addon root directory + + :return subprocess.CompletedProcess or None: subprocess.CompletedProcess + if core module or addon + source code has Git + """ + actual_dir = os.getcwd() + os.chdir(src_dir) + try: + process_result = subprocess.run( + [ + "git", + "log", + "-1", + f"--format=%H,{COMMIT_DATE_FORMAT}", + src_dir, + ], + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) # --format=%H,COMMIT_DATE_FORMAT commit hash,author date + os.chdir(actual_dir) + return process_result if process_result.returncode == 0 else None + except FileNotFoundError: + os.chdir(actual_dir) + return None + + +def get_last_git_commit(src_dir, top_dir, addon_path, major_version): + """Get last module/addon git commit + + :param str src_dir: module/addon source dir + :param str top_dir: top source dir + :param str addon_path: addon path + :param str major_version: major GRASS version + + :return dict git_log: dict with key commit and date, if not + possible download commit from GitHub REST API + server values of keys have "unknown" string + """ + process_result = has_src_code_git(src_dir) + if process_result: + return parse_git_commit( + commit=process_result.stdout.decode(), + src_dir=src_dir, + ) + else: + if gs: + # Addons installation + return get_git_commit_from_rest_api_for_addon_repo( + addon_path=addon_path, + src_dir=src_dir, + major_version=major_version, + ) + # During GRASS GIS compilation from source code without Git + else: + return get_git_commit_from_file(src_dir=src_dir, top_dir=top_dir) + + +def parse_git_commit( + commit, + src_dir, + git_log=None, +): + """Parse Git commit + + :param str commit: commit message + :param str src_dir: addon source dir + :param dict git_log: dict which store last commit and commnit + date + + :return dict git_log: dict which store last commit and commnit date + """ + if not git_log: + git_log = get_default_git_log(src_dir=src_dir) + if commit: + git_log["commit"], commit_date = commit.strip().split(",") + git_log["date"] = format_git_commit_date_from_local_git( + commit_datetime=commit_date, + ) + return git_log + + +def get_default_git_log(src_dir, datetime_format="%A %b %d %H:%M:%S %Y"): + """Get default Git commit and commit date, when getting commit from + local Git, local JSON file and remote GitHub REST API server wasn't + successful. + + :param str src_dir: addon source dir + :param str datetime_format: output commit datetime format + e.g. Sunday Jan 16 23:09:35 2022 + + :return dict: dict which store last commit and commnit date + """ + return { + "commit": "unknown", + "date": datetime.fromtimestamp(os.path.getmtime(src_dir)).strftime( + datetime_format + ), + } + + +def format_git_commit_date_from_local_git( + commit_datetime, datetime_format="%A %b %d %H:%M:%S %Y" +): + """Format datetime from local Git or JSON file + + :param str commit_datetime: commit datetime + :param str datetime_format: output commit datetime format + e.g. Sunday Jan 16 23:09:35 2022 + + :return str: output formatted commit datetime + """ + try: + date = datetime.fromisoformat( + commit_datetime, + ) + except ValueError: + if commit_datetime.endswith("Z"): + # Python 3.10 and older does not support Z in time, while recent versions + # of Git (2.45.1) use it. Try to help the parsing if Z is in the string. + date = datetime.fromisoformat(commit_datetime[:-1] + "+00:00") + else: + raise + return date.strftime(datetime_format) + + +def get_git_commit_from_rest_api_for_addon_repo( + addon_path, + src_dir, + major_version, + git_log=None, +): + """Get Git commit from remote GitHub REST API for addon repository + + :param str addon_path: addon path + :param str src_dir: addon source dir + :param str major_version: GRASS major version + :param dict git_log: dict which store last commit and commnit date + + :return dict git_log: dict which store last commit and commnit date + """ + # Accessed date time if getting commit from GitHub REST API wasn't successful + if not git_log: + git_log = get_default_git_log(src_dir=src_dir) + if addon_path is not None: + grass_addons_url = ( + "https://api.github.com/repos/osgeo/grass-addons/commits?" + "path={path}&page=1&per_page=1&sha=grass{major_version}".format( + path=addon_path, + major_version=major_version, + ) + ) # sha=git_branch_name + + response = download_git_commit( + url=grass_addons_url, + response_format="application/json", + ) + if response: + commit = json.loads(response.read()) + if commit: + git_log["commit"] = commit[0]["sha"] + git_log["date"] = format_git_commit_date_from_rest_api( + commit_datetime=commit[0]["commit"]["author"]["date"], + ) + return git_log + + +def get_git_commit_from_file( + src_dir, + top_dir, + git_log=None, +): + """Get Git commit from JSON file + + :param str src_dir: addon source dir + :param str top_dir: top source dir + :param dict git_log: dict which store last commit and commnit date + + :return dict git_log: dict which store last commit and commnit date + """ + # Accessed date time if getting commit from JSON file wasn't successful + if not git_log: + git_log = get_default_git_log(src_dir=src_dir) + json_file_path = os.path.join( + top_dir, + "core_modules_with_last_commit.json", + ) + if os.path.exists(json_file_path): + with open(json_file_path) as f: + core_modules_with_last_commit = json.load(f) + if pgm in core_modules_with_last_commit: + core_module = core_modules_with_last_commit[pgm] + git_log["commit"] = core_module["commit"] + git_log["date"] = format_git_commit_date_from_local_git( + commit_datetime=core_module["date"], + ) + return git_log + + +def download_git_commit(url, response_format, *args, **kwargs): + """Download module/addon last commit from GitHub API + + :param str url: url address + :param str response_format: content type + + :return urllib.request.urlopen or None response: response object or + None + """ + try: + response = urlopen(url, *args, **kwargs) + if not response.code == 200: + index = HTTP_STATUS_CODES.index(response.code) + desc = HTTP_STATUS_CODES[index].description + gs.fatal( + _( + "Download commit from <{url}>, return status code " + "{code}, {desc}".format( + url=url, + code=response.code, + desc=desc, + ), + ), + ) + if response_format not in response.getheader("Content-Type"): + gs.fatal( + _( + "Wrong downloaded commit file format. " + "Check url <{url}>. Allowed file format is " + "{response_format}.".format( + url=url, + response_format=response_format, + ), + ), + ) + return response + except HTTPError as err: + gs.warning( + _( + "The download of the commit from the GitHub API " + "server wasn't successful, <{}>. Commit and commit " + "date will not be included in the <{}> addon html manual " + "page.".format(err.msg, pgm) + ), + ) + except URLError: + gs.warning( + _( + "Download file from <{url}>, failed. Check internet " + "connection. Commit and commit date will not be included " + "in the <{pgm}> addon manual page.".format(url=url, pgm=pgm) + ), + ) + + +def format_git_commit_date_from_rest_api( + commit_datetime, datetime_format="%A %b %d %H:%M:%S %Y" +): + """Format datetime from remote GitHub REST API + + :param str commit_datetime: commit datetime + :param str datetime_format: output commit datetime format + e.g. Sunday Jan 16 23:09:35 2022 + + :return str: output formatted commit datetime + """ + return datetime.strptime( + commit_datetime, + "%Y-%m-%dT%H:%M:%SZ", # ISO 8601 YYYY-MM-DDTHH:MM:SSZ + ).strftime(datetime_format) + + +def write_toc(data, hamburger_menu_toc=False): + """Write Table of Contents + + :param tuple data: parsed data from MyHTMLParser class instance + :param bool hamburger_menu_toc: write hamburger menu TOC for the + mobile, tablet screen + """ + + if not data: + return + + fd = sys.stdout + if hamburger_menu_toc: + fd.write(" +""" + ) + else: + fd.write("\n\n") + fd.write("\n") + + +def update_toc(data): + ret_data = [] + pat = re.compile(r"(<(h[2|3])>)(.+)()") + idx = 1 + for line in data.splitlines(): + if pat.search(line): + xline = pat.split(line) + line = ( + xline[1] + + '' % escape_href(xline[3]) + + xline[3] + + "" + + xline[4] + ) + idx += 1 + ret_data.append(line) + + return "\n".join(ret_data) + + +def escape_href(label): + # remove html tags + label = re.sub("<[^<]+?>", "", label) + # fix   + label = label.replace(" ", "") + # fix " + label = label.replace('"', "") + # replace space with underscore + lower + return label.replace(" ", "-").lower() + + +def create_toc(src_data): + class MyHTMLParser(HTMLParser): + def __init__(self): + HTMLParser.__init__(self) + self.reset() + self.idx = 1 + self.tag_curr = "" + self.tag_last = "" + self.process_text = False + self.data = [] + self.tags_allowed = ("h1", "h2", "h3") + self.tags_ignored = "img" + self.text = "" + + def handle_starttag(self, tag, attrs): + if tag in self.tags_allowed: + self.process_text = True + self.tag_last = self.tag_curr + self.tag_curr = tag + + def handle_endtag(self, tag): + if tag in self.tags_allowed: + self.data.append((tag, "%s_%d" % (tag, self.idx), self.text)) + self.idx += 1 + self.process_text = False + self.text = "" + + self.tag_curr = self.tag_last + + def handle_data(self, data): + if not self.process_text: + return + if self.tag_curr in self.tags_allowed or self.tag_curr in self.tags_ignored: + self.text += data + else: + self.text += "<%s>%s" % (self.tag_curr, data, self.tag_curr) + + # instantiate the parser and fed it some HTML + parser = MyHTMLParser() + parser.feed(src_data) + + return parser.data + + +def parse_source(): + """Parse source code to get source code and log message URLs, + and date time of the last modification. + + :return url_source, url_log, date_time + """ + grass_version = os.getenv("VERSION_NUMBER", "unknown") + main_url = "" + addons_url = "" + grass_git_branch = "main" + major, minor, patch = None, None, None + if grass_version != "unknown": + major, minor, patch = grass_version.split(".") + base_url = "https://github.com/OSGeo/" + main_url = urlparse.urljoin( + base_url, + urlparse.urljoin( + "grass/tree/", + grass_git_branch + "/", + ), + ) + addons_url = urlparse.urljoin( + base_url, + urlparse.urljoin( + "grass-addons/tree/", + get_version_branch( + major, + urlparse.urljoin(base_url, "grass-addons/"), + ), + ), + ) + + top_dir = os.path.abspath(os.getenv("MODULE_TOPDIR")) + cur_dir = os.path.abspath(os.path.curdir) + if cur_dir.startswith(top_dir + os.path.sep): + source_url = main_url + pgmdir = cur_dir.replace(top_dir, "").lstrip(os.path.sep) + else: + # addons + source_url = addons_url + pgmdir = os.path.sep.join(cur_dir.split(os.path.sep)[-3:]) + + url_source = "" + addon_path = None + if os.getenv("SOURCE_URL", ""): + addon_path = get_addon_path(base_url=base_url, major_version=major) + if addon_path: + # Addon is installed from the local dir + if os.path.exists(os.getenv("SOURCE_URL")): + url_source = urlparse.urljoin( + addons_url, + addon_path, + ) + else: + url_source = urlparse.urljoin( + os.environ["SOURCE_URL"].split("src")[0], + addon_path, + ) + else: + url_source = urlparse.urljoin(source_url, pgmdir) + if sys.platform == "win32": + url_source = url_source.replace(os.path.sep, "/") + + # Process Source code section + branches = "branches" + tree = "tree" + commits = "commits" + + if branches in url_source: + url_log = url_source.replace(branches, commits) + url_source = url_source.replace(branches, tree) + else: + url_log = url_source.replace(tree, commits) + + git_commit = get_last_git_commit( + src_dir=cur_dir if addon_path else top_dir, + top_dir=top_dir, + addon_path=addon_path if addon_path else None, + major=major, + ) + if git_commit["commit"] == "unknown": + date_tag = "Accessed: {date}".format(date=git_commit["date"]) + else: + date_tag = ( + "Latest change: {date} in commit: " + "[{commit}](https://github.com/OSGeo/grass/commit/{commit})".format( + date=git_commit["date"], commit=git_commit["commit"] + ) + ) + + return url_source, url_log, date_tag + + +def urlopen(url, *args, **kwargs): + """Wrapper around urlopen. Same function as 'urlopen', but with the + ability to define headers. + """ + request = urlrequest.Request(url, headers=HEADERS) + return urlrequest.urlopen(request, *args, **kwargs) + + +def get_addon_path(base_url, major_version): + """Check if pgm is in the addons list and get addon path + + Make or update list of the official addons source + code paths g.extension prefix parameter plus /grass-addons directory + using Git repository + + :param str base_url: base URL + :param str major_version: GRASS major version + + :return str|None: pgm path if pgm is addon else None + """ + addons_base_dir = os.getenv("GRASS_ADDON_BASE") + if addons_base_dir and major_version: + grass_addons_dir = pathlib.Path(addons_base_dir) / "grass-addons" + if gs: + call = gs.call + popen = gs.Popen + fatal = gs.fatal + else: + call = subprocess.call + popen = subprocess.Popen + fatal = sys.stderr.write + addons_branch = get_version_branch( + major_version=major_version, + addons_git_repo_url=urlparse.urljoin(base_url, "grass-addons/"), + ) + if not pathlib.Path(addons_base_dir).exists(): + pathlib.Path(addons_base_dir).mkdir(parents=True, exist_ok=True) + if not grass_addons_dir.exists(): + call( + [ + "git", + "clone", + "-q", + "--no-checkout", + f"--branch={addons_branch}", + "--filter=blob:none", + urlparse.urljoin(base_url, "grass-addons/"), + ], + cwd=addons_base_dir, + ) + addons_file_list = popen( + ["git", "ls-tree", "--name-only", "-r", addons_branch], + cwd=grass_addons_dir, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + addons_file_list, stderr = addons_file_list.communicate() + if stderr: + message = ( + "Failed to get addons files list from the" + " Git repository <{repo_path}>.\n{error}" + ) + if gs: + fatal( + _( + message, + ).format( + repo_path=grass_addons_dir, + error=gs.decode(stderr), + ) + ) + else: + message += "\n" + fatal( + message.format( + repo_path=grass_addons_dir, + error=stderr.decode(), + ) + ) + addon_paths = re.findall( + rf".*{pgm}*.", + gs.decode(addons_file_list) if gs else addons_file_list.decode(), + ) + for addon_path in addon_paths: + if pgm == pathlib.Path(addon_path).name: + return addon_path + + +def header(pgm): + name = re.search("()", src_data, re.IGNORECASE) + pgm_desc = "GRASS GIS Reference Manual" + if name: + pgm = name.group(2).strip().split("-", 1)[0].strip() + name_desc = re.search( + "()", src_data, re.IGNORECASE + ) + if name_desc: + pgm_desc = name_desc.group(2).strip() + desc = re.search("()", src_data, re.IGNORECASE) + if desc: + pgm = desc.group(2).strip() + header_tmpl = string.Template(header_base + header_nopgm) + else: + if not pgm_desc: + header_tmpl = string.Template(header_base + header_pgm) + else: + header_tmpl = string.Template(header_base + header_pgm_desc) + + return header_tmpl.substitute(PGM=pgm, PGM_DESC=pgm_desc) + + +if __name__ == "__main__": + pgm = sys.argv[1] + + src_file = f"{pgm}.md" + tmp_file = f"{pgm}.tmp.md" + + header_base = """ +# ${PGM} - GRASS GIS Manual +[![GRASS GIS](grass_logo.png 'GRASS GIS')](index.html) +""" + + header_nopgm = """## ${PGM} +""" + + header_pgm = """## NAME + ***${PGM}*** +""" + + header_pgm_desc = """## NAME +***${PGM}*** - ${PGM_DESC} +""" + + sourcecode = string.Template( + """ +## SOURCE CODE + +Available at: [${PGM} source code](${URL_SOURCE}) ([history](${URL_LOG}"))\\ +${DATE_TAG} +""" + ) + + footer_index = string.Template( + """___ +[Main index](index.html) | +[${INDEXNAMECAP} index](${HTML_PAGE_FOOTER_PAGES_PATH}${INDEXNAME}.html) | +[Topics index](${HTML_PAGE_FOOTER_PAGES_PATH}topics.html) | +[Keywords index](${HTML_PAGE_FOOTER_PAGES_PATH}keywords.html) | +[Graphical index](${HTML_PAGE_FOOTER_PAGES_PATH}graphical_index.html) | +[Full index](${HTML_PAGE_FOOTER_PAGES_PATH}full_index.html)\ +© 2003-${YEAR} +[GRASS Development Team](https://grass.osgeo.org"), +GRASS GIS ${GRASS_VERSION} Reference Manual +""" + ) + + footer_noindex = string.Template( + """___ +[Main index[(index.html) | +[Topics index](${HTML_PAGE_FOOTER_PAGES_PATH}topics.html) | +[Keywords index](${HTML_PAGE_FOOTER_PAGES_PATH}keywords.html) | +[Graphical index](${HTML_PAGE_FOOTER_PAGES_PATH}graphical_index.html) | +[Full index](${HTML_PAGE_FOOTER_PAGES_PATH}full_index.html)\ +© 2003-${YEAR} +[GRASS Development Team](https://grass.osgeo.org), +GRASS GIS ${GRASS_VERSION} Reference Manual +""" + ) + + # process header + src_data = read_file(src_file) + + # TODO: + # if not re.search("", src_data, re.IGNORECASE): + tmp_data = read_file(tmp_file) + # TODO: if not re.search("", tmp_data, re.IGNORECASE): + sys.stdout.write(header(pgm)) + if tmp_data: + header_logo_img_el = "![GRASS logo](grass_logo.png)" + for line in tmp_data.splitlines(True): + # The cleanup happens on Makefile level too. + # TODO: if not re.search( + # "|| ", line, re.IGNORECASE + # ): + if header_logo_img_el in line: + sys.stdout.write(line) + # create hamburger menu TOC + write_toc(create_toc(src_data), hamburger_menu_toc=True) + else: + sys.stdout.write(line) + + # process body + # TODO: sys.stdout.write(update_toc(src_data)) + sys.stdout.write(src_data) + + # if is found, suppose a complete html is provided. + # otherwise, generate module class reference: + # TODO: + + # process footer + url_source, url_log, date_tag = parse_source() + sys.stdout.write( + sourcecode.substitute( + URL_SOURCE=url_source, + PGM=pgm, + URL_LOG=url_log, + DATE_TAG=date_tag, + ) + ) From 307432f45b78da93667e71afddd96fde3b8437c2 Mon Sep 17 00:00:00 2001 From: Martin Landa Date: Sun, 16 Jun 2024 15:22:21 +0200 Subject: [PATCH 002/137] re-enable html builds --- include/Make/Html.make | 13 +++++++++++-- include/Make/HtmlRules.make | 5 ++++- utils/mkmarkdown.py | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/Make/Html.make b/include/Make/Html.make index 5b8c27f2fa6..a0f356760de 100644 --- a/include/Make/Html.make +++ b/include/Make/Html.make @@ -3,6 +3,11 @@ include $(MODULE_TOPDIR)/include/Make/HtmlRules.make +$(HTMLDIR)/%.html: %.html %.tmp.html $(HTMLSRC) $(IMGDST) | $(HTMLDIR) + VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) MODULE_TOPDIR=$(MODULE_TOPDIR) \ + $(PYTHON) $(GISBASE)/utils/mkhtml.py $* > $@ + +# TODO: mode to Markdown.make (?) $(MDDIR)/source/%.md: %.md %.tmp.md $(HTMLSRC) $(IMGDST) | $(MDDIR) VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) MODULE_TOPDIR=$(MODULE_TOPDIR) \ $(PYTHON) $(GISBASE)/utils/mkmarkdown.py $* > $@ @@ -10,8 +15,12 @@ $(MDDIR)/source/%.md: %.md %.tmp.md $(HTMLSRC) $(IMGDST) | $(MDDIR) $(MANDIR)/%.$(MANSECT): $(HTMLDIR)/%.html $(HTML2MAN) "$<" "$@" +%.tmp.html: $(HTMLSRC) + if [ "$(HTMLSRC)" != "" ] ; then $(call htmldesc,$<,$@) ; fi + +# TODO: mode to Markdown.make (?) %.tmp.md: $(HTMLSRC) - if [ "$(HTMLSRC)" != "" ] ; then $(call moduledesc,$<,$@) ; fi + if [ "$(HTMLSRC)" != "" ] ; then $(call mddesc,$<,$@) ; fi ifdef CROSS_COMPILING @@ -19,7 +28,7 @@ html: else -html: $(MDDIR)/source/$(PGM).md # $(MANDIR)/$(PGM).$(MANSECT) +html: $(HTMLDIR)/$(PGM).html $(MANDIR)/$(PGM).$(MANSECT) $(MDDIR)/source/$(PGM).md endif diff --git a/include/Make/HtmlRules.make b/include/Make/HtmlRules.make index f0696d8d9a5..152ed1a552d 100644 --- a/include/Make/HtmlRules.make +++ b/include/Make/HtmlRules.make @@ -1,7 +1,10 @@ # common html rules (included by Html.make and GuiScript.make) -moduledesc = $(call run_grass,$(1) --md-description < /dev/null | grep -v '\|\| ' > $(2)) +htmldesc = $(call run_grass,$(1) --html-description < /dev/null | grep -v '\|\| ' > $(2)) + +# TODO: mode to MarkdownRules.make (?) +mddesc = $(call run_grass,$(1) --md-description < /dev/null | grep -v '\|\| ' > $(2)) IMGSRC := $(wildcard *.png) $(wildcard *.jpg) $(wildcard *.gif) IMGDST := $(patsubst %,$(HTMLDIR)/%,$(IMGSRC)) diff --git a/utils/mkmarkdown.py b/utils/mkmarkdown.py index c7852fbd8c0..877feb6aafb 100644 --- a/utils/mkmarkdown.py +++ b/utils/mkmarkdown.py @@ -605,7 +605,7 @@ def parse_source(): src_dir=cur_dir if addon_path else top_dir, top_dir=top_dir, addon_path=addon_path if addon_path else None, - major=major, + major_version=major, ) if git_commit["commit"] == "unknown": date_tag = "Accessed: {date}".format(date=git_commit["date"]) From 5aa35641421c3c426dbbc07100b0748a5940e7d3 Mon Sep 17 00:00:00 2001 From: Martin Landa Date: Sun, 16 Jun 2024 15:39:10 +0200 Subject: [PATCH 003/137] rename "md" dir to "markdown" --- include/Make/Grass.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Make/Grass.make b/include/Make/Grass.make index 15e6ada3f9d..724adc913bb 100644 --- a/include/Make/Grass.make +++ b/include/Make/Grass.make @@ -59,7 +59,7 @@ DOCSDIR = $(ARCH_DISTDIR)/docs ETC = $(ARCH_DISTDIR)/etc GUIDIR = $(ARCH_DISTDIR)/gui HTMLDIR = $(ARCH_DISTDIR)/docs/html -MDDIR = $(ARCH_DISTDIR)/docs/md +MDDIR = $(ARCH_DISTDIR)/docs/markdown SCRIPTDIR = $(ARCH_DISTDIR)/scripts MSG_DIR = $(ARCH_DISTDIR)/etc/msgs MO_DIR = $(ARCH_DISTDIR)/locale From d33bcb934f8fcbabbb3f5a80a9486e0f87a9161c Mon Sep 17 00:00:00 2001 From: Martin Landa Date: Sun, 16 Jun 2024 15:45:34 +0200 Subject: [PATCH 004/137] add converted md file from html using pandoc --- db/databaseintro.md | 106 ++ db/db.columns/db.columns.md | 52 + db/db.connect/db.connect.md | 136 ++ db/db.copy/db.copy.md | 72 + db/db.createdb/db.createdb.md | 56 + db/db.databases/db.databases.md | 46 + db/db.describe/db.describe.md | 73 + db/db.drivers/db.drivers.md | 26 + db/db.dropdb/db.dropdb.md | 41 + db/db.execute/db.execute.md | 116 ++ db/db.login/db.login.md | 55 + db/db.select/db.select.md | 101 ++ db/db.tables/db.tables.md | 39 + db/drivers/dbf/grass-dbf.md | 116 ++ db/drivers/mysql/grass-mesql.md | 80 + db/drivers/mysql/grass-mysql.md | 106 ++ db/drivers/odbc/grass-odbc.md | 141 ++ db/drivers/ogr/grass-ogr.md | 7 + db/drivers/postgres/grass-pg.md | 133 ++ db/drivers/sqlite/grass-sqlite.md | 54 + display/d.barscale/d.barscale.md | 25 + display/d.colorlist/d.colorlist.md | 13 + display/d.colortable/d.colortable.md | 59 + display/d.erase/d.erase.md | 14 + display/d.extract/d.extract.md | 23 + display/d.font/d.font.md | 55 + display/d.fontlist/d.fontlist.md | 12 + display/d.geodesic/d.geodesic.md | 49 + display/d.graph/d.graph.md | 181 ++ display/d.grid/d.grid.md | 74 + display/d.his/d.his.md | 103 ++ display/d.histogram/d.histogram.md | 59 + display/d.info/d.info.md | 30 + display/d.labels/d.labels.md | 33 + display/d.legend.vect/d.legend.vect.md | 104 ++ display/d.legend/d.legend.md | 152 ++ display/d.linegraph/d.linegraph.md | 147 ++ display/d.mon/d.mon.md | 146 ++ display/d.northarrow/d.northarrow.md | 37 + display/d.path/d.path.md | 47 + display/d.profile/d.profile.md | 14 + display/d.rast.arrow/d.rast.arrow.md | 104 ++ display/d.rast.num/d.rast.num.md | 49 + display/d.rast/d.rast.md | 53 + display/d.redraw/d.redraw.md | 14 + display/d.rgb/d.rgb.md | 63 + display/d.rhumbline/d.rhumbline.md | 45 + display/d.text/d.text.md | 79 + display/d.title/d.title.md | 48 + display/d.vect.chart/d.vect.chart.md | 84 + display/d.vect.thematic/d.vect.thematic.md | 98 + display/d.vect/d.vect.md | 133 ++ display/d.where/d.where.md | 58 + display/displaydrivers.md | 63 + doc/grass_database.md | 206 +++ doc/gui/wxpython/example/g.gui.example.md | 37 + doc/projectionintro.md | 76 + doc/python/script/r.example.md | 29 + doc/raster/r.example/r.example.md | 29 + doc/vector/v.example/v.example.md | 28 + general/g.access/g.access.md | 39 + general/g.cairocomp/g.cairocomp.md | 14 + general/g.copy/g.copy.md | 78 + general/g.dirseps/g.dirseps.md | 9 + general/g.filename/g.filename.md | 58 + general/g.findetc/g.findetc.md | 22 + general/g.findfile/g.findfile.md | 97 + general/g.gisenv/g.gisenv.md | 165 ++ general/g.gui/g.gui.md | 68 + general/g.list/g.list.md | 212 +++ general/g.mapset/g.mapset.md | 69 + general/g.mapsets/g.mapsets.md | 178 ++ general/g.message/g.message.md | 138 ++ general/g.mkfontcap/g.mkfontcap.md | 57 + general/g.parser/g.parser.md | 665 +++++++ general/g.pnmcomp/g.pnmcomp.md | 37 + general/g.ppmtopng/g.ppmtopng.md | 8 + general/g.proj/g.proj.md | 245 +++ general/g.region/g.region.md | 350 ++++ general/g.remove/g.remove.md | 37 + general/g.rename/g.rename.md | 61 + general/g.setproj/g.setproj.md | 79 + general/g.tempfile/g.tempfile.md | 44 + general/g.version/g.version.md | 86 + gui/wxpython/animation/g.gui.animation.md | 93 + gui/wxpython/datacatalog/g.gui.datacatalog.md | 48 + gui/wxpython/dbmgr/g.gui.dbmgr.md | 58 + gui/wxpython/docs/wxGUI.components.md | 32 + gui/wxpython/docs/wxGUI.iscatt.md | 79 + gui/wxpython/docs/wxGUI.md | 617 +++++++ gui/wxpython/docs/wxGUI.modules.md | 167 ++ gui/wxpython/docs/wxGUI.nviz.md | 392 ++++ gui/wxpython/docs/wxGUI.toolboxes.md | 196 ++ gui/wxpython/docs/wxGUI.vnet.md | 90 + gui/wxpython/gcp/g.gui.gcp.md | 282 +++ gui/wxpython/gmodeler/g.gui.gmodeler.md | 390 ++++ gui/wxpython/iclass/g.gui.iclass.md | 71 + .../image2target/g.gui.image2target.md | 282 +++ gui/wxpython/mapswipe/g.gui.mapswipe.md | 45 + gui/wxpython/photo2image/g.gui.photo2image.md | 58 + gui/wxpython/psmap/g.gui.psmap.md | 199 ++ gui/wxpython/rdigit/g.gui.rdigit.md | 85 + gui/wxpython/rlisetup/g.gui.rlisetup.md | 252 +++ gui/wxpython/timeline/g.gui.timeline.md | 30 + gui/wxpython/tplot/g.gui.tplot.md | 82 + gui/wxpython/vdigit/g.gui.vdigit.md | 259 +++ imagery/i.albedo/i.albedo.md | 58 + imagery/i.aster.toar/i.aster.toar.md | 40 + imagery/i.atcorr/i.atcorr.md | 1013 +++++++++++ imagery/i.biomass/i.biomass.md | 44 + imagery/i.cca/i.cca.md | 59 + imagery/i.cluster/i.cluster.md | 257 +++ imagery/i.eb.eta/i.eb.eta.md | 49 + imagery/i.eb.evapfr/i.eb.evapfr.md | 42 + imagery/i.eb.hsebal01/i.eb.hsebal01.md | 61 + imagery/i.eb.netrad/i.eb.netrad.md | 43 + .../i.eb.soilheatflux/i.eb.soilheatflux.md | 60 + imagery/i.emissivity/i.emissivity.md | 40 + imagery/i.evapo.mh/i.evapo.mh.md | 28 + imagery/i.evapo.pm/i.evapo.pm.md | 84 + imagery/i.evapo.pt/i.evapo.pt.md | 34 + imagery/i.evapo.time/i.evapo.time.md | 73 + imagery/i.fft/i.fft.md | 56 + imagery/i.gensig/i.gensig.md | 109 ++ imagery/i.gensigset/i.gensigset.md | 168 ++ imagery/i.group/i.group.md | 45 + imagery/i.his.rgb/i.his.rgb.md | 31 + imagery/i.ifft/i.ifft.md | 42 + imagery/i.landsat.acca/i.landsat.acca.md | 52 + imagery/i.landsat.toar/i.landsat.toar.md | 256 +++ imagery/i.maxlik/i.maxlik.md | 116 ++ imagery/i.modis.qc/i.modis.qc.md | 533 ++++++ .../i.ortho.camera/i.ortho.camera.md | 97 + .../i.ortho.elev/i.ortho.elev.md | 17 + .../i.ortho.init/i.ortho.init.md | 98 + .../i.ortho.photo/i.ortho.photo.md | 324 ++++ .../i.ortho.rectify/i.ortho.rectify.md | 108 ++ .../i.ortho.target/i.ortho.target.md | 19 + .../i.ortho.transform/i.ortho.transform.md | 35 + imagery/i.pca/i.pca.md | 103 ++ imagery/i.rectify/i.rectify.md | 168 ++ imagery/i.rgb.his/i.rgb.his.md | 20 + imagery/i.segment/i.segment.md | 268 +++ imagery/i.signatures/i.signatures.md | 59 + imagery/i.smap/i.smap.md | 193 ++ imagery/i.svm.predict/i.svm.predict.md | 70 + imagery/i.svm.train/i.svm.train.md | 100 ++ imagery/i.target/i.target.md | 33 + imagery/i.topo.corr/i.topo.corr.md | 115 ++ imagery/i.vi/i.vi.md | 551 ++++++ imagery/i.zc/i.zc.md | 53 + imagery/imageryintro.md | 253 +++ lib/cairodriver/cairodriver.md | 162 ++ lib/db/dbmi_base/test/test.dbmi_base.lib.md | 2 + lib/db/sqlp/sql.md | 209 +++ lib/gmath/test/test.gmath.lib.md | 1 + lib/gpde/test/test.gpde.lib.md | 9 + lib/htmldriver/htmldriver.md | 163 ++ lib/init/grass.md | 474 +++++ lib/init/helptext.md | 86 + lib/init/variables.md | 569 ++++++ lib/pngdriver/pngdriver.md | 94 + lib/psdriver/psdriver.md | 79 + lib/raster3d/test/test.raster3d.lib.md | 9 + lib/vector/rtree/test_suite/test.rtree.lib.md | 0 lib/vector/vectorascii.md | 131 ++ misc/m.cogo/m.cogo.md | 140 ++ misc/m.measure/m.measure.md | 54 + misc/m.nviz.image/m.nviz.image.md | 31 + misc/m.nviz.script/m.nviz.script.md | 143 ++ misc/m.transform/m.transform.md | 71 + mswindows/README.md | 3 + mswindows/external/rbatch/README.md | 8 + ps/ps.map/ps.map.md | 1595 +++++++++++++++++ python/grass/docs/_templates/oholosidebar.md | 0 raster/r.basins.fill/r.basins.fill.md | 39 + raster/r.buffer/r.buffer.md | 109 ++ raster/r.buildvrt/r.buildvrt.md | 60 + raster/r.carve/r.carve.md | 106 ++ raster/r.category/r.category.md | 176 ++ raster/r.circle/r.circle.md | 49 + raster/r.clump/r.clump.md | 109 ++ raster/r.coin/r.coin.md | 172 ++ raster/r.colors.out/r.colors.out.md | 19 + raster/r.colors.out/r3.colors.out.md | 22 + raster/r.colors/r.colors.md | 277 +++ raster/r.colors/r3.colors.md | 28 + raster/r.composite/r.composite.md | 50 + raster/r.compress/r.compress.md | 240 +++ raster/r.contour/r.contour.md | 71 + raster/r.cost/r.cost.md | 292 +++ raster/r.covar/r.covar.md | 75 + raster/r.cross/r.cross.md | 81 + raster/r.describe/r.describe.md | 92 + raster/r.distance/r.distance.md | 69 + raster/r.drain/r.drain.md | 295 +++ raster/r.external.out/r.external.out.md | 82 + raster/r.external/r.external.md | 74 + raster/r.fill.dir/r.fill.dir.md | 160 ++ raster/r.fill.stats/r.fill.stats.md | 369 ++++ raster/r.flow/r.flow.md | 182 ++ raster/r.geomorphon/r.geomorphon.md | 260 +++ raster/r.grow.distance/r.grow.distance.md | 120 ++ raster/r.gwflow/r.gwflow.md | 159 ++ raster/r.his/r.his.md | 104 ++ raster/r.horizon/r.horizon.md | 250 +++ raster/r.in.ascii/r.in.ascii.md | 96 + raster/r.in.bin/r.in.bin.md | 148 ++ raster/r.in.gdal/r.in.gdal.md | 401 +++++ raster/r.in.gridatb/r.in.gridatb.md | 12 + raster/r.in.lidar/r.in.lidar.md | 559 ++++++ raster/r.in.mat/r.in.mat.md | 124 ++ raster/r.in.pdal/r.in.pdal.md | 596 ++++++ raster/r.in.png/r.in.png.md | 20 + raster/r.in.poly/r.in.poly.md | 86 + raster/r.in.xyz/r.in.xyz.md | 310 ++++ raster/r.info/r.info.md | 132 ++ raster/r.kappa/r.kappa.md | 144 ++ raster/r.lake/r.lake.md | 106 ++ raster/r.latlong/r.latlong.md | 28 + raster/r.li/r.li.cwed/r.li.cwed.md | 80 + raster/r.li/r.li.daemon/r.li.daemon.md | 98 + raster/r.li/r.li.dominance/r.li.dominance.md | 73 + .../r.li/r.li.edgedensity/r.li.edgedensity.md | 95 + raster/r.li/r.li.md | 201 +++ raster/r.li/r.li.mpa/r.li.mpa.md | 85 + raster/r.li/r.li.mps/r.li.mps.md | 80 + raster/r.li/r.li.padcv/r.li.padcv.md | 73 + raster/r.li/r.li.padrange/r.li.padrange.md | 74 + raster/r.li/r.li.padsd/r.li.padsd.md | 74 + .../r.li.patchdensity/r.li.patchdensity.md | 86 + raster/r.li/r.li.patchnum/r.li.patchnum.md | 69 + raster/r.li/r.li.pielou/r.li.pielou.md | 72 + raster/r.li/r.li.renyi/r.li.renyi.md | 74 + raster/r.li/r.li.richness/r.li.richness.md | 70 + raster/r.li/r.li.shannon/r.li.shannon.md | 72 + raster/r.li/r.li.shape/r.li.shape.md | 75 + raster/r.li/r.li.simpson/r.li.simpson.md | 72 + raster/r.mapcalc/r.mapcalc.md | 933 ++++++++++ raster/r.mapcalc/r3.mapcalc.md | 700 ++++++++ raster/r.mfilter/r.mfilter.md | 158 ++ raster/r.mode/r.mode.md | 51 + raster/r.neighbors/r.neighbors.md | 443 +++++ raster/r.null/r.null.md | 79 + raster/r.object.geometry/r.object.geometry.md | 44 + raster/r.out.ascii/r.out.ascii.md | 46 + raster/r.out.bin/r.out.bin.md | 39 + raster/r.out.gdal/r.out.gdal.md | 382 ++++ raster/r.out.gridatb/r.out.gridatb.md | 12 + raster/r.out.mat/r.out.mat.md | 97 + raster/r.out.mpeg/r.out.mpeg.md | 90 + raster/r.out.png/r.out.png.md | 35 + raster/r.out.pov/r.out.pov.md | 63 + raster/r.out.ppm/r.out.ppm.md | 53 + raster/r.out.ppm3/r.out.ppm3.md | 30 + raster/r.out.vrml/r.out.vrml.md | 59 + raster/r.out.vtk/r.out.vtk.md | 123 ++ raster/r.param.scale/r.param.scale.md | 88 + raster/r.patch/r.patch.md | 205 +++ raster/r.path/r.path.md | 194 ++ raster/r.profile/r.profile.md | 130 ++ raster/r.proj/r.proj.md | 306 ++++ raster/r.quant/r.quant.md | 33 + raster/r.quantile/r.quantile.md | 49 + raster/r.random.cells/r.random.cells.md | 126 ++ raster/r.random.surface/r.random.surface.md | 178 ++ raster/r.random/r.random.md | 145 ++ raster/r.reclass/r.reclass.md | 231 +++ raster/r.recode/r.recode.md | 75 + raster/r.region/r.region.md | 49 + raster/r.regression.line/r.regression.line.md | 78 + .../r.regression.multi/r.regression.multi.md | 93 + raster/r.relief/r.relief.md | 119 ++ raster/r.report/r.report.md | 132 ++ raster/r.resamp.bspline/r.resamp.bspline.md | 155 ++ raster/r.resamp.filter/r.resamp.filter.md | 97 + raster/r.resamp.interp/r.resamp.interp.md | 83 + raster/r.resamp.rst/r.resamp.rst.md | 172 ++ raster/r.resamp.stats/r.resamp.stats.md | 57 + raster/r.resample/r.resample.md | 44 + raster/r.rescale.eq/r.rescale.eq.md | 48 + raster/r.rescale/r.rescale.md | 47 + raster/r.ros/r.ros.md | 126 ++ .../r.series.accumulate.md | 156 ++ raster/r.series.interp/r.series.interp.md | 59 + raster/r.series/r.series.md | 249 +++ raster/r.sim/r.sim.sediment/r.sim.sediment.md | 92 + raster/r.sim/r.sim.water/r.sim.water.md | 246 +++ raster/r.slope.aspect/r.slope.aspect.md | 257 +++ .../r.solute.transport/r.solute.transport.md | 156 ++ raster/r.spread/r.spread.md | 125 ++ raster/r.spreadpath/r.spreadpath.md | 59 + raster/r.statistics/r.statistics.md | 68 + raster/r.stats.quantile/r.stats.quantile.md | 60 + raster/r.stats.zonal/r.stats.zonal.md | 61 + raster/r.stats/r.stats.md | 176 ++ raster/r.stream.extract/r.stream.extract.md | 253 +++ raster/r.sun/r.sun.md | 357 ++++ raster/r.sunhours/r.sunhours.md | 76 + raster/r.sunmask/r.sunmask.md | 126 ++ raster/r.support.stats/r.support.stats.md | 17 + raster/r.support/r.support.md | 85 + raster/r.surf.area/r.surf.area.md | 68 + raster/r.surf.contour/r.surf.contour.md | 101 ++ raster/r.surf.fractal/r.surf.fractal.md | 76 + raster/r.surf.gauss/r.surf.gauss.md | 44 + raster/r.surf.idw/r.surf.idw.md | 90 + raster/r.surf.random/r.surf.random.md | 48 + raster/r.terraflow/r.terraflow.md | 224 +++ raster/r.texture/r.texture.md | 280 +++ raster/r.thin/r.thin.md | 97 + raster/r.tile/r.tile.md | 38 + raster/r.timestamp/r.timestamp.md | 136 ++ raster/r.to.rast3/r.to.rast3.md | 54 + raster/r.to.rast3elev/r.to.rast3elev.md | 81 + raster/r.to.vect/r.to.vect.md | 128 ++ raster/r.topidx/r.topidx.md | 64 + raster/r.topmodel/r.topmodel.md | 153 ++ raster/r.transect/r.transect.md | 33 + raster/r.univar/r.univar.md | 246 +++ raster/r.univar/r3.univar.md | 102 ++ raster/r.uslek/r.uslek.md | 65 + raster/r.usler/r.usler.md | 22 + raster/r.viewshed/r.viewshed.md | 193 ++ raster/r.volume/r.volume.md | 140 ++ raster/r.walk/r.walk.md | 193 ++ raster/r.water.outlet/r.water.outlet.md | 61 + raster/r.watershed/front/r.watershed.md | 489 +++++ raster/r.what.color/r.what.color.md | 66 + raster/r.what/r.what.md | 185 ++ raster/rasterintro.md | 329 ++++ raster3d/r3.cross.rast/r3.cross.rast.md | 61 + raster3d/r3.flow/r3.flow.md | 110 ++ raster3d/r3.flow/test.r3flow.md | 11 + raster3d/r3.gradient/r3.gradient.md | 25 + raster3d/r3.gwflow/r3.gwflow.md | 144 ++ raster3d/r3.in.ascii/r3.in.ascii.md | 99 + raster3d/r3.in.bin/r3.in.bin.md | 50 + raster3d/r3.in.lidar/r3.in.lidar.md | 174 ++ raster3d/r3.in.v5d/r3.in.v5d.md | 21 + raster3d/r3.info/r3.info.md | 12 + raster3d/r3.mask/r3.mask.md | 17 + raster3d/r3.mkdspf/r3.mkdspf.md | 64 + raster3d/r3.neighbors/r3.neighbors.md | 86 + raster3d/r3.null/r3.null.md | 12 + raster3d/r3.out.ascii/r3.out.ascii.md | 205 +++ raster3d/r3.out.bin/r3.out.bin.md | 31 + raster3d/r3.out.netcdf/r3.out.netcdf.md | 265 +++ raster3d/r3.out.v5d/r3.out.v5d.md | 22 + raster3d/r3.out.vtk/r3.out.vtk.md | 171 ++ raster3d/r3.retile/r3.retile.md | 15 + raster3d/r3.showdspf/r3.showdspf.md | 138 ++ .../r3.showdspf/r3.showdspf_opengl_mods.md | 52 + raster3d/r3.stats/r3.stats.md | 98 + raster3d/r3.support/r3.support.md | 22 + raster3d/r3.timestamp/r3.timestamp.md | 68 + raster3d/r3.to.rast/r3.to.rast.md | 61 + raster3d/raster3dintro.md | 179 ++ scripts/d.background/d.background.md | 38 + scripts/d.correlate/d.correlate.md | 41 + scripts/d.frame/d.frame.md | 83 + scripts/d.out.file/d.out.file.md | 14 + scripts/d.polar/d.polar.md | 69 + scripts/d.rast.edit/d.rast.edit.md | 120 ++ scripts/d.rast.leg/d.rast.leg.md | 46 + scripts/d.shade/d.shade.md | 62 + scripts/d.to.rast/d.to.rast.md | 40 + scripts/d.what.rast/d.what.rast.md | 15 + scripts/d.what.vect/d.what.vect.md | 15 + scripts/db.dropcolumn/db.dropcolumn.md | 39 + scripts/db.droptable/db.droptable.md | 54 + scripts/db.in.ogr/db.in.ogr.md | 71 + scripts/db.out.ogr/db.out.ogr.md | 48 + scripts/db.test/db.test.md | 22 + scripts/db.univar/db.univar.md | 35 + .../g.download.location.md | 20 + scripts/g.extension.all/g.extension.all.md | 32 + scripts/g.extension/g.extension.md | 270 +++ .../r.plus.example/r.plus.example.md | 19 + scripts/g.manual/g.manual.md | 34 + scripts/g.search.modules/g.search.modules.md | 77 + scripts/i.band.library/i.band.library.md | 264 +++ scripts/i.colors.enhance/i.colors.enhance.md | 67 + scripts/i.image.mosaic/i.image.mosaic.md | 13 + scripts/i.in.spotvgt/i.in.spotvgt.md | 51 + scripts/i.oif/i.oif.md | 68 + scripts/i.pansharpen/i.pansharpen.md | 233 +++ scripts/i.spectral/i.spectral.md | 47 + scripts/i.tasscap/i.tasscap.md | 95 + scripts/m.proj/m.proj.md | 199 ++ scripts/r.blend/r.blend.md | 33 + scripts/r.buffer.lowmem/r.buffer.lowmem.md | 51 + scripts/r.colors.stddev/r.colors.stddev.md | 39 + scripts/r.drain/r.drain.md | 295 +++ scripts/r.fillnulls/r.fillnulls.md | 125 ++ scripts/r.grow/r.grow.md | 91 + scripts/r.import/r.import.md | 144 ++ scripts/r.in.aster/r.in.aster.md | 25 + scripts/r.in.srtm/r.in.srtm.md | 47 + scripts/r.in.wms/r.in.wms.md | 176 ++ scripts/r.mapcalc.simple/r.mapcalc.simple.md | 103 ++ scripts/r.mask/r.mask.md | 145 ++ scripts/r.out.xyz/r.out.xyz.md | 66 + scripts/r.pack/r.pack.md | 40 + scripts/r.plane/r.plane.md | 52 + scripts/r.reclass.area/r.reclass.area.md | 54 + scripts/r.rgb/r.rgb.md | 25 + scripts/r.semantic.label/r.semantic.label.md | 84 + scripts/r.shade/r.shade.md | 80 + scripts/r.tileset/r.tileset.md | 82 + scripts/r.unpack/r.unpack.md | 36 + scripts/r3.in.xyz/r3.in.xyz.md | 78 + scripts/v.build.all/v.build.all.md | 15 + scripts/v.centroids/v.centroids.md | 44 + scripts/v.clip/v.clip.md | 69 + scripts/v.db.addcolumn/v.db.addcolumn.md | 45 + scripts/v.db.addtable/v.db.addtable.md | 59 + scripts/v.db.dropcolumn/v.db.dropcolumn.md | 37 + scripts/v.db.droprow/v.db.droprow.md | 49 + scripts/v.db.droptable/v.db.droptable.md | 35 + scripts/v.db.join/v.db.join.md | 113 ++ .../v.db.reconnect.all/v.db.reconnect.all.md | 114 ++ .../v.db.renamecolumn/v.db.renamecolumn.md | 47 + scripts/v.db.univar/v.db.univar.md | 78 + scripts/v.db.update/v.db.update.md | 103 ++ scripts/v.dissolve/v.dissolve.md | 327 ++++ scripts/v.import/v.import.md | 70 + scripts/v.in.e00/v.in.e00.md | 26 + scripts/v.in.geonames/v.in.geonames.md | 71 + scripts/v.in.lines/v.in.lines.md | 45 + scripts/v.in.mapgen/v.in.mapgen.md | 32 + scripts/v.in.wfs/v.in.wfs.md | 56 + scripts/v.pack/v.pack.md | 34 + scripts/v.rast.stats/v.rast.stats.md | 83 + scripts/v.report/v.report.md | 36 + scripts/v.to.lines/v.to.lines.md | 39 + scripts/v.unpack/v.unpack.md | 32 + scripts/v.what.strds/v.what.strds.md | 23 + scripts/v.what.vect/v.what.vect.md | 75 + scripts/wxpyimgview/wxpyimgview.md | 20 + temporal/t.connect/t.connect.md | 64 + temporal/t.copy/t.copy.md | 37 + temporal/t.create/t.create.md | 50 + temporal/t.info/t.info.md | 173 ++ temporal/t.list/t.list.md | 90 + temporal/t.merge/t.merge.md | 222 +++ temporal/t.rast.accdetect/t.rast.accdetect.md | 75 + .../t.rast.accumulate/t.rast.accumulate.md | 284 +++ .../t.rast.aggregate.ds.md | 358 ++++ temporal/t.rast.aggregate/t.rast.aggregate.md | 204 +++ temporal/t.rast.algebra/t.rast.algebra.md | 633 +++++++ temporal/t.rast.colors/t.rast.colors.md | 64 + temporal/t.rast.contour/t.rast.contour.md | 36 + temporal/t.rast.export/t.rast.export.md | 140 ++ temporal/t.rast.extract/t.rast.extract.md | 60 + temporal/t.rast.gapfill/t.rast.gapfill.md | 82 + temporal/t.rast.import/t.rast.import.md | 35 + temporal/t.rast.list/t.rast.list.md | 239 +++ temporal/t.rast.mapcalc/t.rast.mapcalc.md | 181 ++ temporal/t.rast.neighbors/t.rast.neighbors.md | 115 ++ temporal/t.rast.out.vtk/t.rast.out.vtk.md | 41 + temporal/t.rast.series/t.rast.series.md | 103 ++ temporal/t.rast.to.rast3/t.rast.to.rast3.md | 161 ++ temporal/t.rast.to.vect/t.rast.to.vect.md | 36 + temporal/t.rast.univar/t.rast.univar.md | 56 + temporal/t.rast.what/t.rast.what.md | 128 ++ temporal/t.rast3d.algebra/t.rast3d.algebra.md | 31 + temporal/t.rast3d.extract/t.rast3d.extract.md | 19 + temporal/t.rast3d.list/t.rast3d.list.md | 16 + temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.md | 18 + temporal/t.rast3d.univar/t.rast3d.univar.md | 16 + temporal/t.register/t.register.md | 321 ++++ temporal/t.remove/t.remove.md | 56 + temporal/t.rename/t.rename.md | 35 + temporal/t.sample/t.sample.md | 171 ++ temporal/t.select/t.select.md | 400 +++++ temporal/t.shift/t.shift.md | 194 ++ temporal/t.snap/t.snap.md | 195 ++ temporal/t.support/t.support.md | 39 + temporal/t.topology/t.topology.md | 50 + temporal/t.unregister/t.unregister.md | 59 + temporal/t.upgrade/t.upgrade.md | 20 + temporal/t.vect.algebra/t.vect.algebra.md | 443 +++++ temporal/t.vect.db.select/t.vect.db.select.md | 49 + temporal/t.vect.export/t.vect.export.md | 125 ++ temporal/t.vect.extract/t.vect.extract.md | 85 + temporal/t.vect.import/t.vect.import.md | 64 + temporal/t.vect.list/t.vect.list.md | 62 + .../t.vect.observe.strds.md | 136 ++ temporal/t.vect.univar/t.vect.univar.md | 30 + .../t.vect.what.strds/t.vect.what.strds.md | 30 + temporal/temporalintro.md | 253 +++ vector/v.buffer/v.buffer.md | 140 ++ vector/v.build.polylines/v.build.polylines.md | 75 + vector/v.build/v.build.md | 74 + vector/v.category/v.category.md | 140 ++ vector/v.class/v.class.md | 84 + vector/v.clean/test/description.md | 11 + vector/v.clean/v.clean.md | 319 ++++ vector/v.cluster/v.cluster.md | 154 ++ vector/v.colors.out/v.colors.out.md | 21 + vector/v.colors/v.colors.md | 144 ++ vector/v.db.connect/v.db.connect.md | 199 ++ vector/v.db.select/v.db.select.md | 346 ++++ vector/v.decimate/v.decimate.md | 106 ++ vector/v.delaunay/v.delaunay.md | 35 + vector/v.distance/v.distance.md | 230 +++ vector/v.drape/v.drape.md | 63 + vector/v.edit/v.edit.md | 419 +++++ vector/v.external.out/v.external.out.md | 189 ++ vector/v.external/v.external.md | 140 ++ vector/v.extract/v.extract.md | 132 ++ vector/v.extrude/v.extrude.md | 67 + vector/v.fill.holes/v.fill.holes.md | 102 ++ vector/v.generalize/v.generalize.md | 306 ++++ vector/v.hull/v.hull.md | 65 + vector/v.in.ascii/v.in.ascii.md | 320 ++++ vector/v.in.db/v.in.db.md | 138 ++ vector/v.in.dwg/v.in.dwg.md | 35 + vector/v.in.dxf/v.in.dxf.md | 59 + vector/v.in.lidar/v.in.lidar.md | 144 ++ vector/v.in.ogr/v.in.ogr.md | 429 +++++ vector/v.in.pdal/v.in.pdal.md | 37 + vector/v.in.region/v.in.region.md | 31 + vector/v.info/v.info.md | 163 ++ vector/v.kcv/v.kcv.md | 57 + vector/v.kernel/v.kernel.md | 70 + vector/v.label.sa/v.label.sa.md | 46 + vector/v.label/v.label.md | 158 ++ .../v.lidar.correction/v.lidar.correction.md | 100 ++ .../v.lidar.edgedetection.md | 145 ++ vector/v.lidar.growing/v.lidar.growing.md | 85 + vector/v.lrs/lrs.md | 191 ++ vector/v.lrs/v.lrs.create/v.lrs.create.md | 157 ++ vector/v.lrs/v.lrs.label/v.lrs.label.md | 34 + vector/v.lrs/v.lrs.segment/v.lrs.segment.md | 57 + vector/v.lrs/v.lrs.where/v.lrs.where.md | 50 + vector/v.mkgrid/v.mkgrid.md | 175 ++ vector/v.neighbors/v.neighbors.md | 51 + vector/v.net.alloc/v.net.alloc.md | 225 +++ vector/v.net.allpairs/v.net.allpairs.md | 57 + vector/v.net.bridge/v.net.bridge.md | 40 + vector/v.net.centrality/v.net.centrality.md | 43 + vector/v.net.components/v.net.components.md | 47 + .../v.net.connectivity/v.net.connectivity.md | 40 + vector/v.net.distance/v.net.distance.md | 162 ++ vector/v.net.flow/v.net.flow.md | 52 + vector/v.net.iso/v.net.iso.md | 198 ++ vector/v.net.path/v.net.path.md | 190 ++ vector/v.net.salesman/v.net.salesman.md | 165 ++ .../v.net.spanningtree/v.net.spanningtree.md | 32 + vector/v.net.steiner/v.net.steiner.md | 128 ++ vector/v.net.timetable/v.net.timetable.md | 158 ++ vector/v.net.visibility/v.net.visibility.md | 214 +++ vector/v.net/v.net.md | 219 +++ vector/v.normal/v.normal.md | 52 + vector/v.out.ascii/v.out.ascii.md | 136 ++ vector/v.out.dxf/v.out.dxf.md | 29 + vector/v.out.lidar/v.out.lidar.md | 48 + vector/v.out.ogr/v.out.ogr.md | 192 ++ vector/v.out.postgis/v.out.postgis.md | 250 +++ vector/v.out.pov/v.out.pov.md | 29 + vector/v.out.svg/v.out.svg.md | 50 + vector/v.out.vtk/v.out.vtk.md | 89 + vector/v.outlier/v.outlier.md | 65 + vector/v.overlay/v.overlay.md | 225 +++ vector/v.parallel/v.parallel.md | 23 + vector/v.patch/v.patch.md | 61 + vector/v.perturb/v.perturb.md | 80 + vector/v.profile/v.profile.md | 87 + vector/v.proj/v.proj.md | 90 + vector/v.qcount/v.qcount.md | 104 ++ vector/v.random/v.random.md | 247 +++ vector/v.reclass/v.reclass.md | 84 + vector/v.rectify/v.rectify.md | 107 ++ vector/v.sample/v.sample.md | 69 + vector/v.segment/v.segment.md | 188 ++ vector/v.select/v.select.md | 281 +++ vector/v.split/v.split.md | 95 + vector/v.support/v.support.md | 22 + vector/v.surf.bspline/v.surf.bspline.md | 179 ++ vector/v.surf.idw/v.surf.idw.md | 89 + vector/v.surf.rst/v.surf.rst.md | 361 ++++ vector/v.timestamp/v.timestamp.md | 58 + vector/v.to.3d/v.to.3d.md | 47 + vector/v.to.db/v.to.db.md | 180 ++ vector/v.to.points/v.to.points.md | 119 ++ vector/v.to.rast/v.to.rast.md | 165 ++ vector/v.to.rast3/v.to.rast3.md | 26 + vector/v.transform/v.transform.md | 90 + vector/v.type/v.type.md | 21 + vector/v.univar/v.univar.md | 135 ++ vector/v.vect.stats/v.vect.stats.md | 206 +++ vector/v.vol.rst/v.vol.rst.md | 302 ++++ vector/v.voronoi/v.voronoi.md | 96 + vector/v.what.rast/v.what.rast.md | 105 ++ vector/v.what.rast3/v.what.rast3.md | 52 + vector/v.what/v.what.md | 36 + vector/vectorintro.md | 358 ++++ visualization/ximgview/ximgview.md | 39 + 600 files changed, 70795 insertions(+) create mode 100644 db/databaseintro.md create mode 100644 db/db.columns/db.columns.md create mode 100644 db/db.connect/db.connect.md create mode 100644 db/db.copy/db.copy.md create mode 100644 db/db.createdb/db.createdb.md create mode 100644 db/db.databases/db.databases.md create mode 100644 db/db.describe/db.describe.md create mode 100644 db/db.drivers/db.drivers.md create mode 100644 db/db.dropdb/db.dropdb.md create mode 100644 db/db.execute/db.execute.md create mode 100644 db/db.login/db.login.md create mode 100644 db/db.select/db.select.md create mode 100644 db/db.tables/db.tables.md create mode 100644 db/drivers/dbf/grass-dbf.md create mode 100644 db/drivers/mysql/grass-mesql.md create mode 100644 db/drivers/mysql/grass-mysql.md create mode 100644 db/drivers/odbc/grass-odbc.md create mode 100644 db/drivers/ogr/grass-ogr.md create mode 100644 db/drivers/postgres/grass-pg.md create mode 100644 db/drivers/sqlite/grass-sqlite.md create mode 100644 display/d.barscale/d.barscale.md create mode 100644 display/d.colorlist/d.colorlist.md create mode 100644 display/d.colortable/d.colortable.md create mode 100644 display/d.erase/d.erase.md create mode 100644 display/d.extract/d.extract.md create mode 100644 display/d.font/d.font.md create mode 100644 display/d.fontlist/d.fontlist.md create mode 100644 display/d.geodesic/d.geodesic.md create mode 100644 display/d.graph/d.graph.md create mode 100644 display/d.grid/d.grid.md create mode 100644 display/d.his/d.his.md create mode 100644 display/d.histogram/d.histogram.md create mode 100644 display/d.info/d.info.md create mode 100644 display/d.labels/d.labels.md create mode 100644 display/d.legend.vect/d.legend.vect.md create mode 100644 display/d.legend/d.legend.md create mode 100644 display/d.linegraph/d.linegraph.md create mode 100644 display/d.mon/d.mon.md create mode 100644 display/d.northarrow/d.northarrow.md create mode 100644 display/d.path/d.path.md create mode 100644 display/d.profile/d.profile.md create mode 100644 display/d.rast.arrow/d.rast.arrow.md create mode 100644 display/d.rast.num/d.rast.num.md create mode 100644 display/d.rast/d.rast.md create mode 100644 display/d.redraw/d.redraw.md create mode 100644 display/d.rgb/d.rgb.md create mode 100644 display/d.rhumbline/d.rhumbline.md create mode 100644 display/d.text/d.text.md create mode 100644 display/d.title/d.title.md create mode 100644 display/d.vect.chart/d.vect.chart.md create mode 100644 display/d.vect.thematic/d.vect.thematic.md create mode 100644 display/d.vect/d.vect.md create mode 100644 display/d.where/d.where.md create mode 100644 display/displaydrivers.md create mode 100644 doc/grass_database.md create mode 100644 doc/gui/wxpython/example/g.gui.example.md create mode 100644 doc/projectionintro.md create mode 100644 doc/python/script/r.example.md create mode 100644 doc/raster/r.example/r.example.md create mode 100644 doc/vector/v.example/v.example.md create mode 100644 general/g.access/g.access.md create mode 100644 general/g.cairocomp/g.cairocomp.md create mode 100644 general/g.copy/g.copy.md create mode 100644 general/g.dirseps/g.dirseps.md create mode 100644 general/g.filename/g.filename.md create mode 100644 general/g.findetc/g.findetc.md create mode 100644 general/g.findfile/g.findfile.md create mode 100644 general/g.gisenv/g.gisenv.md create mode 100644 general/g.gui/g.gui.md create mode 100644 general/g.list/g.list.md create mode 100644 general/g.mapset/g.mapset.md create mode 100644 general/g.mapsets/g.mapsets.md create mode 100644 general/g.message/g.message.md create mode 100644 general/g.mkfontcap/g.mkfontcap.md create mode 100644 general/g.parser/g.parser.md create mode 100644 general/g.pnmcomp/g.pnmcomp.md create mode 100644 general/g.ppmtopng/g.ppmtopng.md create mode 100644 general/g.proj/g.proj.md create mode 100644 general/g.region/g.region.md create mode 100644 general/g.remove/g.remove.md create mode 100644 general/g.rename/g.rename.md create mode 100644 general/g.setproj/g.setproj.md create mode 100644 general/g.tempfile/g.tempfile.md create mode 100644 general/g.version/g.version.md create mode 100644 gui/wxpython/animation/g.gui.animation.md create mode 100644 gui/wxpython/datacatalog/g.gui.datacatalog.md create mode 100644 gui/wxpython/dbmgr/g.gui.dbmgr.md create mode 100644 gui/wxpython/docs/wxGUI.components.md create mode 100644 gui/wxpython/docs/wxGUI.iscatt.md create mode 100644 gui/wxpython/docs/wxGUI.md create mode 100644 gui/wxpython/docs/wxGUI.modules.md create mode 100644 gui/wxpython/docs/wxGUI.nviz.md create mode 100644 gui/wxpython/docs/wxGUI.toolboxes.md create mode 100644 gui/wxpython/docs/wxGUI.vnet.md create mode 100644 gui/wxpython/gcp/g.gui.gcp.md create mode 100644 gui/wxpython/gmodeler/g.gui.gmodeler.md create mode 100644 gui/wxpython/iclass/g.gui.iclass.md create mode 100644 gui/wxpython/image2target/g.gui.image2target.md create mode 100644 gui/wxpython/mapswipe/g.gui.mapswipe.md create mode 100644 gui/wxpython/photo2image/g.gui.photo2image.md create mode 100644 gui/wxpython/psmap/g.gui.psmap.md create mode 100644 gui/wxpython/rdigit/g.gui.rdigit.md create mode 100644 gui/wxpython/rlisetup/g.gui.rlisetup.md create mode 100644 gui/wxpython/timeline/g.gui.timeline.md create mode 100644 gui/wxpython/tplot/g.gui.tplot.md create mode 100644 gui/wxpython/vdigit/g.gui.vdigit.md create mode 100644 imagery/i.albedo/i.albedo.md create mode 100644 imagery/i.aster.toar/i.aster.toar.md create mode 100644 imagery/i.atcorr/i.atcorr.md create mode 100644 imagery/i.biomass/i.biomass.md create mode 100644 imagery/i.cca/i.cca.md create mode 100644 imagery/i.cluster/i.cluster.md create mode 100644 imagery/i.eb.eta/i.eb.eta.md create mode 100644 imagery/i.eb.evapfr/i.eb.evapfr.md create mode 100644 imagery/i.eb.hsebal01/i.eb.hsebal01.md create mode 100644 imagery/i.eb.netrad/i.eb.netrad.md create mode 100644 imagery/i.eb.soilheatflux/i.eb.soilheatflux.md create mode 100644 imagery/i.emissivity/i.emissivity.md create mode 100644 imagery/i.evapo.mh/i.evapo.mh.md create mode 100644 imagery/i.evapo.pm/i.evapo.pm.md create mode 100644 imagery/i.evapo.pt/i.evapo.pt.md create mode 100644 imagery/i.evapo.time/i.evapo.time.md create mode 100644 imagery/i.fft/i.fft.md create mode 100644 imagery/i.gensig/i.gensig.md create mode 100644 imagery/i.gensigset/i.gensigset.md create mode 100644 imagery/i.group/i.group.md create mode 100644 imagery/i.his.rgb/i.his.rgb.md create mode 100644 imagery/i.ifft/i.ifft.md create mode 100644 imagery/i.landsat.acca/i.landsat.acca.md create mode 100644 imagery/i.landsat.toar/i.landsat.toar.md create mode 100644 imagery/i.maxlik/i.maxlik.md create mode 100644 imagery/i.modis.qc/i.modis.qc.md create mode 100644 imagery/i.ortho.photo/i.ortho.camera/i.ortho.camera.md create mode 100644 imagery/i.ortho.photo/i.ortho.elev/i.ortho.elev.md create mode 100644 imagery/i.ortho.photo/i.ortho.init/i.ortho.init.md create mode 100644 imagery/i.ortho.photo/i.ortho.photo/i.ortho.photo.md create mode 100644 imagery/i.ortho.photo/i.ortho.rectify/i.ortho.rectify.md create mode 100644 imagery/i.ortho.photo/i.ortho.target/i.ortho.target.md create mode 100644 imagery/i.ortho.photo/i.ortho.transform/i.ortho.transform.md create mode 100644 imagery/i.pca/i.pca.md create mode 100644 imagery/i.rectify/i.rectify.md create mode 100644 imagery/i.rgb.his/i.rgb.his.md create mode 100644 imagery/i.segment/i.segment.md create mode 100644 imagery/i.signatures/i.signatures.md create mode 100644 imagery/i.smap/i.smap.md create mode 100644 imagery/i.svm.predict/i.svm.predict.md create mode 100644 imagery/i.svm.train/i.svm.train.md create mode 100644 imagery/i.target/i.target.md create mode 100644 imagery/i.topo.corr/i.topo.corr.md create mode 100644 imagery/i.vi/i.vi.md create mode 100644 imagery/i.zc/i.zc.md create mode 100644 imagery/imageryintro.md create mode 100644 lib/cairodriver/cairodriver.md create mode 100644 lib/db/dbmi_base/test/test.dbmi_base.lib.md create mode 100644 lib/db/sqlp/sql.md create mode 100644 lib/gmath/test/test.gmath.lib.md create mode 100644 lib/gpde/test/test.gpde.lib.md create mode 100644 lib/htmldriver/htmldriver.md create mode 100644 lib/init/grass.md create mode 100644 lib/init/helptext.md create mode 100644 lib/init/variables.md create mode 100644 lib/pngdriver/pngdriver.md create mode 100644 lib/psdriver/psdriver.md create mode 100644 lib/raster3d/test/test.raster3d.lib.md create mode 100644 lib/vector/rtree/test_suite/test.rtree.lib.md create mode 100644 lib/vector/vectorascii.md create mode 100644 misc/m.cogo/m.cogo.md create mode 100644 misc/m.measure/m.measure.md create mode 100644 misc/m.nviz.image/m.nviz.image.md create mode 100644 misc/m.nviz.script/m.nviz.script.md create mode 100644 misc/m.transform/m.transform.md create mode 100644 mswindows/README.md create mode 100644 mswindows/external/rbatch/README.md create mode 100644 ps/ps.map/ps.map.md create mode 100644 python/grass/docs/_templates/oholosidebar.md create mode 100644 raster/r.basins.fill/r.basins.fill.md create mode 100644 raster/r.buffer/r.buffer.md create mode 100644 raster/r.buildvrt/r.buildvrt.md create mode 100644 raster/r.carve/r.carve.md create mode 100644 raster/r.category/r.category.md create mode 100644 raster/r.circle/r.circle.md create mode 100644 raster/r.clump/r.clump.md create mode 100644 raster/r.coin/r.coin.md create mode 100644 raster/r.colors.out/r.colors.out.md create mode 100644 raster/r.colors.out/r3.colors.out.md create mode 100644 raster/r.colors/r.colors.md create mode 100644 raster/r.colors/r3.colors.md create mode 100644 raster/r.composite/r.composite.md create mode 100644 raster/r.compress/r.compress.md create mode 100644 raster/r.contour/r.contour.md create mode 100644 raster/r.cost/r.cost.md create mode 100644 raster/r.covar/r.covar.md create mode 100644 raster/r.cross/r.cross.md create mode 100644 raster/r.describe/r.describe.md create mode 100644 raster/r.distance/r.distance.md create mode 100644 raster/r.drain/r.drain.md create mode 100644 raster/r.external.out/r.external.out.md create mode 100644 raster/r.external/r.external.md create mode 100644 raster/r.fill.dir/r.fill.dir.md create mode 100644 raster/r.fill.stats/r.fill.stats.md create mode 100644 raster/r.flow/r.flow.md create mode 100644 raster/r.geomorphon/r.geomorphon.md create mode 100644 raster/r.grow.distance/r.grow.distance.md create mode 100644 raster/r.gwflow/r.gwflow.md create mode 100644 raster/r.his/r.his.md create mode 100644 raster/r.horizon/r.horizon.md create mode 100644 raster/r.in.ascii/r.in.ascii.md create mode 100644 raster/r.in.bin/r.in.bin.md create mode 100644 raster/r.in.gdal/r.in.gdal.md create mode 100644 raster/r.in.gridatb/r.in.gridatb.md create mode 100644 raster/r.in.lidar/r.in.lidar.md create mode 100644 raster/r.in.mat/r.in.mat.md create mode 100644 raster/r.in.pdal/r.in.pdal.md create mode 100644 raster/r.in.png/r.in.png.md create mode 100644 raster/r.in.poly/r.in.poly.md create mode 100644 raster/r.in.xyz/r.in.xyz.md create mode 100644 raster/r.info/r.info.md create mode 100644 raster/r.kappa/r.kappa.md create mode 100644 raster/r.lake/r.lake.md create mode 100644 raster/r.latlong/r.latlong.md create mode 100644 raster/r.li/r.li.cwed/r.li.cwed.md create mode 100644 raster/r.li/r.li.daemon/r.li.daemon.md create mode 100644 raster/r.li/r.li.dominance/r.li.dominance.md create mode 100644 raster/r.li/r.li.edgedensity/r.li.edgedensity.md create mode 100644 raster/r.li/r.li.md create mode 100644 raster/r.li/r.li.mpa/r.li.mpa.md create mode 100644 raster/r.li/r.li.mps/r.li.mps.md create mode 100644 raster/r.li/r.li.padcv/r.li.padcv.md create mode 100644 raster/r.li/r.li.padrange/r.li.padrange.md create mode 100644 raster/r.li/r.li.padsd/r.li.padsd.md create mode 100644 raster/r.li/r.li.patchdensity/r.li.patchdensity.md create mode 100644 raster/r.li/r.li.patchnum/r.li.patchnum.md create mode 100644 raster/r.li/r.li.pielou/r.li.pielou.md create mode 100644 raster/r.li/r.li.renyi/r.li.renyi.md create mode 100644 raster/r.li/r.li.richness/r.li.richness.md create mode 100644 raster/r.li/r.li.shannon/r.li.shannon.md create mode 100644 raster/r.li/r.li.shape/r.li.shape.md create mode 100644 raster/r.li/r.li.simpson/r.li.simpson.md create mode 100644 raster/r.mapcalc/r.mapcalc.md create mode 100644 raster/r.mapcalc/r3.mapcalc.md create mode 100644 raster/r.mfilter/r.mfilter.md create mode 100644 raster/r.mode/r.mode.md create mode 100644 raster/r.neighbors/r.neighbors.md create mode 100644 raster/r.null/r.null.md create mode 100644 raster/r.object.geometry/r.object.geometry.md create mode 100644 raster/r.out.ascii/r.out.ascii.md create mode 100644 raster/r.out.bin/r.out.bin.md create mode 100644 raster/r.out.gdal/r.out.gdal.md create mode 100644 raster/r.out.gridatb/r.out.gridatb.md create mode 100644 raster/r.out.mat/r.out.mat.md create mode 100644 raster/r.out.mpeg/r.out.mpeg.md create mode 100644 raster/r.out.png/r.out.png.md create mode 100644 raster/r.out.pov/r.out.pov.md create mode 100644 raster/r.out.ppm/r.out.ppm.md create mode 100644 raster/r.out.ppm3/r.out.ppm3.md create mode 100644 raster/r.out.vrml/r.out.vrml.md create mode 100644 raster/r.out.vtk/r.out.vtk.md create mode 100644 raster/r.param.scale/r.param.scale.md create mode 100644 raster/r.patch/r.patch.md create mode 100644 raster/r.path/r.path.md create mode 100644 raster/r.profile/r.profile.md create mode 100644 raster/r.proj/r.proj.md create mode 100644 raster/r.quant/r.quant.md create mode 100644 raster/r.quantile/r.quantile.md create mode 100644 raster/r.random.cells/r.random.cells.md create mode 100644 raster/r.random.surface/r.random.surface.md create mode 100644 raster/r.random/r.random.md create mode 100644 raster/r.reclass/r.reclass.md create mode 100644 raster/r.recode/r.recode.md create mode 100644 raster/r.region/r.region.md create mode 100644 raster/r.regression.line/r.regression.line.md create mode 100644 raster/r.regression.multi/r.regression.multi.md create mode 100644 raster/r.relief/r.relief.md create mode 100644 raster/r.report/r.report.md create mode 100644 raster/r.resamp.bspline/r.resamp.bspline.md create mode 100644 raster/r.resamp.filter/r.resamp.filter.md create mode 100644 raster/r.resamp.interp/r.resamp.interp.md create mode 100644 raster/r.resamp.rst/r.resamp.rst.md create mode 100644 raster/r.resamp.stats/r.resamp.stats.md create mode 100644 raster/r.resample/r.resample.md create mode 100644 raster/r.rescale.eq/r.rescale.eq.md create mode 100644 raster/r.rescale/r.rescale.md create mode 100644 raster/r.ros/r.ros.md create mode 100644 raster/r.series.accumulate/r.series.accumulate.md create mode 100644 raster/r.series.interp/r.series.interp.md create mode 100644 raster/r.series/r.series.md create mode 100644 raster/r.sim/r.sim.sediment/r.sim.sediment.md create mode 100644 raster/r.sim/r.sim.water/r.sim.water.md create mode 100644 raster/r.slope.aspect/r.slope.aspect.md create mode 100644 raster/r.solute.transport/r.solute.transport.md create mode 100644 raster/r.spread/r.spread.md create mode 100644 raster/r.spreadpath/r.spreadpath.md create mode 100644 raster/r.statistics/r.statistics.md create mode 100644 raster/r.stats.quantile/r.stats.quantile.md create mode 100644 raster/r.stats.zonal/r.stats.zonal.md create mode 100644 raster/r.stats/r.stats.md create mode 100644 raster/r.stream.extract/r.stream.extract.md create mode 100644 raster/r.sun/r.sun.md create mode 100644 raster/r.sunhours/r.sunhours.md create mode 100644 raster/r.sunmask/r.sunmask.md create mode 100644 raster/r.support.stats/r.support.stats.md create mode 100644 raster/r.support/r.support.md create mode 100644 raster/r.surf.area/r.surf.area.md create mode 100644 raster/r.surf.contour/r.surf.contour.md create mode 100644 raster/r.surf.fractal/r.surf.fractal.md create mode 100644 raster/r.surf.gauss/r.surf.gauss.md create mode 100644 raster/r.surf.idw/r.surf.idw.md create mode 100644 raster/r.surf.random/r.surf.random.md create mode 100644 raster/r.terraflow/r.terraflow.md create mode 100644 raster/r.texture/r.texture.md create mode 100644 raster/r.thin/r.thin.md create mode 100644 raster/r.tile/r.tile.md create mode 100644 raster/r.timestamp/r.timestamp.md create mode 100644 raster/r.to.rast3/r.to.rast3.md create mode 100644 raster/r.to.rast3elev/r.to.rast3elev.md create mode 100644 raster/r.to.vect/r.to.vect.md create mode 100644 raster/r.topidx/r.topidx.md create mode 100644 raster/r.topmodel/r.topmodel.md create mode 100644 raster/r.transect/r.transect.md create mode 100644 raster/r.univar/r.univar.md create mode 100644 raster/r.univar/r3.univar.md create mode 100644 raster/r.uslek/r.uslek.md create mode 100644 raster/r.usler/r.usler.md create mode 100644 raster/r.viewshed/r.viewshed.md create mode 100644 raster/r.volume/r.volume.md create mode 100644 raster/r.walk/r.walk.md create mode 100644 raster/r.water.outlet/r.water.outlet.md create mode 100644 raster/r.watershed/front/r.watershed.md create mode 100644 raster/r.what.color/r.what.color.md create mode 100644 raster/r.what/r.what.md create mode 100644 raster/rasterintro.md create mode 100644 raster3d/r3.cross.rast/r3.cross.rast.md create mode 100644 raster3d/r3.flow/r3.flow.md create mode 100644 raster3d/r3.flow/test.r3flow.md create mode 100644 raster3d/r3.gradient/r3.gradient.md create mode 100644 raster3d/r3.gwflow/r3.gwflow.md create mode 100644 raster3d/r3.in.ascii/r3.in.ascii.md create mode 100644 raster3d/r3.in.bin/r3.in.bin.md create mode 100644 raster3d/r3.in.lidar/r3.in.lidar.md create mode 100644 raster3d/r3.in.v5d/r3.in.v5d.md create mode 100644 raster3d/r3.info/r3.info.md create mode 100644 raster3d/r3.mask/r3.mask.md create mode 100644 raster3d/r3.mkdspf/r3.mkdspf.md create mode 100644 raster3d/r3.neighbors/r3.neighbors.md create mode 100644 raster3d/r3.null/r3.null.md create mode 100644 raster3d/r3.out.ascii/r3.out.ascii.md create mode 100644 raster3d/r3.out.bin/r3.out.bin.md create mode 100644 raster3d/r3.out.netcdf/r3.out.netcdf.md create mode 100644 raster3d/r3.out.v5d/r3.out.v5d.md create mode 100644 raster3d/r3.out.vtk/r3.out.vtk.md create mode 100644 raster3d/r3.retile/r3.retile.md create mode 100644 raster3d/r3.showdspf/r3.showdspf.md create mode 100644 raster3d/r3.showdspf/r3.showdspf_opengl_mods.md create mode 100644 raster3d/r3.stats/r3.stats.md create mode 100644 raster3d/r3.support/r3.support.md create mode 100644 raster3d/r3.timestamp/r3.timestamp.md create mode 100644 raster3d/r3.to.rast/r3.to.rast.md create mode 100644 raster3d/raster3dintro.md create mode 100644 scripts/d.background/d.background.md create mode 100644 scripts/d.correlate/d.correlate.md create mode 100644 scripts/d.frame/d.frame.md create mode 100644 scripts/d.out.file/d.out.file.md create mode 100644 scripts/d.polar/d.polar.md create mode 100644 scripts/d.rast.edit/d.rast.edit.md create mode 100644 scripts/d.rast.leg/d.rast.leg.md create mode 100644 scripts/d.shade/d.shade.md create mode 100644 scripts/d.to.rast/d.to.rast.md create mode 100644 scripts/d.what.rast/d.what.rast.md create mode 100644 scripts/d.what.vect/d.what.vect.md create mode 100644 scripts/db.dropcolumn/db.dropcolumn.md create mode 100644 scripts/db.droptable/db.droptable.md create mode 100644 scripts/db.in.ogr/db.in.ogr.md create mode 100644 scripts/db.out.ogr/db.out.ogr.md create mode 100644 scripts/db.test/db.test.md create mode 100644 scripts/db.univar/db.univar.md create mode 100644 scripts/g.download.location/g.download.location.md create mode 100644 scripts/g.extension.all/g.extension.all.md create mode 100644 scripts/g.extension/g.extension.md create mode 100644 scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.md create mode 100644 scripts/g.manual/g.manual.md create mode 100644 scripts/g.search.modules/g.search.modules.md create mode 100644 scripts/i.band.library/i.band.library.md create mode 100644 scripts/i.colors.enhance/i.colors.enhance.md create mode 100644 scripts/i.image.mosaic/i.image.mosaic.md create mode 100644 scripts/i.in.spotvgt/i.in.spotvgt.md create mode 100644 scripts/i.oif/i.oif.md create mode 100644 scripts/i.pansharpen/i.pansharpen.md create mode 100644 scripts/i.spectral/i.spectral.md create mode 100644 scripts/i.tasscap/i.tasscap.md create mode 100644 scripts/m.proj/m.proj.md create mode 100644 scripts/r.blend/r.blend.md create mode 100644 scripts/r.buffer.lowmem/r.buffer.lowmem.md create mode 100644 scripts/r.colors.stddev/r.colors.stddev.md create mode 100644 scripts/r.drain/r.drain.md create mode 100644 scripts/r.fillnulls/r.fillnulls.md create mode 100644 scripts/r.grow/r.grow.md create mode 100644 scripts/r.import/r.import.md create mode 100644 scripts/r.in.aster/r.in.aster.md create mode 100644 scripts/r.in.srtm/r.in.srtm.md create mode 100644 scripts/r.in.wms/r.in.wms.md create mode 100644 scripts/r.mapcalc.simple/r.mapcalc.simple.md create mode 100644 scripts/r.mask/r.mask.md create mode 100644 scripts/r.out.xyz/r.out.xyz.md create mode 100644 scripts/r.pack/r.pack.md create mode 100644 scripts/r.plane/r.plane.md create mode 100644 scripts/r.reclass.area/r.reclass.area.md create mode 100644 scripts/r.rgb/r.rgb.md create mode 100644 scripts/r.semantic.label/r.semantic.label.md create mode 100644 scripts/r.shade/r.shade.md create mode 100644 scripts/r.tileset/r.tileset.md create mode 100644 scripts/r.unpack/r.unpack.md create mode 100644 scripts/r3.in.xyz/r3.in.xyz.md create mode 100644 scripts/v.build.all/v.build.all.md create mode 100644 scripts/v.centroids/v.centroids.md create mode 100644 scripts/v.clip/v.clip.md create mode 100644 scripts/v.db.addcolumn/v.db.addcolumn.md create mode 100644 scripts/v.db.addtable/v.db.addtable.md create mode 100644 scripts/v.db.dropcolumn/v.db.dropcolumn.md create mode 100644 scripts/v.db.droprow/v.db.droprow.md create mode 100644 scripts/v.db.droptable/v.db.droptable.md create mode 100644 scripts/v.db.join/v.db.join.md create mode 100644 scripts/v.db.reconnect.all/v.db.reconnect.all.md create mode 100644 scripts/v.db.renamecolumn/v.db.renamecolumn.md create mode 100644 scripts/v.db.univar/v.db.univar.md create mode 100644 scripts/v.db.update/v.db.update.md create mode 100644 scripts/v.dissolve/v.dissolve.md create mode 100644 scripts/v.import/v.import.md create mode 100644 scripts/v.in.e00/v.in.e00.md create mode 100644 scripts/v.in.geonames/v.in.geonames.md create mode 100644 scripts/v.in.lines/v.in.lines.md create mode 100644 scripts/v.in.mapgen/v.in.mapgen.md create mode 100644 scripts/v.in.wfs/v.in.wfs.md create mode 100644 scripts/v.pack/v.pack.md create mode 100644 scripts/v.rast.stats/v.rast.stats.md create mode 100644 scripts/v.report/v.report.md create mode 100644 scripts/v.to.lines/v.to.lines.md create mode 100644 scripts/v.unpack/v.unpack.md create mode 100644 scripts/v.what.strds/v.what.strds.md create mode 100644 scripts/v.what.vect/v.what.vect.md create mode 100644 scripts/wxpyimgview/wxpyimgview.md create mode 100644 temporal/t.connect/t.connect.md create mode 100644 temporal/t.copy/t.copy.md create mode 100644 temporal/t.create/t.create.md create mode 100644 temporal/t.info/t.info.md create mode 100644 temporal/t.list/t.list.md create mode 100644 temporal/t.merge/t.merge.md create mode 100644 temporal/t.rast.accdetect/t.rast.accdetect.md create mode 100644 temporal/t.rast.accumulate/t.rast.accumulate.md create mode 100644 temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.md create mode 100644 temporal/t.rast.aggregate/t.rast.aggregate.md create mode 100644 temporal/t.rast.algebra/t.rast.algebra.md create mode 100644 temporal/t.rast.colors/t.rast.colors.md create mode 100644 temporal/t.rast.contour/t.rast.contour.md create mode 100644 temporal/t.rast.export/t.rast.export.md create mode 100644 temporal/t.rast.extract/t.rast.extract.md create mode 100644 temporal/t.rast.gapfill/t.rast.gapfill.md create mode 100644 temporal/t.rast.import/t.rast.import.md create mode 100644 temporal/t.rast.list/t.rast.list.md create mode 100644 temporal/t.rast.mapcalc/t.rast.mapcalc.md create mode 100644 temporal/t.rast.neighbors/t.rast.neighbors.md create mode 100644 temporal/t.rast.out.vtk/t.rast.out.vtk.md create mode 100644 temporal/t.rast.series/t.rast.series.md create mode 100644 temporal/t.rast.to.rast3/t.rast.to.rast3.md create mode 100644 temporal/t.rast.to.vect/t.rast.to.vect.md create mode 100644 temporal/t.rast.univar/t.rast.univar.md create mode 100644 temporal/t.rast.what/t.rast.what.md create mode 100644 temporal/t.rast3d.algebra/t.rast3d.algebra.md create mode 100644 temporal/t.rast3d.extract/t.rast3d.extract.md create mode 100644 temporal/t.rast3d.list/t.rast3d.list.md create mode 100644 temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.md create mode 100644 temporal/t.rast3d.univar/t.rast3d.univar.md create mode 100644 temporal/t.register/t.register.md create mode 100644 temporal/t.remove/t.remove.md create mode 100644 temporal/t.rename/t.rename.md create mode 100644 temporal/t.sample/t.sample.md create mode 100644 temporal/t.select/t.select.md create mode 100644 temporal/t.shift/t.shift.md create mode 100644 temporal/t.snap/t.snap.md create mode 100644 temporal/t.support/t.support.md create mode 100644 temporal/t.topology/t.topology.md create mode 100644 temporal/t.unregister/t.unregister.md create mode 100644 temporal/t.upgrade/t.upgrade.md create mode 100644 temporal/t.vect.algebra/t.vect.algebra.md create mode 100644 temporal/t.vect.db.select/t.vect.db.select.md create mode 100644 temporal/t.vect.export/t.vect.export.md create mode 100644 temporal/t.vect.extract/t.vect.extract.md create mode 100644 temporal/t.vect.import/t.vect.import.md create mode 100644 temporal/t.vect.list/t.vect.list.md create mode 100644 temporal/t.vect.observe.strds/t.vect.observe.strds.md create mode 100644 temporal/t.vect.univar/t.vect.univar.md create mode 100644 temporal/t.vect.what.strds/t.vect.what.strds.md create mode 100644 temporal/temporalintro.md create mode 100644 vector/v.buffer/v.buffer.md create mode 100644 vector/v.build.polylines/v.build.polylines.md create mode 100644 vector/v.build/v.build.md create mode 100644 vector/v.category/v.category.md create mode 100644 vector/v.class/v.class.md create mode 100644 vector/v.clean/test/description.md create mode 100644 vector/v.clean/v.clean.md create mode 100644 vector/v.cluster/v.cluster.md create mode 100644 vector/v.colors.out/v.colors.out.md create mode 100644 vector/v.colors/v.colors.md create mode 100644 vector/v.db.connect/v.db.connect.md create mode 100644 vector/v.db.select/v.db.select.md create mode 100644 vector/v.decimate/v.decimate.md create mode 100644 vector/v.delaunay/v.delaunay.md create mode 100644 vector/v.distance/v.distance.md create mode 100644 vector/v.drape/v.drape.md create mode 100644 vector/v.edit/v.edit.md create mode 100644 vector/v.external.out/v.external.out.md create mode 100644 vector/v.external/v.external.md create mode 100644 vector/v.extract/v.extract.md create mode 100644 vector/v.extrude/v.extrude.md create mode 100644 vector/v.fill.holes/v.fill.holes.md create mode 100644 vector/v.generalize/v.generalize.md create mode 100644 vector/v.hull/v.hull.md create mode 100644 vector/v.in.ascii/v.in.ascii.md create mode 100644 vector/v.in.db/v.in.db.md create mode 100644 vector/v.in.dwg/v.in.dwg.md create mode 100644 vector/v.in.dxf/v.in.dxf.md create mode 100644 vector/v.in.lidar/v.in.lidar.md create mode 100644 vector/v.in.ogr/v.in.ogr.md create mode 100644 vector/v.in.pdal/v.in.pdal.md create mode 100644 vector/v.in.region/v.in.region.md create mode 100644 vector/v.info/v.info.md create mode 100644 vector/v.kcv/v.kcv.md create mode 100644 vector/v.kernel/v.kernel.md create mode 100644 vector/v.label.sa/v.label.sa.md create mode 100644 vector/v.label/v.label.md create mode 100644 vector/v.lidar.correction/v.lidar.correction.md create mode 100644 vector/v.lidar.edgedetection/v.lidar.edgedetection.md create mode 100644 vector/v.lidar.growing/v.lidar.growing.md create mode 100644 vector/v.lrs/lrs.md create mode 100644 vector/v.lrs/v.lrs.create/v.lrs.create.md create mode 100644 vector/v.lrs/v.lrs.label/v.lrs.label.md create mode 100644 vector/v.lrs/v.lrs.segment/v.lrs.segment.md create mode 100644 vector/v.lrs/v.lrs.where/v.lrs.where.md create mode 100644 vector/v.mkgrid/v.mkgrid.md create mode 100644 vector/v.neighbors/v.neighbors.md create mode 100644 vector/v.net.alloc/v.net.alloc.md create mode 100644 vector/v.net.allpairs/v.net.allpairs.md create mode 100644 vector/v.net.bridge/v.net.bridge.md create mode 100644 vector/v.net.centrality/v.net.centrality.md create mode 100644 vector/v.net.components/v.net.components.md create mode 100644 vector/v.net.connectivity/v.net.connectivity.md create mode 100644 vector/v.net.distance/v.net.distance.md create mode 100644 vector/v.net.flow/v.net.flow.md create mode 100644 vector/v.net.iso/v.net.iso.md create mode 100644 vector/v.net.path/v.net.path.md create mode 100644 vector/v.net.salesman/v.net.salesman.md create mode 100644 vector/v.net.spanningtree/v.net.spanningtree.md create mode 100644 vector/v.net.steiner/v.net.steiner.md create mode 100644 vector/v.net.timetable/v.net.timetable.md create mode 100644 vector/v.net.visibility/v.net.visibility.md create mode 100644 vector/v.net/v.net.md create mode 100644 vector/v.normal/v.normal.md create mode 100644 vector/v.out.ascii/v.out.ascii.md create mode 100644 vector/v.out.dxf/v.out.dxf.md create mode 100644 vector/v.out.lidar/v.out.lidar.md create mode 100644 vector/v.out.ogr/v.out.ogr.md create mode 100644 vector/v.out.postgis/v.out.postgis.md create mode 100644 vector/v.out.pov/v.out.pov.md create mode 100644 vector/v.out.svg/v.out.svg.md create mode 100644 vector/v.out.vtk/v.out.vtk.md create mode 100644 vector/v.outlier/v.outlier.md create mode 100644 vector/v.overlay/v.overlay.md create mode 100644 vector/v.parallel/v.parallel.md create mode 100644 vector/v.patch/v.patch.md create mode 100644 vector/v.perturb/v.perturb.md create mode 100644 vector/v.profile/v.profile.md create mode 100644 vector/v.proj/v.proj.md create mode 100644 vector/v.qcount/v.qcount.md create mode 100644 vector/v.random/v.random.md create mode 100644 vector/v.reclass/v.reclass.md create mode 100644 vector/v.rectify/v.rectify.md create mode 100644 vector/v.sample/v.sample.md create mode 100644 vector/v.segment/v.segment.md create mode 100644 vector/v.select/v.select.md create mode 100644 vector/v.split/v.split.md create mode 100644 vector/v.support/v.support.md create mode 100644 vector/v.surf.bspline/v.surf.bspline.md create mode 100644 vector/v.surf.idw/v.surf.idw.md create mode 100644 vector/v.surf.rst/v.surf.rst.md create mode 100644 vector/v.timestamp/v.timestamp.md create mode 100644 vector/v.to.3d/v.to.3d.md create mode 100644 vector/v.to.db/v.to.db.md create mode 100644 vector/v.to.points/v.to.points.md create mode 100644 vector/v.to.rast/v.to.rast.md create mode 100644 vector/v.to.rast3/v.to.rast3.md create mode 100644 vector/v.transform/v.transform.md create mode 100644 vector/v.type/v.type.md create mode 100644 vector/v.univar/v.univar.md create mode 100644 vector/v.vect.stats/v.vect.stats.md create mode 100644 vector/v.vol.rst/v.vol.rst.md create mode 100644 vector/v.voronoi/v.voronoi.md create mode 100644 vector/v.what.rast/v.what.rast.md create mode 100644 vector/v.what.rast3/v.what.rast3.md create mode 100644 vector/v.what/v.what.md create mode 100644 vector/vectorintro.md create mode 100644 visualization/ximgview/ximgview.md diff --git a/db/databaseintro.md b/db/databaseintro.md new file mode 100644 index 00000000000..f25b331309c --- /dev/null +++ b/db/databaseintro.md @@ -0,0 +1,106 @@ +### Attribute management in general + +GRASS can be linked to one or many database management systems (DBMS). +The *db.\** set of commands provides basic SQL support for attribute +management, while the *v.db.\** set of commands operates on the vector +map (see [Vector introduction](vectorintro.html)). + +### Available drivers + +Available drivers are listed in [SQL support in GRASS GIS](sql.html). + +**Notes**:\ +The DBF driver provides only very limited SQL support (as DBF is not an +SQL DB) while the other DBMS backends (such as SQLite, PostgreSQL, MySQL +etc) provide full SQL support since the SQL commands are sent directly +to the DBMS. For this reason, the SQLite driver is the default DBMI +backend. + +### DB connection management + +The current database management settings are shown or modified with +[db.connect](db.connect.html) for current mapset. Available DBMI drivers +are listed with [db.drivers](db.drivers.html). Some DBMI backends +require a user/password for driver/database to be set with +[db.login](db.login.html). In order to test a driver, run +[db.test](db.test.html). + +### Attribute data import and export + +Attribute data can be imported with [db.in.ogr](db.in.ogr.html) from +various formats and exported with [db.out.ogr](db.out.ogr.html). To +internally copy a a full table or selectively parts of it, use +[db.copy](db.copy.html). + +Further conversion tools: + +- [MDB Tools](http://sourceforge.net/projects/mdbtools): Convert + MS-Access data to SQL, DBF, etc. +- [Using OpenOffice.org with SQL + Databases](https://grasswiki.osgeo.org/wiki/Openoffice.org_with_SQL_Databases) + +### SQL commands + +GRASS supports two main SQL operations, execution of an SQL statement +([db.execute](db.execute.html)) and selection of data from a table +([db.select](db.select.html)). See the [SQL help page](sql.html) for +examples. + +### Managing the default DBMI settings + +Per default vector map attributes are stored in SQLite tables. This +default definition can be modified with [db.connect](db.connect.html). +If an external DBMS is used, [db.login](db.login.html) may be required. + +### Creating a database + +Specific commands are explained on the individual driver pages (these +pages are only available if driver was compiled in this installation): + +- DBF: see [DBF](grass-dbf.html) page +- SQLite: [SQLite](grass-sqlite.html) page +- mySQL: [mySQL](grass-mysql.html) and [meSQL](grass-mesql.html) pages +- ODBC: [ODBC](grass-odbc.html) page (connect to Oracle, etc.) +- PostgreSQL: [PostgreSQL](grass-pg.html) and PostGIS page + +### Metadata + +All columns for a given table are listed with +[db.columns](db.columns.html). The command +[db.describe](db.describe.html) describes a table in detail. To list all +available tables for a given database, run [db.tables](db.tables.html). + +### Table maintenance + +To drop a column from a selected attribute table, use +[db.dropcolumn](db.dropcolumn.html). With +[db.droptable](db.droptable.html) an attribute table can be deleted. + +### Database Schema + +Currently schema support only works for PostgreSQL connections. Default +schema can be set with [db.connect](db.connect.html). Note that the +default schema will be used by all db.\* modules. + +[db.tables](db.tables.html) returns \'schema.table\' if schemas are +available in the database. + +### Migrating to a different database engine + +To migrate a GRASS database table (or a GRASS vector map) to a different +DBMI engine, the best solution is to create a new MAPSET, define the +DBMI settings accordingly with [db.connect](db.connect.html) and if +needed, [db.login](db.login.html). Then the table of interest can be +copied over with [db.copy](db.copy.html) from the original MAPSET. +Likewise, a vector map including its table(s) are copied from the +original MAPSET to the current MAPSET with [g.copy](g.copy.html). + +### See also + +- [Introduction into raster data processing](rasterintro.html) +- [Introduction into 3D raster data (voxel) + processing](raster3dintro.html) +- [Introduction into vector data processing](vectorintro.html) +- [Introduction into image processing](imageryintro.html) +- [Introduction into temporal data processing](temporalintro.html) +- [Projections and spatial transformations](projectionintro.html) diff --git a/db/db.columns/db.columns.md b/db/db.columns/db.columns.md new file mode 100644 index 00000000000..39007daf187 --- /dev/null +++ b/db/db.columns/db.columns.md @@ -0,0 +1,52 @@ +## DESCRIPTION + +*db.columns* lists all columns for a give table. Connection to databases +are supported through dbf, shp, odbc and pg drivers. + +## NOTE + +If parameters for database connection are already set with +[db.connect](db.connect.html), they are taken as default values and do +not need to be spcified each time. + +## EXAMPLES + +### List columns of a PostgreSQL attribute table + +::: code + db.columns table=zipcodes_wake driver=pg database=grassdb +::: + +*If the database parameters are already set, the columns can be listed +directly*\ + +::: code + db.columns table=zipcodes_wake +::: + +### List columns from Shape file with DBF attribute table + +::: code + db.columns table=zipcodes_wake driver=dbf database=/grassdata/nc_spm_08/PERMANENT/dbf/ +::: + +### List columns of table in SQLite database + +Note that the SQLite backend is the default setting. + +::: code + db.columns driver=sqlite table=archsites database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' +::: + +## SEE ALSO + +*[db.connect](db.connect.html), [db.describe](db.describe.html), +[db.drivers](db.drivers.html), [db.droptable](db.droptable.html), +[db.execute](db.execute.html), [db.login](db.login.html), +[db.tables](db.tables.html), [GRASS SQL interface](sql.html)* + +[GRASS SQL interface](sql.html) + +## AUTHOR + +Radim Blazek, ITC-Irst, Trento, Italy diff --git a/db/db.connect/db.connect.md b/db/db.connect/db.connect.md new file mode 100644 index 00000000000..cfef8971b28 --- /dev/null +++ b/db/db.connect/db.connect.md @@ -0,0 +1,136 @@ +## DESCRIPTION + +*db.connect* allows the user to set database connection parameters. +These parameters are then taken as default values by modules so that the +user does not need to enter the parameters each time. + +The default database backend in GRASS GIS is [SQLite](grass-sqlite.html) +(since version 7). + +## NOTES + +Values are stored in the mapset\'s `VAR` file; the connection is not +tested for validity. + +The **-p** flag will display the current connection parameters. + +The **-c** flag will silently check if the connection parameters have +been set, and if not will set them to use GRASS\'s default values. +(useful in scripts before you attempt to create a new database table) + +To connect a vector map to a database table, use +*[v.db.connect](v.db.connect.html)* or +*[v.db.addtable](v.db.addtable.html)*. + +## EXAMPLES + +### SQLite (default backend) + +Local storage:\ + +::: code + db.connect -d + db.connect -p + db.tables -p +::: + +The SQLite database file is created automatically when used the first +time. + +See [SQLite](grass-sqlite.html) database driver for details. + +### PostgreSQL (local connection) + +Local storage, database tables stored in database \"mydb\" (may require +the use of *[db.login](db.login.html)*):\ + +::: code + db.connect driver=pg database=mydb + db.login user=myname pass=secret + db.connect -p + db.tables -p +::: + +See [PostgreSQL](grass-pg.html) database driver for details. + +### PostgreSQL (network connection) + +Network storage, database tables stored in database \"mydb\" (may +require the use of *[db.login](db.login.html)*):\ + +::: code + db.connect driver=pg database=mydb + db.login user=myname pass=secret host=myserver.com port=6666 + db.connect -p + db.tables -p +::: + +See [PostgreSQL](grass-pg.html) database driver for details. + +### MySQL (local connection) + +Local storage, database tables stored in database \"mydb\" (may require +the use of *[db.login](db.login.html)*):\ + +::: code + db.connect driver=mysql database=mydb + db.login user=myname pass=secret + db.connect -p + db.tables -p +::: + +See [MySQL](grass-mysql.html) database driver for details. + +### MySQL (network connection) + +Network storage, database tables stored in database \"mydb\" (may +require the use of *[db.login](db.login.html)*):\ + +::: code + db.connect driver=mysql database=mydb + db.login user=myname pass=secret host=myserver.com + db.connect -p + db.tables -p +::: + +See [MySQL](grass-mysql.html) database driver for details. + +### ODBC + +Network storage, database tables stored in database \"mydb\" (may +require the use of *[db.login](db.login.html)*):\ + +::: code + db.connect driver=odbc database=mydb + db.login user=myname pass=secret + db.connect -p + db.tables -p +::: + +See [ODBC](grass-odbc.html) database driver for details. + +### DBF (local, not recommended) + +Local storage (the dbf/ subdirectory in the mapset must exist or must be +created by the user):\ + +::: code + db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' + db.tables -p +::: + +See [DBF](grass-dbf.html) database driver for details. + +## SEE ALSO + +*[db.columns](db.columns.html), [db.copy](db.copy.html), +[db.drivers](db.drivers.html), [db.login](db.login.html), +[db.tables](db.tables.html), [v.db.addtable](v.db.addtable.html), +[v.db.connect](v.db.connect.html)* + +[GRASS SQL interface](sql.html) + +## AUTHORS + +Main author: Radim Blazek, ITC-Irst, Trento, Italy\ +GRASS 7 improvements: Martin Landa, Markus Metz diff --git a/db/db.copy/db.copy.md b/db/db.copy/db.copy.md new file mode 100644 index 00000000000..5ced4a8e25b --- /dev/null +++ b/db/db.copy/db.copy.md @@ -0,0 +1,72 @@ +## DESCRIPTION + +*db.copy* allows the user to copy a table between two databases. +Databases can be connected through different drivers (see examples +below). + +## NOTES + +Attribute tables can be copied using *db.copy* and, when to be +associated to a vector map, assigned to the map with +*[v.db.connect](v.db.connect.html)*. Current connection settings are +saved in the file *\$LOCATION/vector_map/dbln*. + +## EXAMPLES + +### From DBF to PostgreSQL + +*Storing table \'geonames.dbf\' (in current directory) into PostgreSQL +through ODBC:*\ + +::: code + db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \ + from_table=geonames to_driver=pg to_database="host=pgserver,dbname=testdb" \ + to_table=geonames +::: + +### From PostgreSQL to DBF + +::: code + db.copy from_driver=pg from_database="host=pgserver.example.org,dbname=testdb" \ + from_table=origtable to_driver=dbf \ + to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf' to_table=origtable +::: + +### From PostgreSQL to PostgreSQL with condition + +::: code + db.copy from_driver=pg from_database="host=localhost,dbname=testdb" \ + from_table=geonames to_driver=pg to_database="host=localhost,dbname=testdb" \ + to_table=selection where="cat < 500" +::: + +### From DBF to SQLite + +::: code + db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \ + from_table=geonames_features to_driver=sqlite \ + to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' to_table=geonames_features + + # convenient viewer: + sqlitebrowser $HOME/grassdata/nc_spm_08/user1/sqlite/sqlite.db +::: + +### From SQLite to DBF + +::: code + db.copy from_driver=sqlite from_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' \ + from_table=ammprv to_driver=dbf to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' \ + to_table=ammprv +::: + +## SEE ALSO + +*[db.connect](db.connect.html), [db.drivers](db.drivers.html), +[db.login](db.login.html), [v.db.connect](v.db.connect.html), +[v.clean](v.clean.html)* + +[GRASS SQL interface](sql.html) + +## AUTHOR + +Radim Blazek, ITC-irst, Trento, Italy diff --git a/db/db.createdb/db.createdb.md b/db/db.createdb/db.createdb.md new file mode 100644 index 00000000000..38db4b6d6e9 --- /dev/null +++ b/db/db.createdb/db.createdb.md @@ -0,0 +1,56 @@ +## DESCRIPTION + +*db.createdb* allows the user to create a new empty database through +different drivers. A working database connection needs to be +established, see *[db.login](db.login.html)*. + +Currently only [SQLite](grass-sqlite.html) and +[PostgreSQL](grass-pg.html) database drivers are supported. + +## EXAMPLES + +### Create a new SQLite file-based database + +Note that the standard GRASS GIS SQLite database is by default generated +in the user\'s current mapset. This example shows an out-of-mapset +database file creation: + +::: code + db.createdb driver=sqlite database=/opt/sqlite.db +::: + +### Create a new PostgreSQL database + +Create a new PostgreSQL database (after the PostgreSQL connection got +established through the *pg* driver): + +::: code + db.createdb driver=pg database=grassdb +::: + +Create a new PostgreSQL database (after the PostgreSQL connection got +established through the *odbc* driver): + +::: code + db.createdb driver=odbc database=grassdb +::: + +## TODO + +Support other database drivers, too. + +## SEE ALSO + +*[db.columns](db.columns.html), [db.connect](db.connect.html), +[db.describe](db.describe.html), [db.drivers](db.drivers.html), +[db.dropdb](db.dropdb.html), [db.droptable](db.droptable.html), +[db.execute](db.execute.html), [db.login](db.login.html), +[db.tables](db.tables.html)* + +[GRASS SQL interface](sql.html) + +## AUTHORS + +Radim Blazek, ITC-Irst, Trento, Italy\ +SQLite and PostgreSQL support by Martin Landa, Czech Technical +University in Prague, Czech Republic diff --git a/db/db.databases/db.databases.md b/db/db.databases/db.databases.md new file mode 100644 index 00000000000..597b42e6d57 --- /dev/null +++ b/db/db.databases/db.databases.md @@ -0,0 +1,46 @@ +## DESCRIPTION + +*db.databases* lists all databases for a given **driver** and optionally +**location**. + +## NOTES + +Currently supported database drivers are *[SQLite](grass-sqlite.html)*, +*[PostgreSQL](grass-pg.html)*, and *[ODBC](grass-odbc.html)*. + +Default **location** for SQLite driver is the full path for the current +mapset. For PostgreSQL driver it\'s empty connection string. + +## EXAMPLES + +List SQLite databases in the current mapset: + +::: code + db.databases driver=sqlite +::: + +List SQLite databases in a given directory: + +::: code + db.databases driver=sqlite location=/opt/sqlite +::: + +List PostgreSQL databases from database server running on given port: + +::: code + db.databases driver=pg location="host=server_name port=5333" +::: + +## SEE ALSO + +*[db.columns](db.columns.html), [db.describe](db.describe.html), +[db.drivers](db.drivers.html), [db.execute](db.execute.html), +[db.login](db.login.html), [db.tables](db.tables.html)* + +[GRASS SQL interface](sql.html) + +## AUTHORS + +Radim Blazek, ITC-Irst, Trento, Italy\ +Updated for GRASS 7 by Martin Landa, Czech Technical University in +Prague, Czech Republic diff --git a/db/db.describe/db.describe.md b/db/db.describe/db.describe.md new file mode 100644 index 00000000000..04b300a64a3 --- /dev/null +++ b/db/db.describe/db.describe.md @@ -0,0 +1,73 @@ +## DESCRIPTION + +*db.describe* displays table information. If parameter **-c** is used +only column names instead of full column descriptions is given. + +## NOTE + +If parameters for database connection are already set with +[db.connect](db.connect.html), they are taken as default values and do +not need to be spcified each time. + +## EXAMPLES + +*List column descriptions of table in SQLite database (note that this is +the default setting)*\ + +::: code + db.describe driver=sqlite table=hospitals \ + database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' + + # or simply + db.describe myarchsites +::: + +### DBF example + +::: code + db.describe -c table=hospitals database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf/' \ + driver=dbf + ncols: 16 + nrows: 160 + Column 1: cat:INTEGER:11 + Column 2: OBJECTID:INTEGER:11 + Column 3: AREA:DOUBLE PRECISION:20 + [...] +::: + +::: code + db.describe table=hospitals database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf/' \ + driver=dbf + table:hospitals + description: + insert:yes + delete:yes + ncols:16 + nrows:160 + + column:cat + description: + type:INTEGER + len:11 + scale:0 + precision:10 + default: + nullok:yes + select:yes + update:yes + + column:OBJECTID + description: + type:INTEGER + [...] +::: + +## SEE ALSO + +*[db.columns](db.columns.html), [db.droptable](db.droptable.html), +[db.execute](db.execute.html), [db.login](db.login.html), +[db.tables](db.tables.html), [GRASS SQL interface](sql.html)* + +## AUTHOR + +Radim Blazek, ITC-Irst, Trento, Italy diff --git a/db/db.drivers/db.drivers.md b/db/db.drivers/db.drivers.md new file mode 100644 index 00000000000..f7bee4b12fc --- /dev/null +++ b/db/db.drivers/db.drivers.md @@ -0,0 +1,26 @@ +## DESCRIPTION + +*db.drivers* lists all database drivers (DBMI backends). + +## EXAMPLE + +Show all installed GRASS database drivers: + +::: code + db.drivers -p + pg + ogr + sqlite + dbf +::: + +## SEE ALSO + +*[db.connect](db.connect.html), [db.describe](db.describe.html), +[db.droptable](db.droptable.html), [db.execute](db.execute.html), +[db.login](db.login.html), [db.tables](db.tables.html), [GRASS SQL +interface](sql.html)* + +## AUTHOR + +Radim Blazek, ITC-Irst, Trento, Italy diff --git a/db/db.dropdb/db.dropdb.md b/db/db.dropdb/db.dropdb.md new file mode 100644 index 00000000000..541b0ad91c1 --- /dev/null +++ b/db/db.dropdb/db.dropdb.md @@ -0,0 +1,41 @@ +## DESCRIPTION + +*db.dropdb* removes an existing database using given database +**driver**. Currently only [SQLite](grass-sqlite.html) and +[PostgreSQL](grass-pg.html) database drivers are supported. + +## EXAMPLES + +### Drop (delete) an existing database connected through SQLite driver + +Note that the standard GRASS GIS SQLite database is by default found in +the user\'s current mapset. This example shows an out-of-mapset database +removal: + +::: code + db.dropdb driver=sqlite database=/opt/sqlite.db +::: + +### Drop an existing database connected through PostgreSQL driver + +::: code + db.dropdb driver=pg database=grassdb +::: + +## TODO + +Support other database drivers, too. + +## SEE ALSO + +*[db.createdb](db.createdb.html), [db.describe](db.describe.html), +[db.droptable](db.droptable.html), [db.execute](db.execute.html), +[db.login](db.login.html), [db.tables](db.tables.html)* + +[GRASS SQL interface](sql.html) + +## AUTHORS + +Radim Blazek, ITC-Irst, Trento, Italy\ +SQLite and PostgreSQL support by Martin Landa, Czech Technical +University in Prague, Czech Republic diff --git a/db/db.execute/db.execute.md b/db/db.execute/db.execute.md new file mode 100644 index 00000000000..d8387b46169 --- /dev/null +++ b/db/db.execute/db.execute.md @@ -0,0 +1,116 @@ +## DESCRIPTION + +*db.execute* allows the user to execute SQL statements. + +## NOTES + +*db.execute* only executes SQL statements and does not return any data. +If you need data returned from the database, use +*[db.select](db.select.html)*. + +If parameters for database connection are already set with +*[db.connect](db.connect.html)*, they are taken as default values and do +not need to be specified each time. + +If you have a large number of SQL commands to process, it is much faster +to place all the SQL statements into a text file and use **input** file +parameter than it is to process each statement individually in a loop. +If multiple instruction lines are given, each SQL line must end with a +semicolon. + +Please see the individual *[GRASS SQL interface](sql.html)* for how to +create a new database. + +## EXAMPLES + +Create a new table with columns \'cat\' and \'soiltype\': + +::: code + db.execute sql="CREATE TABLE soils (cat integer, soiltype varchar(10))" +::: + +Create a new table using a file with SQL statements + +::: code + db.execute driver=odbc database=grassdb input=file.sql +::: + +Insert new row into attribute table: + +::: code + db.execute sql="INSERT INTO mysites (id,name,east,north) values (30,'Ala',1657340,5072301)" +::: + +Update attribute entries to new value based on SQL rule: + +::: code + db.execute sql="UPDATE roads SET travelcost=5 WHERE cat=1" +::: + +Update attribute entries to new value based on SQL rule: + +::: code + db.execute sql="UPDATE dourokukan SET testc=50 WHERE testc is NULL" +::: + +Delete selected rows from attribute table: + +::: code + db.execute sql="DELETE FROM gsod_stationlist WHERE latitude < -91" +::: + +Add new column to attribute table: + +::: code + db.execute sql="ALTER TABLE roads ADD COLUMN length double" +::: + +Column type conversion - update new column from existing column (all +drivers except for DBF): + +::: code + # 'z_value' is varchar and 'z' is double precision: + echo "UPDATE geodetic_pts SET z = CAST(z_value AS numeric)" | db.execute input=- +::: + +Drop column from attribute table: + +::: code + db.execute sql="ALTER TABLE roads DROP COLUMN length" +::: + +Drop table (not supported by all drivers): + +::: code + db.execute sql="DROP TABLE fmacopy" +::: + +Update attribute with multiple SQL instructions in file (e.g., +`file.sql`, instruction line must end with a semicolon): + +::: code + UPDATE roads SET travelcost=5 WHERE cat=1; + UPDATE roads SET travelcost=2 WHERE cat=2; + + db.execute input=file.sql +::: + +Join table \'myroads\' to table \'extratab\' based on common \'cat\' +column values (not supported by DBF driver): + +::: code + db.execute sql="UPDATE extratab SET names=(SELECT label FROM myroads WHERE extratab.cat=myroads.cat)" +::: + +## SEE ALSO + +*[db.columns](db.columns.html), [db.describe](db.describe.html), +[db.drivers](db.drivers.html), [db.droptable](db.droptable.html), +[db.login](db.login.html), [db.select](db.select.html), +[db.tables](db.tables.html),* + +*[GRASS SQL interface](sql.html) * + +## AUTHOR + +CERL diff --git a/db/db.login/db.login.md b/db/db.login/db.login.md new file mode 100644 index 00000000000..abec0baca81 --- /dev/null +++ b/db/db.login/db.login.md @@ -0,0 +1,55 @@ +## DESCRIPTION + +*db.login* sets login parameters such an user name and optionally also a +password, a hostname or a port for the connection to the selected +**database** through the DB **driver**. + +## NOTE + +Options **host** and **port** are related to only SQL database backends +like [PostgreSQL](grass-pg.html), [MySQL](grass-mysql.html) or +[ODBC](grass-odbc.html). + +Note that the passwords are stored in a hidden, *unencrypted* file in +the user account, specifically + +- in the \'home\' directory, i.e. `$HOME/.grass8/dblogin` (Unix-like + systems) +- `%APPDATA%\Roaming\GRASS8\dblogin` (MS-Windows) + +Only the file owner can access this file. + +## EXAMPLES + +Only username specified (assuming locally accessible PostgreSQL DB +without password): + +::: code + db.login driver=pg database=mydb +::: + +Username, password and hostname specified (note that the command lines +history will store the password in this way): + +::: code + db.login driver=pg database=mydb user=bacava password=secret host=db.example.com +::: + +Username and empty password specified: + +::: code + db.login driver=pg database=mydb user=bacava password="" +::: + +## SEE ALSO + +*[db.connect](db.connect.html), [db.test](db.test.html), +[db.tables](db.tables.html)* + +[SQL support in GRASS GIS](sql.html) + +## AUTHOR + +Radim Blazek\ +Support for hostname and port by Martin Landa, OSGeoREL, Czech Technical +University in Prague, Czech Republic (GRASS 7.1) diff --git a/db/db.select/db.select.md b/db/db.select/db.select.md new file mode 100644 index 00000000000..46dadd84d66 --- /dev/null +++ b/db/db.select/db.select.md @@ -0,0 +1,101 @@ +## DESCRIPTION + +*db.select* prints result of selection from database based on SQL +statement read from input file or from standard input to standard +output. Each individual query has to be written on one single line and +different queries have to be written on separate lines. + +## NOTE + +If parameters for database connection are already set with +*[db.connect](db.connect.html)*, they are taken as default values and do +not need to be specified each time. Output will be displayed to standard +output or can be directed to a file (option **output**). + +## EXAMPLES + +### Basic usage + +::: code + db.select sql="select * from roads" +::: + +or + +::: code + echo "select * from roads" | db.select input=- +::: + +or + +::: code + db.select input=file.sql +::: + +or + +::: code + cat file.sql | db.select input=- +::: + +Select all from table roads: + +::: code + db.select -c driver=odbc database=mydb table=hospitals \ + input=file.sql output=result.csv +::: + +Select some string attribute, exclude others: + +::: code + db.select sql="SELECT * FROM archsites WHERE str1 <> 'No Name'" +::: + +Select some string attribute with ZERO length: + +::: code + db.select sql="SELECT * FROM archsites WHERE str1 IS NULL" +::: + +Select coordinates from PostGIS table: + +::: code + db.select sql="SELECT x(geo),y(geo) FROM localizzazione" +::: + +### Execute multiple SQL statements + +::: code + cat file.sql + SELECT * FROM busstopsall WHERE cat = 1 + SELECT cat FROM busstopsall WHERE cat > 4 AND cat < 8 + + db.select input=file.sql +::: + +### Count number of cases falling into same position + +When multiple observation have the spatial coordinates, they can still +be counted (if needed, coordinates can be uploaded to the attribute +table by *v.to.db*: + +::: code + db.select sql="SELECT long,lat,site_id,department,obs,COUNT(long) as count_cases \ + FROM diseases GROUP BY long,lat" +::: + +## SEE ALSO + +*[db.connect](db.connect.html), [db.describe](db.describe.html), +[db.drivers](db.drivers.html), [db.droptable](db.droptable.html), +[db.execute](db.execute.html), [db.login](db.login.html), +[db.tables](db.tables.html)* + +*[GRASS SQL interface](sql.html)* + +## AUTHORS + +Original author unknown (probably CERL)\ +Modifications by Radim Blazek, ITC-Irst, Trento, Italy\ +Support for multiple statements by Martin Landa, Czech Technical +University in Prague diff --git a/db/db.tables/db.tables.md b/db/db.tables/db.tables.md new file mode 100644 index 00000000000..845967d61fc --- /dev/null +++ b/db/db.tables/db.tables.md @@ -0,0 +1,39 @@ +## DESCRIPTION + +*db.tables* lists all tables for a given database. + +## NOTE + +If parameters for database connection are already set with +[db.connect](db.connect.html), they are taken as default values and do +not need to be spcified each time. + +## EXAMPLES + +### List all tables if database connection is already set + +::: code + db.tables -p +::: + +### List all DBF tables + +::: code + db.tables driver=dbf database=/grassdata/nc_spm_08/user1/PERMANENT/dbf +::: + +### List all tables in SQLite database (note that this is the default setting) + +::: code + db.tables -p driver=sqlite database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' +::: + +## SEE ALSO + +*[db.columns](db.columns.html), [db.droptable](db.droptable.html), +[db.login](db.login.html), [db.execute](db.execute.html), [GRASS SQL +interface](sql.html)* + +## AUTHOR + +Unknown diff --git a/db/drivers/dbf/grass-dbf.md b/db/drivers/dbf/grass-dbf.md new file mode 100644 index 00000000000..38524b837f2 --- /dev/null +++ b/db/drivers/dbf/grass-dbf.md @@ -0,0 +1,116 @@ +The DBF driver is a file based attribute table driver. + +## Defining the DBF driver + +The DBF driver is a file based driver, in theory no user interaction is +required. However, if the settings should be set back from a different +driver to the DBF driver, the following step is required: + +::: code + # keep single quotes: + db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' + db.connect -p +::: + +The dbf/ subdirectory in the mapset must exist or must be created by the +user. + +## Creating a DBF table + +DBF tables are created by GRASS when generating a vector map with +attributes and having defined the DBF as attribute driver. + +If a DBF table has to be created manually, [db.execute](db.execute.html) +can be used or a spreadsheet application. Also [db.copy](db.copy.html) +is sometimes useful as well as [db.in.ogr](db.in.ogr.html) to import +external tables. + +## Supported SQL commands by DBF driver + +::: code + ALTER TABLE table ADD [COLUMN] columndef + ALTER TABLE table DROP COLUMN colname + CREATE TABLE table ( columndefs ) + DROP TABLE table + SELECT columns FROM table + SELECT columns FROM table WHERE condition + SELECT columns FROM table ORDER BY column + DELETE FROM table + DELETE FROM table WHERE condition + INSERT INTO table VALUES (value1[,value2,...]) + INSERT INTO table ( column1[,column2,...] ) VALUES (value1[,value2,...]) + UPDATE table SET assignment1[,assignment2,...] + UPDATE table SET assignment1[,assignment2,...] WHERE condition +::: + +## Operators available in conditions + +::: code + "=" : equal + "<" : smaller than + "<=" : smaller/equal than + ">" : larger than + ">=" : larger/equal than + "<>" : not equal + "~" : Substring matching (non-standard SQL) + "%" : Substring matching (limited functionality) +::: + +Arithmetic expressions using constants and field values are allowed in +condition clauses and in the RHS of assignments.\ +Usual precedence rules and bracketing (using \'(\' and \')\') are +supported.\ +Type conversion is performed if necessary (experimental). + +Conditions allow boolean expressions using the AND, OR and NOT +operators, with the usual precedence rules. + +NULLs can be tested by \'colname IS NULL\' in conditions. The negation +is \'colname NOT NULL\'. + +Sorting: Empty fields in a character column are sorted to the end. + +## LIMITATIONS OF THE DBF DRIVER + +The DBF driver supports only a **few SQL statements** since the DBF +tables are intended for simple table storage. DBF column names are +limited to 10 characters (as defined in the DBF specifications). For +example, + +- aggregate functions (sum, count, min, max,\...) are **not** + supported in SELECT clauses; +- mathematic functions (sin, cos, exp, log,\...) are **not** supported + in expressions; +- SQL query with IN are **not** supported. + +## ERROR MESSAGES + +An error message such as: + +::: code + DBMI-DBF driver error: + SQL parser error: syntax error, unexpected NAME processing 'IN'.. +::: + +indicates that an unsupported SQL statement (here, \'IN\') was used. The +only solution is to switch the DBMI backend to a real SQL engine +(SQLite, PostgreSQL, MySQL etc.). See [SQL support in GRASS +GIS](sql.html). + +An error message such as: + +::: code + DBMI-DBF driver error: + SQL parser error: syntax error, unexpected DESC, expecting NAME processing 'DESC' +::: + +indicates that a column name corresponds to a reserved SQL word (here: +\'DESC\'). A different column name should be used. If this happens +during import with *v.in.ogr*, the *cnames* parameter can be used to +assign different column names on the fly. + +## SEE ALSO + +*[db.connect](db.connect.html), [SQL support in GRASS GIS](sql.html)\ +[DBF Specifications](http://shapelib.maptools.org/dbf_api.html) +(Shapelib)* diff --git a/db/drivers/mysql/grass-mesql.md b/db/drivers/mysql/grass-mesql.md new file mode 100644 index 00000000000..786fa3895f7 --- /dev/null +++ b/db/drivers/mysql/grass-mesql.md @@ -0,0 +1,80 @@ +![GRASS logo](grass_logo.png) + +------------------------------------------------------------------------ + +# MySQL embedded driver in GRASS + +## KEYWORDS + +database, attribute table, driver + +## DESCRIPTION + +MySQL database driver in GRASS enables GRASS to store vector attributes +in MySQL embedded database without necessity to run MySQL server. + +## Driver and database name + +GRASS modules require 2 parameters to connect to a database. Those +parameters are \'driver\' and \'database\'. For MySQL embedded driver +the parameter \'driver\' should be set to value \'mesql\'. The parameter +\'database\' is a full path to the directory where database tables are +stored. The best place is a directory in the mapset. The directory must +be created before use of the driver. In the name of database it is +possible to use 3 variables: + +- \$GISDBASE - path to current GISBASE +- \$LOCATION_NAME - name of current location +- \$MAPSET - name of current mapset + +Examples of connection parameters: + +::: code + db.connect driver=mesql database='$GISDBASE/$LOCATION_NAME/$MAPSET/mysql' + db.connect driver=mesql database=/home/user1/db +::: + +## Data types, indexes + +For more information about supported data types and indexes see the +documentation for [MySQL (mysql) driver](grass-mysql.html). + +## Database type + +Because database closing was found very slow if InnoDB was used, the +InnoDB storage is disabled by default (hardcoded \'\--skip-innodb\' +server option). + +## Note + +The embedded server is started with hardcoded \'\--bootstrap\' option to +avoid warning about missing \"mysql.time_zone_leap_second table\". This +can be fixed in future. + +## Troubleshooting: SQL syntax error + +Attempting to use a reserved SQL word as column or table name will +result in a \"SQL syntax\" error. The list of reserved words for MySQL +can be found in the [MySQL +manual](http://dev.mysql.com/doc/refman/5.7/en/reserved-words.html#table-reserved-words-5.7.4). + +## SEE ALSO + +*[db.connect](db.connect.html), [SQL support in GRASS GIS](sql.html)* + +## AUTHOR + +Radim Blazek + +Credits: Development of the driver was sponsored by +[Faunalia](http://www.faunalia.it) (Italy) as part of a project for +[ATAC](http://www.atac.roma.it/). + +------------------------------------------------------------------------ + +[Main index](index.html) - [Database index](database.html) - [Topics +index](topics.html) - [Keywords Index](keywords.html) - [Full +index](full_index.html) + +© 2003-2022 [GRASS Development Team](https://grass.osgeo.org), GRASS GIS +8 Reference Manual diff --git a/db/drivers/mysql/grass-mysql.md b/db/drivers/mysql/grass-mysql.md new file mode 100644 index 00000000000..c0666cf7b99 --- /dev/null +++ b/db/drivers/mysql/grass-mysql.md @@ -0,0 +1,106 @@ +MySQL database driver enables GRASS to store vector attributes in MySQL +server. + +Because vector attribute tables are created automatically when a new +vector is written and the name of the table is the same as the name of +the vector it is good practice to create a new database for each GRASS +mapset. + +## Creating a MySQL database + +A new database is created within MySQL: + +::: code + mysql> CREATE DATABASE mydb; +::: + +See the MySQL manual for details. + +## Driver and database name + +GRASS modules require 2 parameters to connect to a database. Those +parameters are \'driver\' and \'database\'. For MySQL driver the +parameter \'driver\' should be set to value \'mysql\'. The parameter +\'database\' can be given in two formats: + +- Database name - in case of connection from localhost +- String of comma separated list of kye=value options. Supported + options are: + - dbname - database name + - host - host name or IP address + - port - server port number + +Examples of connection parameters: + + db.connect driver=mysql database=mytest + db.connect driver=mysql database='dbname=mytest,host=test.grass.org' + +## Data types + +GRASS supports almost all MySQL data types with following limitations: + +- Binary columns (BINARY, VARBINARY, TINYBLOB, MEDIUMBLOB, BLOB, + LONGBLOB) are not not supported. If a table with binary column(s) is + used in GRASS a warning is printed and only the supported columns + are returned in query results. +- Columns of type SET and ENUM are represented as string (VARCHAR). +- Very large integers in columns of type BIGINT can be lost or + corrupted because GRASS does not support 64 bin integeres on most + platforms. +- GRASS does not currently distinguish types TIMESTAMP and DATETIME. + Both types are in GRASS interpreted as TIMESTAMP. + +## Indexes + +GRASS modules automatically create index on key column of vector +attributes table. The index on key column is important for performance +of modules which update the attribute table, for example v.to.db, +v.distance and v.what.rast. + +## Privileges + +Because MySQL does not support groups of users and because only MySQL +\'root\' can grant privileges to other users GRASS cannot automatically +grant select privileges on created tables to group of users. + +If you want to give privilege to read data from your mapset to other +users you have to ask your MySQL server administrator to grant select +privilege to them on the MySQL database used for that mapset. For +example, to allow everybody to read data in from your database +\'mydb\':\ + + shell> mysql --user=root mysql + mysql> GRANT SELECT ON mydb.* TO ''@'%'; + +## Schemas + +Because MySQL does not support database schemas the parameter \'schema\' +of module db.connect should never be set to any value. If you set that +parameter for MySQL driver GRASS will try to write tables to the +specified schema which will result in errors. + +## Groups + +MySQL does not support user groups. Any settings specified by \'group\' +parameter of module db.connect are ignored by GRASS for MySQL driver. + +## Troubleshooting: SQL syntax error + +Attempting to use a reserved SQL word as column or table name will +result in a \"SQL syntax\" error. The list of reserved words for MySQL +can be found in the [MySQL +manual](http://dev.mysql.com/doc/refman/5.7/en/reserved-words.html#table-reserved-words-5.7.4). + +## SEE ALSO + +*[db.connect](db.connect.html), [SQL support in GRASS GIS](sql.html)* + +## Credits + +Development of the driver was sponsored by +[Faunalia](http://www.faunalia.it) (Italy) as part of a project for +[ATAC](http://www.atac.roma.it/). + +## AUTHOR + +Radim Blazek diff --git a/db/drivers/odbc/grass-odbc.md b/db/drivers/odbc/grass-odbc.md new file mode 100644 index 00000000000..79fdbc56ca2 --- /dev/null +++ b/db/drivers/odbc/grass-odbc.md @@ -0,0 +1,141 @@ +Communication between GRASS and ODBC database for attribute management: + + --------------------- ------------------- ---------------- ------------------- ------------------ + GRASS module \<-\>  \<\--\> ODBC Interface \<\--\> RDBMS + ***GRASS*** ***DBMI driver*** ***unixODBC*** ***ODBC driver*** ***PostgreSQL*** + ***Oracle*** + ***\...*** + --------------------- ------------------- ---------------- ------------------- ------------------ + +## Supported SQL commands + +All SQL commands supported by ODBC. + +## Operators available in conditions + +All SQL operators supported by ODBC. + +## EXAMPLE + +In this example we copy the dbf file of a SHAPE map into ODBC, then +connect GRASS to the ODBC DBMS. Usually the table will be already +present in the DBMS. + +### Defining the ODBC connection + +#### MS-Windows + +On MS-Windows, in order to be able to connect, the ODBC connection needs +to be configured using dedicated tools (tool called \"ODBC Data Source +Administrator\") and give a name to that connection. This name is then +used as database name when accessing from a client via ODBC. + +#### Linux + +Configure ODBC driver for selected database (manually or with +\'ODBCConfig\'). ODBC drivers are defined in /etc/odbcinst.ini. Here an +example: + +::: code +  [PostgreSQL] +  Description     = ODBC for PostgreSQL +  Driver          = /usr/lib/libodbcpsql.so +  Setup           = /usr/lib/libodbcpsqlS.so +  FileUsage       = 1 +::: + +Create DSN (data source name). The DSN is used as database name in db.\* +modules. Then DSN must be defined in \$HOME/.odbc.ini (for this user +only) or in /etc/odbc.ini for (for all users) \[watch out for the +database name which appears twice and also for the PostgreSQL protocol +version\]. Omit blanks at the beginning of lines: + +::: code +  [grass6test] +  Description             = PostgreSQL +  Driver                  = PostgreSQL +  Trace                   = No +  TraceFile               = + +  Database                = grass6test +  Servername              = localhost +  UserName                = neteler +  Password                = +  Port                    = 5432 +  Protocol                = 8.0 + +  ReadOnly                = No +  RowVersioning           = No +  ShowSystemTables        = No +  ShowOidColumn           = No +  FakeOidIndex            = No +  ConnSettings            = +::: + +Configuration of an DSN without GUI is described on +, but odbc.ini and .odbc.ini may +be created by the \'ODBCConfig\' tool. You can easily view your DSN +structure by \'DataManager\'. Configuration with GUI is described on + + +To find out about your PostgreSQL protocol, run:\ + +::: code + psql -V +::: + +### Using the ODBC driver + +Now create a new database if not yet existing: + +::: code + db.createdb driver=odbc database=grass6test +::: + +To store a table \'mytable.dbf\' (here: in current directory) into +PostgreSQL through ODBC, run: + +::: code + db.connect driver=odbc database=grass6test + db.copy from_driver=dbf from_database=./ from_table=mytable \ + to_driver=odbc to_database=grass6test to_table=mytable +::: + +Next link the map to the attribute table (now the ODBC table is used, +not the dbf file): + +::: code + v.db.connect map=mytable.shp table=mytable key=ID \ + database=grass6test driver=odbc + v.db.connect -p +::: + +Finally a test: Here we should see the table columns (if the ODBC +connection works): + +::: code + db.tables -p + db.columns table=mytable +::: + +Now the table name \'mytable\' should appear.\ +Doesn\'t work? Check with \'isql \\' if the +ODBC-PostgreSQL connection is really established. + +Note that you can also connect mySQL, Oracle etc. through ODBC to GRASS. + +You can also check the vector map itself concerning a current link to a +table: + +::: code + v.db.connect -p mytable.shp +::: + +which should print the database connection through ODBC to the defined +RDBMS. + +## SEE ALSO + +*[db.connect](db.connect.html), [v.db.connect](v.db.connect.html), +[unixODBC web site](http://www.unixODBC.org), [SQL support in GRASS +GIS](sql.html)* diff --git a/db/drivers/ogr/grass-ogr.md b/db/drivers/ogr/grass-ogr.md new file mode 100644 index 00000000000..ceeea6d9fd7 --- /dev/null +++ b/db/drivers/ogr/grass-ogr.md @@ -0,0 +1,7 @@ +This driver is principally only used by *[v.external](v.external.html)*. + +## SEE ALSO + +*[SQL support in GRASS GIS](sql.html) * + +*[v.external](v.external.html)* diff --git a/db/drivers/postgres/grass-pg.md b/db/drivers/postgres/grass-pg.md new file mode 100644 index 00000000000..63f3a4f8d8a --- /dev/null +++ b/db/drivers/postgres/grass-pg.md @@ -0,0 +1,133 @@ +PostgreSQL database driver enables GRASS to store vector attributes in +PostgreSQL server. + +## Creating a PostgreSQL database + +A new database is created with `createdb`, see the [PostgreSQL +manual](http://www.postgresql.org/docs/manuals/) for details. + +## Connecting GRASS to PostgreSQL + +::: code + # example for connecting to a PostgreSQL server: + db.connect driver=pg database=mydb + db.login user=myname password=secret host=myserver.osgeo.org # port=5432 + db.connect -p + db.tables -p +::: + +### Username and password + +From the [PostgresQL +manual](https://www.postgresql.org/docs/10/static/libpq-pgpass.html): + +The file *.pgpass* in a user\'s home directory can contain passwords to +be used if the connection requires a password (and no password has been +specified otherwise). On Microsoft Windows the file is named +*%APPDATA%\\postgresql\\pgpass.conf* (where *%APPDATA%* refers to the +Application Data subdirectory in the user\'s profile). Alternatively, a +password file can be specified using the connection parameter passfile +or the environment variable PGPASSFILE. This file should contain lines +of the following format: + +::: code + hostname:port:database:username:password +::: + +## Supported SQL commands + +All SQL commands supported by PostgreSQL. It\'s not possible to use +C-like escapes (with backslash like \\n etc) within the SQL syntax. + +## Operators available in conditions + +All SQL operators supported by PostgreSQL. + +## Adding an unique ID column + +Import vector module require an unique ID column which can be generated +as follows in a PostgreSQL table: + +::: code + db.execute sql="ALTER TABLE mytable ADD ID integer" + db.execute sql="CREATE SEQUENCE mytable_seq" + db.execute sql="UPDATE mytable SET ID = nextval('mytable_seq')" + db.execute sql="DROP SEQUENCE mytable_seq" +::: + +## Attribute import into PostgreSQL + +CSV import into PostgreSQL: + +::: code + \h copy + COPY t1 FROM 'filename' USING DELIMITERS ','; +::: + +## Geometry import from PostgreSQL table into GRASS + +*[v.in.db](v.in.db.html)* creates a new vector (points) map from a +database table containing coordinates. See [here](v.in.db.html) for +examples. + +## PostGIS: PostgreSQL with vector geometry + +[PostGIS](http://postgis.refractions.net/): adds geographic object +support to PostgreSQL. + +### Example: Import from PostGIS + +In an existing PostGIS database, create the following table: + +::: code + CREATE TABLE test + ( + id serial NOT NULL, + mytime timestamp DEFAULT now(), + text varchar, + wkb_geometry geometry, + CONSTRAINT test_pkey PRIMARY KEY (id) + ) WITHOUT OIDS; + + # insert value + INSERT INTO test (text, wkb_geometry) + VALUES ('Name',geometryFromText('POLYGON((600000 200000,650000 + 200000,650000 250000,600000 250000,600000 200000))',-1)); + + # register geometry column + select AddGeometryColumn ('postgis', 'test', 'geometry', -1, 'GEOMETRY', 2); +::: + +GRASS can import this PostGIS polygon map as follows: + +::: code + v.in.ogr input="PG:host=localhost dbname=postgis user=neteler" layer=test \ + output=test type=boundary,centroid + v.db.select test + v.info -t test +::: + +#### Geometry Converters + +- [PostGIS with shp2pgsql](http://postgis.refractions.net/download/):\ + `shp2pgsql -D lakespy2 lakespy2 test > lakespy2.sql` +- [e00pg](http://e00pg.sourceforge.net/): E00 to PostGIS filter, see + also *[v.in.e00](v.in.e00.html)*. +- GDAL/OGR [ogrinfo and ogr2ogr](http://www.gdal.org/): GIS vector + format converter and library, e.g. ArcInfo or SHAPE to PostGIS.\ + `ogr2ogr -f "PostgreSQL" shapefile ??` + +## SEE ALSO + +*[db.connect](db.connect.html), [db.execute](db.execute.html)* + +[Database management in GRASS GIS](databaseintro.html)\ +[Help pages for database modules](database.html)\ +[SQL support in GRASS GIS](sql.html)\ + +## REFERENCES + +- [PostgreSQL web site](http://www.postgresql.org/) +- [pgAdmin graphical user interface](http://www.pgadmin.org/) +- [GDAL/OGR PostgreSQL driver + documentation](http://www.gdal.org/drv_pg.html) diff --git a/db/drivers/sqlite/grass-sqlite.md b/db/drivers/sqlite/grass-sqlite.md new file mode 100644 index 00000000000..2c4f44ec05a --- /dev/null +++ b/db/drivers/sqlite/grass-sqlite.md @@ -0,0 +1,54 @@ +The SQLite driver is the default DBMI backend. + +## Creating a SQLite database + +GRASS is automatically creating the SQLite database if it is not yet +existing when the first table is created in the SQLite database. It is +sufficient to define the connection (see next step). + +## Connecting GRASS to SQLite + +The database name \'sqlite.db\' is at user\'s choice. Also the file +storage location can be freely chosen. If the database does not exist, +it will be automatically created when database content is created: + +::: code + # example for storing DB in mapset directory (keep single quotes): + db.connect driver=sqlite database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' + db.connect -p +::: + +## Supported SQL commands + +All SQL commands supported by SQLite (for limitations, see SQLite help +page: [SQL As Understood By SQLite](http://www.sqlite.org/lang.html) and +[Unsupported SQL](http://www.sqlite.org/omitted.html)). + +## Operators available in conditions + +All SQL operators supported by SQLite. + +## Browsing table data in DB + +A convenient SQLite front-end is +[sqlitebrowser](http://sqlitebrowser.sourceforge.net/). To open a DB +file stored within the current mapset, the following way is suggested +(corresponds to above database connection): + +::: code + # fetch GRASS variables as shell environment variables: + eval `g.gisenv` + # use double quotes: + sqlitebrowser "$GISDBASE/$LOCATION_NAME/$MAPSET"/sqlite/sqlite.db +::: + +## SEE ALSO + +*[db.connect](db.connect.html), [db.execute](db.execute.html), +[db.select](db.select.html)\ +\ +[SQL support in GRASS GIS](sql.html)\ +\ +[SQLite web site](http://www.sqlite.org), [SQLite +manual](http://www.sqlite.org/quickstart.html), [sqlite - Management +Tools](http://www.sqlite.org/cvstrac/wiki?p=ManagementTools)* diff --git a/display/d.barscale/d.barscale.md b/display/d.barscale/d.barscale.md new file mode 100644 index 00000000000..1357b150ade --- /dev/null +++ b/display/d.barscale/d.barscale.md @@ -0,0 +1,25 @@ +## DESCRIPTION + +*d.barscale* displays a barscale on the graphics monitor at the given +screen coordinates. If no coordinates are given it will draw the +barscale in the bottom left of the display. + +The barscale can drawn in a number of styles (see **style** parameter +for their previews). + +## NOTE + +*d.barscale* will not work with Lat/Lon coordinate reference system as +the horizontal scale distance changes with latitude. Try +*[d.grid](d.grid.html)* instead. + +## SEE ALSO + +*[d.graph](d.graph.html), [d.grid](d.grid.html), +[d.legend](d.legend.html), [d.northarrow](d.northarrow.html), +[g.region](g.region.html)* + +## AUTHORS + +Unknown, from USACE/CERL.\ +Major rewrite for GRASS 7 by Hamish Bowman diff --git a/display/d.colorlist/d.colorlist.md b/display/d.colorlist/d.colorlist.md new file mode 100644 index 00000000000..1e7560d81f5 --- /dev/null +++ b/display/d.colorlist/d.colorlist.md @@ -0,0 +1,13 @@ +## DESCRIPTION + +*d.colorlist* report the available color names. The list contains all +available display colors with a configurable separator (default is +comma). + +## SEE ALSO + +*[r.colors](r.colors.html)* + +## AUTHOR + +Andreas Lange diff --git a/display/d.colortable/d.colortable.md b/display/d.colortable/d.colortable.md new file mode 100644 index 00000000000..1cdeea18fbc --- /dev/null +++ b/display/d.colortable/d.colortable.md @@ -0,0 +1,59 @@ +## DESCRIPTION + +*d.colortable* is used to display the color table associated with a +raster map in the active frame on the graphics monitor. The **map** name +should be an available raster map in the user\'s current mapset search +path and location. + +If the *values* of both **lines** and **columns** are not specified by +the user, *d.colortable* divides the active frame equally among the +number of categories present in the named raster map. If one option is +specified, the other is automatically set to accommodate all categories. +If both are specified, as many categories as possible are displayed. + +If the user specifies the name of a map on the command line but does not +specify the values of other parameters, parameter default values will be +used. Alternately, if the user types simply *d.colortable* on the +command line without any program arguments, the program will prompt the +user for parameter settings using the standard GRASS parser interface. + +## EXAMPLE + +The user running the command: + +::: code + d.colortable map=soils color=red lines=1 columns=3 +::: + +would see the active graphics frame divided into three columns extending +the full frame height. The lines dividing the color table associated +with the *soils* map would be displayed in red. The user would see, at +most, only three of the colors from the *soils* color table displayed in +the active frame (because the user requested that this frame be divided +into three sections). + +## NOTES + +If the user wishes to display the entire color table associated with a +map, the user should either stipulate a number of lines (rows) and +columns (cols) sufficient to accommodate the number of categories in the +map\'s color table, or fail to assign values to one or both of **lines** +and/or **columns**. If the user runs *d.colortable* using the default +number of lines and columns (the full graphics frame), all categories +from the map\'s color table will be displayed. However, if the user +requests that the color table associated with a map which has 10 data +categories be displayed in a graphics frame with only 3 lines (rows) and +2 columns (a total of six cells), only six of the ten map categories +will be displayed. + +The user should run *[d.erase](d.erase.html)* between runs of +*d.colortable* to avoid confusion. + +## SEE ALSO + +*[d.erase](d.erase.html), [d.legend](d.legend.html), +[d.rast](d.rast.html)* + +## AUTHOR + +James Westervelt, U.S. Army Construction Engineering Research Laboratory diff --git a/display/d.erase/d.erase.md b/display/d.erase/d.erase.md new file mode 100644 index 00000000000..b6c2c13bed2 --- /dev/null +++ b/display/d.erase/d.erase.md @@ -0,0 +1,14 @@ +## DESCRIPTION + +*d.erase* erases the contents of the active graphics frame, and replaces +it with the color black (by default) or by whatever color is specified +by the user. + +## SEE ALSO + +*[d.mon](d.mon.html), [d.redraw](d.redraw.html), [d.rast](d.rast.html), +[d.vect](d.vect.html)* + +## AUTHOR + +James Westervelt, U.S. Army Construction Engineering Research Laboratory diff --git a/display/d.extract/d.extract.md b/display/d.extract/d.extract.md new file mode 100644 index 00000000000..ef900a4ebad --- /dev/null +++ b/display/d.extract/d.extract.md @@ -0,0 +1,23 @@ +## DESCRIPTION + +*d.extract* allows a user to graphically select vector objects from an +existing vector map and creates a new map containing only the selected +objects. + +## EXAMPLE + +### Graphically extract roads from a roads map: + +::: code + d.mon x0 + d.vect roads + d.extract input=roads output=interstate +::: + +## SEE ALSO + +*[v.extract](v.extract.html)* + +## AUTHORS + +Radim Blazek, Markus Neteler diff --git a/display/d.font/d.font.md b/display/d.font/d.font.md new file mode 100644 index 00000000000..2afdfab63ec --- /dev/null +++ b/display/d.font/d.font.md @@ -0,0 +1,55 @@ +## DESCRIPTION + +*d.font* allows the user to select use of a specific text font for +display of text on the graphics monitor. If the user does not specify a +font when using other GRASS programs that display text, the font type +*romans* is used by default. + +The user can run this program either non-interactively or interactively. +If the user specifies a font type name on the command line the program +will run non-interactively. Alternately, the user can simply type +**d.font** on the command line; in this case, the program will prompt +the user for a display text font type. + +**Parameter:** + +**font=***name* +: Name of a font type, from among the font types italicized below.\ + Default: *romans*\ + Options: (italized)\ + *cyrilc* Cyrillic\ + *gothgbt* Gothic Great Britain triplex\ + *gothgrt* Gothic German triplex\ + *gothitt* Gothic Italian triplex\ + *greekc* Greek complex\ + *greekcs* Greek complex script\ + *greekp* Greek plain\ + *greeks* Greek simplex\ + *italicc* Italian complex\ + *italiccs* Italian complex small\ + *italict* Italian triplex\ + *romanc* Roman complex\ + *romancs* Roman complex small\ + *romand* Roman duplex\ + *romanp* Roman plain\ + *romans* Roman simplex\ + *romant* Roman triplex\ + *scriptc* Script complex\ + *scripts* Script simplex + +## NOTES + +The font type *romans* is the fastest font type to display to the +graphics monitor. + +## SEE ALSO + +*[d.text](d.text.html)*\ +*[d.title](d.title.html)* + +## AUTHOR + +James Westervelt, U.S. Army Construction Engineering Research Laboratory + +*d.font* uses the public domain version of the Hershey Fonts created by +Dr. A.V. Hershey while working at the U.S. National Bureau of Standards. diff --git a/display/d.fontlist/d.fontlist.md b/display/d.fontlist/d.fontlist.md new file mode 100644 index 00000000000..dea862011d2 --- /dev/null +++ b/display/d.fontlist/d.fontlist.md @@ -0,0 +1,12 @@ +## DESCRIPTION + +*d.fontlist* outputs a list of available fonts for use with GRASS +display commands. + +## SEE ALSO + +*[d.text](d.text.html)* + +## AUTHOR + +Glynn Clements diff --git a/display/d.geodesic/d.geodesic.md b/display/d.geodesic/d.geodesic.md new file mode 100644 index 00000000000..cd8e887ef5e --- /dev/null +++ b/display/d.geodesic/d.geodesic.md @@ -0,0 +1,49 @@ +## DESCRIPTION + +*d.geodesic* displays a geodesic line in the active frame on the user\'s +graphics monitor. This is also known as the great circle line and traces +the shortest distance between two user-specified points on the curved +surface of a longitude/latitude data set. The two coordinate locations +named must fall within the boundaries of the user\'s current geographic +region. + +## OPTIONS + +By default black line color and red text color will be used. + +By indicating the starting and ending coordinates of the geodesic, the +line and its length (by default in meters) are displayed to the +graphical output. If the text color is set to *none*, the great circle +distance is not displayed. + +## EXAMPLE + +A geodesic line if shown over the political map of the world +(demolocation dataset): + +::: code + g.region vector=country_boundaries -p + d.mon wx0 + d.vect country_boundaries type=area + # show additionally a 20 degree grid + d.grid 20 + + d.geodesic coordinates=55:58W,33:18S,26:43E,60:37N \ + line_color=yellow text_color=red units=kilometers +::: + +![](d_geodesic.png){border="1"}\ +*Geodesic line (great circle line)* + +## NOTES + +This program works only with longitude/latitude coordinate system. + +## SEE ALSO + +*[d.rhumbline](d.rhumbline.html), [d.grid](d.grid.html), +[m.measure](m.measure.html)* + +## AUTHOR + +Michael Shapiro, U.S. Army Construction Engineering Research Laboratory diff --git a/display/d.graph/d.graph.md b/display/d.graph/d.graph.md new file mode 100644 index 00000000000..29c2de1fca4 --- /dev/null +++ b/display/d.graph/d.graph.md @@ -0,0 +1,181 @@ +## DESCRIPTION + +*d.graph* draws graphics that are described either from standard input +(default), or within a file (if an **input** file name is identified on +the command line). If graphics commands are entered from standard input, +a *CTRL-d* is used to signal the end of input to *d.graph*. Coordinates +are given either as a percentage of frame height and width (default) or +in geographic coordinates (with the **-m** flag). + +The program can be run interactively or non-interactively. The user can +run the program completely non-interactively by specifying the name of a +graphics file containing the *d.graph* graphics commands. If run +non-interactively the *d.graph* command is saved to the display\'s +dedraw history. The user can also elect to run the program partially +interactively, by specifying any/all of the parameters *except* the +graphics file **input=***name* parameter on the command line. In this +case, *d.graph* will expect the user to input *d.graph* graphics +commands from standard input (i.e., the keyboard) and will (silently) +prompt the user for these graphics commands. + +Alternately, the user can simply type **d.graph** on the command line, +and be prompted for the values of all parameters. In this case, the user +is presented with the standard GRASS GUI interface. + +The default coordinate system used is 0-100 percent of the active frame +in x and similarly 0-100 in y, regardless of the graphics monitor +display frame size and aspect. The (0,0) location is the lower left +corner of the active graphics monitor display frame. All values may be +floating point. If the **-m** flag is given, geographic coordinates will +be used instead. + +## COMMANDS + +The graphics language is simple, and uses the following commands:\ + +\[ [\#](#comment) \| [move](#move) \| [draw](#draw) \| +[polygon](#polygon) \| [polyline](#polyline) \| [color](#color) \| +[text](#text) \| [size](#size) \| [symbol](#symbol) \| +[rotation](#rotation) \| [icon](#icon) \| [width](#width) \] + +[]{#comment}**\#** *comment* +: A line of comment which is ignored in the processing. + +[]{#move}**move** *xpos ypos* +: The current location is updated to *xpos ypos*. Unless the **-m** + flag is used, values are stated as a percent of the active display + frame\'s horizontal (*xpos*) and vertical (*ypos*) size, and may be + floating point values. Values are between 0-100. **Note.** A space + must separate *xpos* and *ypos*. + +[]{#draw}**draw** *xpos ypos* +: A line is drawn in the current color from the current location to + the new location *xpos ypos*, which then becomes the current + location. Unless the **-m** flag is used, values are stated as a + percent of the active display frame\'s horizontal (*xpos*) and + vertical (*ypos*) size, and may be floating point values. Values are + between 0-100. **Note.** A space must separate *xpos* and *ypos*. + +[]{#polygon}**polygon**\ +   *xpos ypos*\ +   *xpos ypos*\ +  \... +: The coordinates appearing beneath the word *polygon*, one pair per + line, circumscribe a polygon that is to be filled with the current + color. + +[]{#polyline}**polyline**\ +   *xpos ypos*\ +   *xpos ypos*\ +  \... +: The coordinates appearing beneath the word *polyline*, one pair per + line, circumscribe a polygon that is not to be filled with color. + +[]{#color}**color** *color* +: Sets the current color to that stated; subsequent graphics will be + drawn in the stated color, until the current color is set to a + different color. Options are *red*, *orange*, *yellow*, *green*, + *blue*, *indigo*, *violet*, *brown*, *magenta*, *gray*, *white*, + *black*, an R:G:B triplet (separated by colons), or the word + \"none\" (draws in the default background color). + +[]{#text}**text** *line-of-text* +: The stated text is drawn at the current location using the current + color, and the new current location is then positioned at the end of + the text string. + +[]{#size}**size** *xper yper* +: Subsequent text will be drawn such that the text is *xper* percent + of the graphics monitor display frame wide and *yper* percent of the + frame high. By default, the text size is set to 5 percent of the + active frame\'s width and 5 percent of the frame\'s height. If only + one value is given, then that value will be used for both x and y + scaling.\ + **Note.** A space must separate *xper* and *yper*. + +[]{#symbol}**symbol** *type size xper yper \[line_color \[fill_color\]\]* +: A symbol is drawn at the given size on the display monitor. The + *xper* and *yper* options define the center of the icon and are + given as a percentage of the display frame (`0,0` is lower left). + The symbol can be any of those stored in `$GISBASE/etc/symbol/` + (e.g. *basic/circle*) or stored in the user\'s mapset directory in + the form `$MAPSET/symbol/`*type/name*. The colors may be either a + standard color name, an R:G:B triplet, or \"none\". If using an + R:G:B triplet, each color value can range from 0-255. If not + specified the default *line_color* is black and the default + *fill_color* is grey. + +[]{#rotation}**rotation** *angle* +: Subsequent text and symbols will be drawn such that they are rotated + *angle* degrees counter-clockwise from east. + +[]{#icon}**icon** *type size x y* +: Draws an icon of types *o*, *x*, or *+* with specified *size* (in %) + at location *x,y*. Note: type *o* designates a square. + +[]{#width}**width** *value* +: Subsequent lines (including non-FreeType text) will be drawn with + the given pixel thickness.\ + The default value is 0. + +## EXAMPLES + +For an example use of *d.graph*, examine the contents of the command +file *[grass_logo.txt](grass_logo.txt)* located in the *d.graph* source +code directory. It will draw the CERL GRASS logo using the *d.graph* +graphing commands stored in the file. Note that the coordinates in the +*[grass_logo.txt](grass_logo.txt)* file were taken directly off an image +drawn by hand on graph paper. + +A dynamic example can be found in the *d.polar* shell script. + +### Draw a \"star\" symbol at a given map coordinate + +::: code + echo "symbol basic/star 20 2264417 5413182 black red" | d.graph -m +::: + +### Split the screen into quadrants: + +::: code + d.frame -s full_screen + + d.graph << EOF + color 80:80:120 + polygon + 0 49.75 + 0 50.25 + 100 50.25 + 100 49.75 + polygon + 49.85 0 + 50.15 0 + 50.15 100 + 49.85 100 + EOF +::: + +## NOTES + +*d.graph* remembers the last screen location (*xpos ypos*) to which the +user moved, even after the user erases the display frame. If the user +runs *d.graph* repeatedly, and wishes to start anew with the default +(xpos ypos) screen location, the user should *clear* the display frame +between runs of *d.graph*. + +## LIMITATIONS + +There are no automated ways of generating graphic images. It is +anticipated that GRASS user sites will write programs to convert output +from a resident graphics editor into GRASS *d.graph* format. (e.g. EPS +-\> *d.graph*, perhaps with the help of a +[pstoedit](http://www.pstoedit.net/) plugin) + +## SEE ALSO + +*[d.font](d.font.html), [d.labels](d.labels.html), +[d.polar](d.polar.html), [d.text](d.text.html), [d.where](d.where.html)* + +## AUTHOR + +James Westervelt, U.S. Army Construction Engineering Research Laboratory diff --git a/display/d.grid/d.grid.md b/display/d.grid/d.grid.md new file mode 100644 index 00000000000..40e15f24411 --- /dev/null +++ b/display/d.grid/d.grid.md @@ -0,0 +1,74 @@ +## DESCRIPTION + +*d.grid* overlays a grid of user-defined size and color in the active +display frame on the graphics monitor. The grid can be created as a +standard rectangular grid or a geographic grid. + +If the user provides a **-g** flag a geographic (projected) grid will be +drawn. With the **-g** flag the **size** argument accepts both decimal +degrees and colon separated ddd:mm:ss coordinates (eg. `00:30:00` for +half of a degree). A geographic grid cannot be drawn for a +*latitude/longitude* or *XY* projection. + +Colors may be standard named GRASS colors (red, green, aqua, etc.) or a +numerical R:G:B triplet, where component values range from 0-255. Grid +color can be set with option **color**. Options **text_color** and +**bgcolor** set the color of the text and its background. + +The grid drawing may be turned off by using the **-n** flag.\ +The border drawing may be turned off by using the **-b** flag.\ +The coordinate text may be turned off by using the **-t** flag.\ + +To draw grid lines at different intervals, e.g. at high latitudes, you +can run the module twice, once with **direction**=*east-west* at one +interval **size**, and again with **direction**=*north-south* at another +interval **size**. + +## EXAMPLES + +To draw a red geographic grid with 30 minute grid spacing, run one of +the following commands: + +::: code + d.grid -g size=00:30:00 color=red +::: + +or + +::: code + d.grid -g size=0.5 color=255:0:0 +::: + +::: {style="margin: 10px" align="center"} +![d.grid red grid example](d_grid_red_grid.png){border="0"}\ +*Figure: Showing a geographic grid in red line color* +::: + +To draw a blue standard rectangular grid at a 500 (meter) spacing run +the following: + +::: code + d.grid size=500 color=blue +::: + +::: {style="margin: 10px" align="center"} +![d.grid blue grid example](d_grid_blue_grid.png){border="0"}\ +*Figure: Showing a rectangular grid in blue line color* +::: + +## SEE ALSO + +*[d.barscale](d.barscale.html), [d.legend](d.legend.html), +[d.geodesic](d.geodesic.html), [d.rhumbline](d.rhumbline.html), +[d.erase](d.erase.html), [d.frame](d.frame.html), [d.rast](d.rast.html), +[v.mkgrid](v.mkgrid.html)* + +## AUTHORS + +James Westervelt, U.S. Army Construction Engineering Research +Laboratory\ +Geogrid support: Bob Covill\ +Border support: Markus Neteler\ +Text and RGB support: Hamish Bowman\ +Background color implemented as part of GSoC 2016 by Adam Laza, CTU in +Prague diff --git a/display/d.his/d.his.md b/display/d.his/d.his.md new file mode 100644 index 00000000000..23c6135212b --- /dev/null +++ b/display/d.his/d.his.md @@ -0,0 +1,103 @@ +## DESCRIPTION + +*HIS* stands for hue, intensity, and saturation. This program produces a +raster map layer providing a visually pleasing combination of hue, +intensity, and saturation values from two or three user-specified raster +map layers. + +The human brain automatically interprets the vast amount of visual +information available according to basic rules. Color, or *hue*, is used +to categorize objects. Shading, or *intensity*, is interpreted as +three-dimensional texturing. Finally, the degree of haziness, or +*saturation*, is associated with distance or depth. This program allows +data from up to three raster map layers to be combined into an image +which retains the original information in terms of *hue*, *intensity*, +and *saturation*. + +## OPTIONS + +This program can be run non-interactively or interactively. It will run +non-interactively if the user specifies on the command line the name of +a map containing hue values (**hue**), and the name(s) of map(s) +containing intensity values (**intensity**) and/or saturation values +(**saturation**). The resulting image will be displayed in the active +display frame on the graphics monitor. + +Alternately, the user can run the program interactively by typing +**d.his** without naming parameter values on the command line. In this +case, the program will prompt the user for parameter values using the +standard GRASS GUI interface. + +While any raster map layer can be used to represent the hue information, +map layers with a few very distinct colors work best. Only raster map +layers representing continuously varying data like elevation, aspect, +weights, intensities, or amounts can suitably be used to provide +intensity and saturation information. + +For example, a visually pleasing image can be made by using a watershed +map for the *hue* factor, an aspect map for the *intensity* factor, and +an elevation map for *saturation*. (The user may wish to leave out the +elevation information for a first try.) Ideally, the resulting image +should resemble the view from an aircraft looking at a terrain on a +sunny day with a bit of haze in the valleys. + +The **brighten** option does not truly represent a percentage, but +calling it that makes the option easy to understand, and it sounds +better than *Normalized Scaling Factor*. + +## THE PROCESS + +Each map cell is processed individually. First, the working color is set +to the color of the corresponding cell in the map layer chosen to +represent *hue*. Second, this color is multiplied by the *red* intensity +of that cell in the *intensity* map layer. This map layer should have an +appropriate gray-scale color table associated with it. You can ensure +this by using the color manipulation capabilities of +*[r.colors](r.colors.html)*. Finally, the color is made somewhat +gray-based on the *red* intensity of that cell in the *saturation* map +layer. Again, this map layer should have a gray-scale color table +associated with it. + +## NOTES + +The name is misleading. The actual conversion used is + +::: code + H.i.s + G.(1-s) + + where + + H is the R,G,B color from the hue map + i is the red value from the intensity map + s is the red value from the saturation map + G is 50% gray (R = G = B = 0.5) +::: + +Either (but not both) of the intensity or the saturation map layers may +be omitted. This means that it is possible to produce output images that +represent combinations of *his, hi,* or *hs*. + +Users wishing to store the result in new raster map layers instead of +displaying it on the monitor should use the command +*[r.his](r.his.html)*. + +## EXAMPLE + +::: code + g.region raster=elevation + r.relief input=elevation output=elevation_shaded_relief + + d.mon wx0 + d.his hue=elevation intensity=elevation_shaded_relief brighten=50 +::: + +## SEE ALSO + +*[d.colortable](d.colortable.html), [d.frame](d.frame.html), +[d.rgb](d.rgb.html), [d.shade](d.shade.html), [r.colors](r.colors.html), +[r.his](r.his.html), [i.his.rgb](i.his.rgb.html), +[i.rgb.his](i.rgb.his.html)* + +## AUTHOR + +James Westervelt, U.S. Army Construction Engineering Research Laboratory diff --git a/display/d.histogram/d.histogram.md b/display/d.histogram/d.histogram.md new file mode 100644 index 00000000000..d59a64adafe --- /dev/null +++ b/display/d.histogram/d.histogram.md @@ -0,0 +1,59 @@ +## DESCRIPTION + +*d.histogram* displays the category-value distribution for a +user-specified raster map layer, in the form of a bar chart or a pie +chart. The display will be displayed in the active display frame on the +graphics monitor, using the colors in the raster map layer\'s color +table. The program determines the raster map\'s category value +distribution by counting cells. + +## NOTES + +*d.histogram* respects the current geographic region settings and the +current MASK (if one exists). + +*d.histogram* uses the colors in the map\'s color look-up table (i.e., +the map\'s *colr* or *colr2* file). + +## EXAMPLES + +Running the command below will generate the bar graph shown in the +figure: + +::: code + g.region raster=elevation -p + d.mon wx0 + d.histogram map=elevation +::: + +::: {align="center" style="margin: 10px"} +![d.histogram bar graph example](d_histogram_bar.png){border="0"}\ +*Figure: Bar graph histogram for elevation map* +::: + +Running the command below will generate the pie graph shown in the +figure: + +::: code + g.region raster=landuse96_28m -p + d.histogram map=landuse96_28m style=pie +::: + +::: {align="center" style="margin: 10px"} +![d.histogram pie graph example](d_histogram_pie.png){border="0"}\ +*Figure: Pie graph histogram for landuse map* +::: + +## SEE ALSO + +*[d.colortable](d.colortable.html), [d.frame](d.frame.html), +[d.graph](d.graph.html), [d.linegraph](d.linegraph.html), +[d.mon](d.mon.html), [d.polar](d.polar.html), [g.region](g.region.html), +[r.stats](r.stats.html)* + +## AUTHOR + +Dave Johnson\ +DBA Systems, Inc.\ +10560 Arrowhead Drive\ +Fairfax, Virginia 22030 diff --git a/display/d.info/d.info.md b/display/d.info/d.info.md new file mode 100644 index 00000000000..29618356a2b --- /dev/null +++ b/display/d.info/d.info.md @@ -0,0 +1,30 @@ +## DESCRIPTION + +*d.info* displays information about the active display monitor. Display +monitors are maintained by *[d.mon](d.mon.html)*. + +## EXAMPLES + +::: code + d.mon start=cairo + + d.info -r + rectangle: 0.000000 640.000000 0.000000 480.000000 +::: + +## NOTES + +Units are screen pixels (except for **-g** flag where map units are +used).\ +Where two numbers are given the format is: width, height.\ +Where four numbers are given the format is: left, right, top, bottom. + +Note: GRASS display pixel coordinates are measured from the top left. + +## SEE ALSO + +*[d.mon](d.mon.html), [d.vect](d.vect.html), [d.rast](d.rast.html)* + +## AUTHOR + +Glynn Clements diff --git a/display/d.labels/d.labels.md b/display/d.labels/d.labels.md new file mode 100644 index 00000000000..8122c2738e5 --- /dev/null +++ b/display/d.labels/d.labels.md @@ -0,0 +1,33 @@ +## DESCRIPTION + +*d.labels* displays a *paint* label file in the active display frame on +the graphics monitor. Each label has components which determine the +text, the location of the text on the image, its size, and the +background for the text. This file can be generated with the +*[v.label](v.label.html)* program or simply created by the user as an +ASCII file (using a text editor) and placed in the appropriate directory +under the user\'s current mapset and project (i.e. +`$MAPSET/paint/labels/`). + +## NOTES + +Some of the information stored in the label file is unused by +*d.labels*. This extra information is used by such programs as +*[ps.map](ps.map.html)*. + +This module was formerly known as *d.paint.labels*. The the old version +of *d.labels* from GRASS 5, which provided interactive placement and +modification of paint labels, still needs to have its functionality +merged into this module. + +## SEE ALSO + +*[d.font](d.font.html)*\ +*[d.text](d.text.html)*\ +*[d.title](d.title.html)*\ +*[ps.map](ps.map.html)*\ +*[v.label](v.label.html)*\ + +## AUTHOR + +James Westervelt, U.S. Army Construction Engineering Research Laboratory diff --git a/display/d.legend.vect/d.legend.vect.md b/display/d.legend.vect/d.legend.vect.md new file mode 100644 index 00000000000..38b512c50a8 --- /dev/null +++ b/display/d.legend.vect/d.legend.vect.md @@ -0,0 +1,104 @@ +## DESCRIPTION + +Module *d.legend.vect* draws vector legend of currently displayed vector +maps. + +Parameter **at** defines the screen position of upper-left legend +corner. Parameter **columns** defines the number of legend columns. User +can specify a title of the legend using parameter **title**. The font of +the title can be changed with **title_font**, **title_fontsize**. Flag +**-b** is used to draw background of specified color (**bgcolor**), +border color and border width (**border_color** and **border_width**). +Parameter **symbol_size** defines the size of line and area symbols. The +size of point symbols is based on currently set symbology of vector maps +using *[d.vect](d.vect.html)* or +*[d.vect.thematic](d.vect.thematic.html)*. + +Module *d.vect.legend* supports subtitles (see section Notes). Their +font and font size can be set using parameters **sub_font** and +**sub_fontsize**. + +### Changing legend symbols and labels + +Symbols for vector areas and lines, and labels for individual vector +labels can be changed in the symbology setting of each vector map in +*[d.vect](d.vect.html)* or *[d.vect.thematic](d.vect.thematic.html)* +module (in Legend tab). Use its parameters **icon_area** and +**icon_line** to pick from available symbols. By using parameter +**legend_label** of *d.vect* module, users can change the default label, +which is the map name. + +### Modifying the order of legend entries and omitting certain vector maps from legend + +Modules *[d.vect](d.vect.html)* and +*[d.vect.thematic](d.vect.thematic.html)* have a flag **-s** which +removes the particular vector or thematic vector from vector legend. + +The order of entries is defined by the order in Layer Manager (if used +in GRASS GIS GUI). If that\'s not desired, one can export the legend +file into a text file using parameter **output**, change the order of +entries (see section Notes for format description) and then upload the +modified file with parameter **input**. Parameter **output** defines +path to the file where the internal legend file will be saved to, +**input** defines the input file which the vector legend will be based +on (input file must have correct format). + +## NOTES + +Module *d.legend.vect* draws vector legend based on legend file defined +in shell environment variable GRASS_LEGEND_FILE. This file is +automatically created and updated whenever *[d.vect](d.vect.html)* +command is used. User can create custom legend file and then use *export +GRASS_LEGEND_FILE=path/to/file* in shell. GRASS GUI and MONITORS create +the legend file automatically. By default the legend file is stored in +grassdata/project/mapset/.tmp/user directory (in case of d.mon deeper in +/monitor_name directory).\ + +Legend file has this format: + + label|symbol_name|size|color_type|feature_color|fill_color|line_width|geometry_type|feature_count + +Color type can be \'lf\' or \'ps\'. Based on color type color columns +are interpreted as line color and fill colors (lf), or primary and +secondary colors (ps). Module d.vect always uses \'lf\' and +d.vect.thematic \'ps\'. Here is an example of legend file with +subtitles: + + Infrastructure|||||||| + major roads|legend/line|5|lf|black|200:200:200|2|line|355 + bridges|extra/bridge|15|lf|black|black|1|point|10938 + Hydrology|||||||| + streams|legend/line_crooked|5|lf|30:144:255|200:200:200|3|line|8554 + water bodies|legend/area_curved|5|lf|none|30:144:255|1|area|27764 + +![Example of subheadings used in vector +legend](d_legend_vect_subheadings.png) + +## EXAMPLES + +Open cairo monitor to render to file: + +::: code + g.region vector=nc_state + d.mon cairo + d.vect map=nc_state color=26:26:26 fill_color=229:229:229 width=2 legend_label="state boundaries" + d.vect map=urbanarea color=none fill_color=127:127:127 width=1 legend_label="urban areas" + d.vect map=railroads color=red width=1 + d.vect map=hospitals color=77:77:77 fill_color=0:187:0 width=1 icon=basic/cross3 size=10 + d.legend.vect -b at=2,40 title="Hospitals in North Carolina" symbol_size=26 fontsize=16 title_fontsize=20 +::: + +![d.legend.vect example](d_legend_vect.png)\ + +## SEE ALSO + +*[d.vect](d.vect.html), [d.vect.thematic](d.vect.thematic.html), +[d.legend](d.legend.html)* + +Check also Python module from AddOns: +*[d.vect.thematic2](https://grass.osgeo.org/grass8/manuals/addons/d.vect.thematic2.html)* + +## AUTHORS + +Adam Laza, during GSoC 2016 Mentors: Anna Petrasova, Vaclav Petras, +Martin Landa diff --git a/display/d.legend/d.legend.md b/display/d.legend/d.legend.md new file mode 100644 index 00000000000..dd73ac81c74 --- /dev/null +++ b/display/d.legend/d.legend.md @@ -0,0 +1,152 @@ +## DESCRIPTION + +*d.legend* displays a legend for a user-specified raster map or 3D +raster map layer in the active frame on the graphics monitor. + +The legend\'s default size is based on the dimensions of the active +frame, specifically its height. *d.legend* will only obscure those +portions of the active frame that directly underlie the legend. + +## NOTES + +When using the **at** to size & place the legend, a user may create a +horizontal legend by making the box wider than it is tall. + +Raster maps based on floating point values will display smoothed, from +greatest to smallest value, while categorical raster maps will display +in order, from top to bottom. Horizontal legends will always be +smoothed. If the box is defined with inverted y-values or an inverted +**range**, the legend will automatically flip. If this is not the +desired result, the **-f** flag may be used to flip it back. + +If the user attempts to display a very long legend in a relatively short +display frame, the legend may appear in unreadably small text, or even +revert to a smooth gradient legend. Use the **lines**, **thin**, +**use**, **range**, and/or **-n** options to reduce the number of +categories to be displayed, or the **-s** flag to force a smooth +gradient legend. + +The **lines** option will display the first number of categories, as +defined by *value*, contained in the raster map. When used with the +**-n** flag, it takes on a new meaning: \"up to category #\". When used +with both **thin** and the **-n** flag, its meaning becomes more +obscure. When using **lines**, auto-scaled text similar to \"4 of 16 +categories\" will be placed at the bottom of the legend. + +The **thin** option sets the thinning factor. For raster maps with a 0th +category, **thin=***10* gives cats \[0,10,20,\...\]. For raster maps +starting at category 1, **thin=***10* gives cats \[1,11,21,\...\]. + +The **use** option lets the user create a legend made up of arbitrary +category values. e.g. **use=***1000,100,10,0,-10,-100,-1000* + +The **range** option lets the user define the minimum and maximum +categories to be used in the legend. It may also be used to define the +limits of a smooth gradient legend created from a raster containing +floating point values. Note the color scale will remain faithful to the +category values as defined with *[r.colors](r.colors.html)*, and the +**range** may be extended to the limits defined by the +*[r.colors](r.colors.html)* color map. + +The flag **-n** is useful for categorial maps, as it suppresses the +drawing of non-existing categories (otherwise the full range is shown). + +Vertical legends produced with *d.legend* will place text labels to the +right of the legend box, horizontal legends will place text below. This +text will be auto-scaled to fit within the frame, reducing the size of +the legend if necessary. Legends positioned with the **at** option will +not auto-scale text, in order to provide more control to the user. +Smaller text may be obtained in this case by reducing the height of the +box or by using the **fontsize** option. The **-c** and **-v** flags may +be used to suppress the display of category numbers and labels +respectively, or used together to suppress all text of categorial raster +maps. + +The text produced from floating-point raster maps will automatically +create output with a meaningful number of significant digits. For very +small values, numbers will be expressed in scientific notation, +e.g. \"1.7e-9\". Option **digits** can be used to determine how many +digits after decimal point will be displayed. + +When the **-d** flag is used to display a histogram distribution along +side the smoothed gradient legend, note that the statistics are +calculated on the *current computational region* settings set by +*g.region*. The default **range** however covers the entire natural +bounds of the input map. If the histogram appears empty, check your +region settings. + +If the raster map\'s *units* metadata has been set with the *r.support* +module then it will be displayed along side the legend. + +The option **title** will display the custom title at the top of the +legend. In case of vertical legend the title is aligned to the left edge +of legend, in case of horizontal legend the title is aligned to the +center. **title_fontsize** can be used to set the size of legend title. +By default the legend title font size is the same as labels font size. + +There are different options to customize displayed labels. The +**labelnum** set the number of labels which are displayed in regular +intervals. The **label_values** will specify the values where the labels +will be displayed. The **label_step** will display labels at values +which are divisible by this value. + +The flag **-t** will show ticks at labels. + +The flag **-b** will show the background. Options **bgcolor** and +**border_color** can be used to choose the color of border and +background fill. + +The flag **-l** will switch to logarithmic scale. In case this flag is +used, the provided step in **label_step** is interpreted in the +logarithmic space. + +## EXAMPLE + +Displaying the legend along with a histogram (North Carolina Sample +dataset): + +::: code + g.region raster=elevation -p + d.rast elevation + d.legend -d elevation +::: + +![Elevation map with legend](d_legend.png){border="1"} + +Displaying the legend with custom labels and background: + +::: code + g.region raster=elevation -p + d.rast elevation + d.legend raster=elevation -t label_step=20 label_values=108 title=Legend -b bgcolor=255:255:204 border_color=gray +::: + +![Elevation map with custom +legend](d_legend_custom_labels_and_background.png){border="1"} + +Displaying the legend with logarithmic scale: + +::: code + g.region raster=elevation -p + r.watershed -a elevation=elevation threshold=1000 accumulation=flowacc + d.rast flowacc + d.legend raster=flowacc -t -l label_step=1 +::: + +![Flow accumulation map with logarithmic +legend](d_legend_logarithmic.png){border="1"} + +## SEE ALSO + +*[d.barscale](d.barscale.html), [d.colortable](d.colortable.html), +[d.font](d.font.html), [d.grid](d.grid.html), [d.rast](d.rast.html), +[d.rast.leg](d.rast.leg.html), [d.text](d.text.html), +[d.vect.thematic](d.vect.thematic.html), [r.reclass](r.reclass.html), +[r.stats](r.stats.html), [r3.stats](r3.stats.html)* + +## AUTHORS + +Bill Brown, U.S. Army Construction Engineering Research Laboratories\ +Late 2002: Rewrite of much of the code. Hamish Bowman, Otago University, +New Zealand\ +Additional improvements from various authors diff --git a/display/d.linegraph/d.linegraph.md b/display/d.linegraph/d.linegraph.md new file mode 100644 index 00000000000..7a9a4666058 --- /dev/null +++ b/display/d.linegraph/d.linegraph.md @@ -0,0 +1,147 @@ +## DESCRIPTION + +*d.linegraph* is a module to draw simple x,y line graphs (plots) based +on numerical data contained in separate files. + +### Data format + +The X and Y data files for the graph are essentially a column of numbers +in each file, with one input number per line. The program expects that +each X value will have a corresponding Y value, therefore the number of +lines in each data input file should be the same. Essentially, the X +data becomes the X axis reference to which the Y data is plotted as a +line. Therefore, the X data should be a monotonically increasing +progression of numbers (i.e. \"1,2,3,\...\"; \"0, 10, 100, 1000,\...\"; +\"\...-5,-1,0,1,5\...\"). If multiple Y data files are used, the Y axis +scale will be based on the range of minimum and maximum values from all +Y files, then all Y data given will be graphed according to that Y +scale. Therefore, if multiple Y data inputs are used with dissimilar +units, the graph produced comparing the two will be deceptive. + +### File inputs + +If the **directory** option is provided, the paths to files can (and +should) be only relative paths to these files. While this is not +recommended for scripting, it can be advantageous when typing the paths +manually. For example when all files are stored in the directory +`/home/john/data`, the user can provide the following in the command +line: + +::: code + d.linegraph directory=/home/john/data x_file=x.txt y_file=y1.txt,y2.txt +::: + +### Managing colors + +The user can specify the **y_color** option, the **color_table** option +or just leave the defaults to influence the color of the plotted lines. + +Colors specified by **y_color** option are used for drawing the lines in +the graph. If multiple Y data files are used, an equal number of colors +may be used to control the colors of the lines. Colors will be assigned +to Y data in respect to the sequence of instantiation on the command +line. It can be one of GRASS GIS named colors or the RGB values from +0-255 separated by colons (RRR:GGG:BBB). + +Alternatively, the user can use the **color_table** option to specify +one of the GRASS GIS predefined color tables. + +By default, a series of colors will be chosen by the module if none are +provided upon invocation. The order of default colors is red, green, +violet, blue, orange, gray, brown, magenta, white, and indigo. The user +is advised not to rely on the order of default colors but to either use +the **y_color** or the **color_table** option to obtain predictable and +reproducible results. + +The color to be used for titles, axis lines, tics, and scale numbers is +determined by the **title_color** option. The user can provide one of +the GRASS GIS named colors (such as gray, white, or black) or use the +GRASS GIS colon-separated format for RGB (RRR:GGG:BBB). + +### Titles, labels, and tics + +The **title** option specifies the text for the title of the graph. It +will be centered over the top of graph. The **x_title** option is a text +to describe data for X axis. It will be centered beneath the graph. +Default is no text unless there is a need for a unit descriptor +determined by the *d.linegraph* module, then string such as \"in +hundreds\" is generated. The **y_title** option is a text to describe +data for Y axis. It will be centered beneath the X data description. +Similarly, to the **x_title** option, default is no text unless there is +a need for an auto-generated description. In the case of graphs with +multiple lines (multiple inputs for Y axis), user may wish to use more +specific text placement using the *[d.text](d.text.html)* or +*[v.label](v.label.html)* programs. + +## NOTES + +For historical reasons, the *d.linegraph* module accepts titles of more +than one word where the underscore character (\"\_\") is used to +represent spaces (\" \"). For example \"Census_data_1990\" would be +printed over the graph as \"Census data 1990\". The use of underscores +is not necessary to use as long as the parameter is quoted in the +command line. In general, use of underscores is not recommended and +there is no need to use it at all in the GUI or when using *d.linegraph* +in Python scripts. + +The way the program locates and labels tic marks is less than perfect:\ +1) although distances between Y tics are proportional to the value, they +are not proportional on the X axis;\ +2) decimal values between -1 and 1 can be printed on the X axis, but not +on Y. (With respect to the later, the input for Y values can all be +multiplied by a factor of 10 before graphing). + +Depending on the user\'s needs, it might be easier or more appropriate +to use a 3rd party tool such as xgraph, gnuplot, Matplotlib in Python, +or R instead of *d.linegraph*. For a more general solution for plotting +in GRASS GIS, the user is advised to use the *[d.graph](d.graph.html)* +module. + +## EXAMPLE + +The following can be executed in Bash to create the input data for this +example. The user can just create these files in a text editor, save +them and specify path to them. + +::: code + cat > x.txt < y1.txt < y2.txt <