On Thu, 13 Mar 2008, GRASS GIS wrote:

for 6.3.0 I have re-enabled automatic VAR creation if it doesn't exist.


more soon.....

Attached is a patch (completely untested) that illustrates my idea for solving the problem. I think there should also be something in lib/gis/make_mapset.c (used by g.mapsets) but there are some complications there in relation to inheriting the DB settings; see my earlier mail.

Paul
Index: lib/gis/make_loc.c
===================================================================
--- lib/gis/make_loc.c	(revision 29515)
+++ lib/gis/make_loc.c	(working copy)
@@ -48,7 +48,7 @@
     FILE *report_file )
 
 {
-    char	path[2048];
+    char	path[GPATH_MAX];
     int         out_stat;
 
     /* Try to create the location directory, under the gisdbase. */
@@ -69,6 +69,19 @@
     G__put_window( wind, "", "DEFAULT_WIND" );
     G__put_window( wind, "", "WIND" );
 
+    /* Create database settings file */
+    {
+        struct Key_Value *dbsettings = G_create_key_value();
+       
+        G_set_key_value("DB_DRIVER", "dbf", dbsettings);
+        G_set_key_value("DB_DATABASE", "$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/", dbsettings);
+        G__file_name( path, "", "VAR", "PERMANENT" );
+        G_write_key_value_file( path, proj_info, &out_stat );
+        if( out_stat != 0 )
+            return -1;
+        G_free_key_value(dbsettings);
+    }
+   
     /* Write out the PROJ_INFO, and PROJ_UNITS if available. */
     if( proj_info != NULL )
     {
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to