[GRASS-dev] v.info: projection info wrong

Markus Metz markus.metz.giswork at googlemail.com
Sat Jan 21 13:50:29 EST 2012


On Sat, Jan 21, 2012 at 7:31 PM, Markus Neteler <neteler at osgeo.org> wrote:
> GRASS 6.4.2svn (piemonte_utm32_wgs84):/grassdata > v.info beni_urbanistici
>  +----------------------------------------------------------------------------+
>  | Layer:           beni_urbanistici                                          |
>  | Mapset:          PERMANENT                                                 |
>  | Location:        piemonte_utm32_wgs84                                      |
> ...
>  | Source date:     Sat Jan 21 19:09:31 2012                                  |
>  |----------------------------------------------------------------------------|
>  |   Type of Map:  vector (level: 2)                                          |
>  |                                                                            |
>  |   Number of points:       7990            Number of areas:      0          |
> ...
>  |   Number of dblinks:      1                                                |
>  |                                                                            |
>  |         Projection: x,y (zone 0)                                           |
>  |               N:  5141441.38439781    S:   4881740.8577152                 |
>  |               E:   514815.51117203    W:   317192.39544124                 |
>  |                                                                            |
> ...
>
> -->  x,y (zone 0)?
>
> GRASS 6.4.2svn (piemonte_utm32_wgs84):/grassdata > g.region -p
> projection: 1 (UTM)
> zone:       32
> datum:      wgs84
> ellipsoid:  wgs84
>
> The code chunk is
>
> v.info/main.c:
>            /* this differs from r.info in that proj info IS taken
> from the map here, not the location settings */
>            /* Vect_get_proj_name() and _zone() are typically unset?! */
>            if (G_projection() == PROJECTION_UTM)
>                sprintf(line, _("        Projection: %s (zone %d)"),
>                        Vect_get_proj_name(&Map), Vect_get_zone(&Map));
>            else
>                sprintf(line, _("        Projection: %s"),
>                        Vect_get_proj_name(&Map));
>
> Any ideas why this fails?

Yes, because "Vect_get_proj_name() and _zone() are typically unset?!"
(see above). This (Vect_[get|set]_proj_name()) is weird because a
vector's projection can hardly be different from the location's
projection, and Vect_set_proj_name() has no effect. I would suggest to
replace the corresponding parts in v.info with
G_database_projection_name() and G_zone(), as used in r.info.

Markus M


More information about the grass-dev mailing list