Re: [GRASS-user] Database driver problem

2009-10-06 Thread Markus Neteler
On Tue, Oct 6, 2009 at 1:37 AM, Glynn Clements gl...@gclements.plus.com wrote:
 Markus Neteler wrote:
...
 Is this a harmless change? then I would submit it... otherwise it
 will take years to figure this out unless someone actually compiles
 and *tests* on Windows...
 Submitting it would get it at least into the next test compilation.

 I suggest committing it.

Done. So we'll just sit and wait for a volunteer to compile a new version
of winGRASS 6.4.0svn (http://trac.osgeo.org/grass/wiki/CompileOnWindows)...

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-10-05 Thread Markus Neteler
On Thu, Oct 1, 2009 at 7:31 PM, Glynn Clements gl...@gclements.plus.com wrote:

 Markus Neteler wrote:

  I've tried importing the spearfish_contours files via File--Import Vector
  Map--Multiple Formats Using OGR and get this message
 
  Invalid argument: can't _spawnl
  Unable to start driver sqlite

 Could the problem be that \ and / slashes are used?

 Quite possibly. Try this:

 --- lib/db/dbmi_base/dbmscap.c  (revision 39364)
 +++ lib/db/dbmi_base/dbmscap.c  (working copy)
 @@ -175,6 +175,7 @@
        dirpath = G_malloc(strlen(\\\driver\\db\\\)
                           + strlen(G_gisbase()) + strlen(ent-d_name) + 1);
        sprintf(dirpath, \%s\\driver\\db\\%s\, G_gisbase(), ent-d_name);
 +       G_convert_dirseps_to_host(dirpath);
  #else
        G_asprintf(dirpath, \%s/driver/db/%s\, G_gisbase(), ent-d_name);
  #endif

Is this a harmless change? then I would submit it... otherwise it
will take years to figure this out unless someone actually compiles
and *tests* on Windows...
Submitting it would get it at least into the next test compilation.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-10-05 Thread Erik lash

I installed a previous version R38537-1 and attempted the exact same
connection as before under the exact same conditions. The connection was
successful and returned the correct values with the previous install where
as it returns errors under the current install. 

Something has changed between 38537-1 and 39271-1 in a manner that breaks
the ability of the software to connect to dbfs. 

-Erik

-- 
View this message in context: 
http://n2.nabble.com/Database-driver-problem-tp3720138p3767711.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-10-05 Thread Glynn Clements

Markus Neteler wrote:

  Could the problem be that \ and / slashes are used?
 
  Quite possibly. Try this:
 
  --- lib/db/dbmi_base/dbmscap.c  (revision 39364)
  +++ lib/db/dbmi_base/dbmscap.c  (working copy)
  @@ -175,6 +175,7 @@
         dirpath = G_malloc(strlen(\\\driver\\db\\\)
                            + strlen(G_gisbase()) + strlen(ent-d_name) + 1);
         sprintf(dirpath, \%s\\driver\\db\\%s\, G_gisbase(), ent-d_name);
  +       G_convert_dirseps_to_host(dirpath);
   #else
         G_asprintf(dirpath, \%s/driver/db/%s\, G_gisbase(), 
  ent-d_name);
   #endif
 
 Is this a harmless change? then I would submit it... otherwise it
 will take years to figure this out unless someone actually compiles
 and *tests* on Windows...
 Submitting it would get it at least into the next test compilation.

I suggest committing it. As it stands, dirpath will contain a mix of
forward slashes and backslashes, which is the worst possible case
(there are two ways that it could break).

In the longer term, we should really try to get rid of forward slashes
on Windows altogether, rather than fixing the individual cases where
they don't work.

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-10-02 Thread Glynn Clements

Hamish wrote:

 should this be using G_spawn() not _spawnl() now that we have a few
 G_spawn() options to choose from?

No. G_spawn() uses the _P_WAIT flag, while the DBMI requires
_P_NOWAIT.

G_spawn_ex() supports background processes, but it doesn't support
redirecting descriptors on Windows. The only way to fix that is to
re-write it to use CreateProcess() rather than spawnvpe(); Python's
subprocess module would probably be a useful source of clues.

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-10-01 Thread Glynn Clements

Markus Neteler wrote:

  I've tried importing the spearfish_contours files via File--Import Vector
  Map--Multiple Formats Using OGR and get this message
 
  Invalid argument: can't _spawnl
  Unable to start driver sqlite

 Could the problem be that \ and / slashes are used?

Quite possibly. Try this:

--- lib/db/dbmi_base/dbmscap.c  (revision 39364)
+++ lib/db/dbmi_base/dbmscap.c  (working copy)
@@ -175,6 +175,7 @@
dirpath = G_malloc(strlen(\\\driver\\db\\\)
   + strlen(G_gisbase()) + strlen(ent-d_name) + 1);
sprintf(dirpath, \%s\\driver\\db\\%s\, G_gisbase(), ent-d_name);
+   G_convert_dirseps_to_host(dirpath);
 #else
G_asprintf(dirpath, \%s/driver/db/%s\, G_gisbase(), ent-d_name);
 #endif

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-10-01 Thread Hamish
Hi all,   [lunchtime; office PC hijacked for testing]

   I've tried importing the spearfish_contours files via File--Import
   Vector Map--Multiple Formats Using OGR and get this message
  
   Invalid argument: can't _spawnl
   Unable to start driver sqlite
 Markus Neteler wrote:
  Could the problem be that \ and / slashes are used?
Glynn: 
 Quite possibly. Try this:
...
 +G_convert_dirseps_to_host(dirpath);

I just tested this with the latest native installer and can reproduce
it in both the wx and tcl GUIs.  (WinGRASS-6.4.0SVN-r39271-1-Setup.exe)

but I first ran v.buffer on ro...@perm and made a map in the local
mapset. I could query the roads_b...@user1 map ok, just not the ro...@perm
one in the non-current mapset, there I get a similar error but for dbf not
sqlite. For the local map I see the correct data output.

$GISDBASE is in C:\Documents and Settings\me\My Documents\GIS Database\
spearfish60\  or something like that with lots of spaces.

should this be using G_spawn() not _spawnl() now that we have a few
G_spawn() options to choose from?



Hamish

ps- the tcltk gui complains that it can't find the fontcap file, and
Font Selection from the config menu ends with a non-fatal tcltk error.




___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-09-28 Thread Maris Nartiss
Unfortunatly GRASS has no Windows developers. Developers use Linux or
Mac and not windows and thus fixing Windows specific bugs is hard.

I have attached patch to ticket where such problem is described.
http://trac.osgeo.org/grass/ticket/629
Please, apply patch to GRASS 6.4/5, recompile and run with DEBUG=1.
Post Your results to ticket.

Thanks,
Maris.


2009/9/27, grassyjohn jf_wa...@hotmail.com:

 I've tried importing the spearfish_contours files via File--Import Vector
 Map--Multiple Formats Using OGR and get this message

 Invalid argument: can't _spawnl
 Unable to start driver sqlite

 Unable open database
 D:/GIS_DataBase/Spearfish60/user1/dbf/spearfish_contours.db by driver
 sqlite

 I've tried using dbf and ogr database drivers but the result is the same.

 I'm using GRASS 6.4 on Windows XP.  Has anyone come across the problem?
 --
 View this message in context:
 http://n2.nabble.com/Database-driver-problem-tp3720138p3720138.html
 Sent from the Grass - Users mailing list archive at Nabble.com.
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-09-28 Thread grassyjohn

Thanks for the tip but I've no idea of how to re-compile .  Can this be
done from within the software or do I need to use something like Dev C++?

I have a box running on Vector Linux so I may just install on there instead.


Maris Nartiss wrote:
 
 Unfortunatly GRASS has no Windows developers. Developers use Linux or
 Mac and not windows and thus fixing Windows specific bugs is hard.
 
 I have attached patch to ticket where such problem is described.
 http://trac.osgeo.org/grass/ticket/629
 Please, apply patch to GRASS 6.4/5, recompile and run with DEBUG=1.
 Post Your results to ticket.
 
 Thanks,
 Maris.
 
 
 2009/9/27, grassyjohn jf_wa...@hotmail.com:

 I've tried importing the spearfish_contours files via File--Import
 Vector
 Map--Multiple Formats Using OGR and get this message

 Invalid argument: can't _spawnl
 Unable to start driver sqlite

 Unable open database
 D:/GIS_DataBase/Spearfish60/user1/dbf/spearfish_contours.db by driver
 sqlite

 I've tried using dbf and ogr database drivers but the result is the same.

 I'm using GRASS 6.4 on Windows XP.  Has anyone come across the problem?
 --
 View this message in context:
 http://n2.nabble.com/Database-driver-problem-tp3720138p3720138.html
 Sent from the Grass - Users mailing list archive at Nabble.com.
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user
 
 

-- 
View this message in context: 
http://n2.nabble.com/Database-driver-problem-tp3720138p3728795.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-09-28 Thread Hamish
grassyjohn wrote:

 Thanks for the tip but I've no idea of how to re-compile
 .  Can this be
 done from within the software or do I need to use something
 like Dev C++?

if you use the latest native windows installer the patch should already
be applied. (WinGRASS-6.4.0SVN-r39271-1-Setup.exe   21 Sept 2009)

if you are using that version and it still breaks, we'd like to hear
about it.

 I have a box running on Vector Linux so I may just install
 on there instead.

that'll work too.


Hamish




___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-09-28 Thread Hamish
Maris wrote:
 I have attached patch to ticket where such problem is
 described.
 http://trac.osgeo.org/grass/ticket/629
 Please, apply patch to GRASS 6.4/5, recompile and run with
 DEBUG=1.
 Post Your results to ticket.

sorry I just noticed that was a brand new patch in the tracker today,
it won't be in last week's binary.


Hamish




___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-09-28 Thread Maris Nartiss
Also previous patch should not be commited to anywhere. I just want to
know (get info) what's going on when db spawn call fails. If somebody
can recompile with that tickets patch and then post results to trac,
we may get an idea what's failing. I suspect forward vs backward
slashes issue. Still without exact info it's hard to tell. Also unless
somebody is going to test various patches/ticket fixes on windows,
windows version will suck hard (die, die!).

Maris (revorking bits in ogsf).


2009/9/28, Hamish hamis...@yahoo.com:
 Maris wrote:
 I have attached patch to ticket where such problem is
 described.
 http://trac.osgeo.org/grass/ticket/629
 Please, apply patch to GRASS 6.4/5, recompile and run with
 DEBUG=1.
 Post Your results to ticket.

 sorry I just noticed that was a brand new patch in the tracker today,
 it won't be in last week's binary.


 Hamish





___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Database driver problem

2009-09-28 Thread grassyjohn

Hamish wrote:

if you use the latest native windows installer the patch should already
be applied. (WinGRASS-6.4.0SVN-r39271-1-Setup.exe   21 Sept 2009)

if you are using that version and it still breaks, we'd like to hear
about it.

I did use the latest installer on XP.  If I am importing ESRI files and the
corresponding dbf file, does it matter where I put them as long as I select
the correct paths to the files in the dialogs?



___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user



-- 
View this message in context: 
http://n2.nabble.com/Database-driver-problem-tp3720138p3732043.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user