[GRASS-dev] r.unpack: unhelpful error message when projection info does not match

Luca Delucchi lucadeluge at gmail.com
Thu Feb 27 02:32:48 PST 2014


On 26 February 2014 18:04, Markus Neteler <neteler at osgeo.org> wrote:

Hi all

> ... back to this topic, I would be happy to find a solution for US vs
> UK English:
>
> GRASS 7.0.svn (patUTM32):~ > r.unpack x60030_2000.green.histo2000_g.pack
> WARNING: Difference between PROJ_INFO file of packed map and of current
>          location:
>          - name: Universal Transverse Mercator
>          ? ^^
>          + name: Universe Transverse Mercator
>          ? ^
>          proj: utm
>          datum: wgs84
>          ellps: wgs84
>          zone: 32
>          no_defs: defined
> WARNING: Difference between PROJ_UNITS file of packed map and of current
>          location:
>          - unit: metre
>          ? -
>          + unit: meter
>          ? +
>          - units: metres
>          ? -
>          + units: meters
>          ? +
>          meters: 1
> ERROR: Projection information does not match. Aborting.
>
> r.unpack calls the Python core function compare_key_value_text_files()
> http://grass.osgeo.org/programming7/namespacepython_1_1script_1_1core.html#a3ad1670d5f7b4759935d4b38292fa7af
> and then does the comparison key by key (so, it fails here).
>
> I think that we need to polish the language differences in r.unpack
> prior to the comparison. Maybe via lookup dictionary which can be
> expanded in future when more cases come up?
>
> Universe Transverse Mercator --> Universal Transverse Mercator
> metre --> meter
> metres --> meters
> kilometre --> kilometre
> kilometres --> kilometres
>
> See also the corresponding C functions:
> http://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/proj3.c?rev=58633#L48
>
> The same fix would then be needed in v.unpack.
>
> ?

I solved the problem for units and projection system in r59147.
The is stil a bug in compare_key_value_text_files because if second
file has more keys this is not recognize.
I would like to add at line 913 this:

if dict_a.keys() != dict_b.keys():
    return False

but this could broke all the system of compare_key_value_text_files function
what do you think?

> Markus
>

-- 
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org


More information about the grass-dev mailing list