[GRASS-dev] v.buffer don't write metadata and v.info cut comments

Hi all,

I would like to add a comment in the metadata of a generated vector
map but the content is shortened. I'm in the NorthCarolina mapset,
from an ipython shell:

{{{
In [1]: !v.buffer --overwrite input=busroute6@PERMANENT
output=buff__busroute6 distance=10

In [2]: !v.info buff__busroute6
+----------------------------------------------------------------------------+
| Name: buff__busroute6 |
| Mapset: user1 |
| Location: nc_spm_08_grass7 |
| Database: /home/pietro/docdat/gis/ |
| Title: NC State University bus service Wolfline route 6 (lines m |
| Map scale: 1:1 |
| Name of creator: helena |
| Organization: NC OneMap |
| Source date: Thu Mar 15 23:35:50 2007 |
| Timestamp (first layer): none |
|----------------------------------------------------------------------------|
| Map format: native |
|----------------------------------------------------------------------------|
| Type of map: vector (level: 2) |
| |
| Number of points: 0 Number of centroids: 1 |
| Number of lines: 0 Number of boundaries: 36 |
| Number of areas: 4 Number of islands: 4 |
| |
| Map is 3D: No |
| Number of dblinks: 0 |
| |
| Projection: Lambert Conformal Conic |
| |
| N: 227741.05646361 S: 226151.51091547 |
| E: 639360.09470206 W: 635143.56812813 |
| |
| Digitization threshold: 0 |
| Comment: |
| |
+----------------------------------------------------------------------------+
}}}

The command that generate the map is missing!
Should I open a ticket on v.buffer?

Let's add the command manually:

{{{
In [3]: from grass.pygrass.vector import VectorTopo

In [4]: with VectorTopo('buff__busroute6') as buff:
   ....: buff.comment = 'v.buffer --overwrite
input=busroute6@PERMANENT output=buff__busroute6 distance=10'
   ....: buff.write_header()
   ....:

In [5]: !v.info buff__busroute6
+----------------------------------------------------------------------------+
| Name: buff__busroute6 |
| Mapset: user1 |
| Location: nc_spm_08_grass7 |
| Database: /home/pietro/docdat/gis/ |
| Title: NC State University bus service Wolfline route 6 (lines m |
| Map scale: 1:1 |
| Name of creator: helena |
| Organization: NC OneMap |
| Source date: Thu Mar 15 23:35:50 2007 |
| Timestamp (first layer): none |
|----------------------------------------------------------------------------|
| Map format: native |
|----------------------------------------------------------------------------|
| Type of map: vector (level: 2) |
| |
| Number of points: 0 Number of centroids: 1 |
| Number of lines: 0 Number of boundaries: 36 |
| Number of areas: 4 Number of islands: 4 |
| |
| Map is 3D: No |
| Number of dblinks: 0 |
| |
| Projection: Lambert Conformal Conic |
| |
| N: 227741.05646361 S: 226151.51091547 |
| E: 639360.09470206 W: 635143.56812813 |
| |
| Digitization threshold: 0 |
| Comment: |
| v.buffer --overwrite input=busroute6@PERMANENT output=buff__busroute6 |
+----------------------------------------------------------------------------+
}}}

As you can see the Comment string is shortened...
but in the header file is written correctly:

{{{
In [6]: !cat /nc_spm_08_grass7/user1/vector/buff__busroute6/head
ORGANIZATION: NC OneMap
DIGIT DATE: Mar 16 7
DIGIT NAME: helena
MAP NAME: NC State University bus service Wolfline route 6 (lines map)
MAP DATE: Thu Mar 15 23:35:50 2007
MAP SCALE: 1
OTHER INFO: v.buffer --overwrite input=busroute6@PERMANENT
output=buff__busroute6 distance=10
PROJ: 99
ZONE: 0
MAP THRESH: 0.000000
}}}

Instead the raster equivalent: r.info it is able to handle a long line.

{{{
In [11]: !r.info elevation
+----------------------------------------------------------------------------+
| Map: elevation Date: Tue Nov 7 01:09:51 2006 |
| Mapset: PERMANENT Login of Creator: helena |
| Location: nc_spm_08_grass7 |
| DataBase: /home/pietro/docdat/gis/ |
| Title: South-West Wake county: Elevation NED 10m ( elev_ned10m ) |
| Timestamp: none |
|----------------------------------------------------------------------------|
| |
| Type of Map: raster Number of Categories: 255 |
| Data Type: FCELL |
| Rows: 1350 |
| Columns: 1500 |
| Total Cells: 2025000 |
| Projection: Lambert Conformal Conic |
| N: 228500 S: 215000 Res: 10 |
| E: 645000 W: 630000 Res: 10 |
| Range of data: min = 55.57879 max = 156.3299 |
| |
| Data Description: |
| generated by r.proj |
| |
| Comments: |
| r.proj input="ned03arcsec" location="northcarolina_latlong" mapset="\ |
| helena" output="elev_ned10m" method="cubic" resolution=10 |
| |
+----------------------------------------------------------------------------+
}}}

should I open a bug on this?

Best regards

Pietro

Hi,

2014-12-16 12:30 GMT+01:00 Pietro <peter.zamb@gmail.com>:

The command that generate the map is missing!

it's not missing. You need to use '-h' flag to print history of commands.

Yes, r.info and v.info are inconsistent in printing history of commands.

Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

On Tue, Dec 16, 2014 at 12:30 PM, Pietro <peter.zamb@gmail.com> wrote:

Hi all,

I would like to add a comment in the metadata of a generated vector
map but the content is shortened. I'm in the NorthCarolina mapset,
from an ipython shell:

[...]

The command that generate the map is missing!

You can get the command with v.info -h.

For vector maps, the command (together with all previous commands used
to generate the map) is stored separately, not as a comment.

Should I open a ticket on v.buffer?

No, this applies to all modules that create a vector: the command is
stored as command, not comment.
[...]

As you can see the Comment string is shortened...
but in the header file is written correctly:

[...]

Instead the raster equivalent: r.info it is able to handle a long line.

The raster library splits comments longer than 68 chars into separate lines.

[...]

should I open a bug on this?

Yes, as a fix for v.info. Should long lines be broken up by the module
or just printed out as is?

For historical reasons, the handling of metadata differs between
raster and vector maps. At some stage, this should be synchronized,
e.g. raster maps should also have a history and vector maps should
support multi-line comments.

Markus M

Hi,

2014-12-16 14:28 GMT+01:00 Markus Metz <markus.metz.giswork@gmail.com>:

raster and vector maps. At some stage, this should be synchronized,
e.g. raster maps should also have a history and vector maps should
support multi-line comments.

yes, I would say topic for G8. Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa