[GRASS-dev] Re: [GRASS GIS] #7: Location wizard: should predefine
DB connection for new location
Paul Kelly
paul-grass at stjohnspoint.co.uk
Mon Feb 18 06:23:03 EST 2008
Sorry, just noticed there was a call to action by me in that bug report
which I missed. Anyway, I think the key issue here is whether or not the
database connection file is considered an essential part of a valid GRASS
location.
1. If it *is*, then creation of it should be added to the places that
crate locations: lib/init/mke_mapset.c and lib/gis/make_mapset.c.
2. If it is *not*, then the vector/db library functions that need to
access it should be updated to either gracefully fail or create default
settings on finding it absent, and this behaviour should be made
consistent in all places.
Whatever way it is, I think adding a check to it in Init.sh is an ugly
hack that just works around the problem rather than fixing it.
BUT: It seems option 1 is already partially implemented!
lib/init/mke_mapset.c (called if you create a new location using
g.setproj, or the text-based startup) does indeed create the VAR file. So
it looks to me that the anomaly is that this has been left out of
lib/gis/make_mapset.c (called if you create a new location using g.proj,
r.in.gdal or v.in.ogr or the GUI startup).
If we add creation of the VAR file to lib/gis/make_mapset.c, ideally we
should also do an audit of the vector modules and remove the functionality
that creates a default VAR file if not present, as it will no longer be
needed. What do you think of this solution, Hamish?
Paul
More information about the grass-dev
mailing list