[GRASS-dev] r.unpack: unhelpful error message when projection info does not match
Markus Neteler
neteler at osgeo.org
Wed Oct 9 15:08:24 PDT 2013
Hi,
the error (example UTM map import into LAEA location):
r.unpack landcover_1m.pack
ERROR: Projection information does not match. Aborting.
is rather unhelpful. The code is:
# check projection compatibility in a rather crappy way
if not grass.compare_key_value_text_files('PROJ_INFO',
os.path.join(mset_dir, '..', 'PERMANENT', 'PROJ_INFO')) or \
not grass.compare_key_value_text_files('PROJ_UNITS',
os.path.join(mset_dir, '..', 'PERMANENT', 'PROJ_UNITS')):
if flags['o']:
grass.warning(_("Projection information does not match.
Proceeding..."))
else:
grass.fatal(_("Projection information does not match. Aborting."))
I would suggest to print a "diff -u file1 file2" rather than nothing
as now (perhaps Python offers a nice way to show the wrong keys to the
user).
Or are there other options?
Markus
More information about the grass-dev
mailing list