Skip to content

Commit

Permalink
v.info: Rename location to project in outputs (#3133)
Browse files Browse the repository at this point in the history
- Translatable plain text output now generates "Project" instead of "Location".
- Extended shell-style output now generates "project=" in addtion to "location=".
- Examples in documentation now show project only.
- History continues using LOCATION because history file is printed as is and the parsing rules applied to it are unclear, so consequences of adding a new key there are not clear to me.
  • Loading branch information
wenzeslaus committed Mar 22, 2024
1 parent b3bd795 commit 553f861
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion vector/v.info/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ void print_shell(struct Map_info *Map, const char *field_opt)
fprintf(stdout, "name=%s\n", Vect_get_name(Map));
fprintf(stdout, "mapset=%s\n", Vect_get_mapset(Map));
fprintf(stdout, "location=%s\n", G_location());
fprintf(stdout, "project=%s\n", G_location());
fprintf(stdout, "database=%s\n", G_gisdbase());
fprintf(stdout, "title=%s\n", Vect_get_map_name(Map));
fprintf(stdout, "scale=1:%d\n", Vect_get_scale(Map));
Expand Down Expand Up @@ -302,7 +303,7 @@ void print_info(struct Map_info *Map)
G_saprintf(line, "%-17s%s", _("Mapset:"), Vect_get_mapset(Map));
printline(line);

G_saprintf(line, "%-17s%s", _("Location:"), G_location());
G_saprintf(line, "%-17s%s", _("Project:"), G_location());
printline(line);
G_saprintf(line, "%-17s%s", _("Database:"), G_gisdbase());
printline(line);
Expand Down
8 changes: 6 additions & 2 deletions vector/v.info/v.info.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h3>Basic metadata information</h3>
+----------------------------------------------------------------------------+
| Name: geology |
| Mapset: PERMANENT |
| Location: nc_spm_08 |
| Project: nc_spm_08 |
| Database: /home/martin/grassdata |
| Title: North Carolina geology map (polygon map) |
| Map scale: 1:1 |
Expand Down Expand Up @@ -68,6 +68,10 @@ <h3>Map history</h3>
---------------------------------------------------------------------------------
</pre></div>

Note that while "project" is used by <em>v.info</em> elsewhere, history output
uses the legacy term "location" because "LOCATION" is currently a part of the
native vector format.

<h3>Attribute columns for given layer</h3>

<div class="code"><pre>
Expand All @@ -91,7 +95,7 @@ <h3>Basic metadata information in shell script style</h3>

name=geology
mapset=PERMANENT
location=nc_spm_08
project=nc_spm_08
database=/home/martin/grassdata
title=North Carolina geology map (polygon map)
scale=1:1
Expand Down

0 comments on commit 553f861

Please sign in to comment.