[GRASS-user] ogr-grass

Stephan Holl holl at gdf-hannover.de
Mon Jul 3 15:09:32 EDT 2006


Hello Paolo, 

On Mon, 03 Jul 2006 18:43:04 +0200 Paolo Cavallini
<cavallini at faunalia.it> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Further testing.
> Now www-data can do whatherver with ogr, eg.

Did you use SetEnv HOME for www-data?

> ogrinfo -so -where atc_num=13
> /home/Documenti/datigrass/Toscana/PERMANENT/vector/t_comuni_2003/head
> 1
> 
> gives:
> 
> Layer name: 1
> Geometry: Polygon
> Feature Count: 18
> Extent: (1554732.664063, 4678313.000000) - (1771665.406250,
> 4924775.960937) Layer SRS WKT:
> PROJCS["Transverse Mercator",
>     GEOGCS["international",
>         DATUM["Monte_Mario",
> ...
> 
> but if we use a string, eg
> ogrinfo -so -where nomemin='lucca'
> /home/Documenti/datigrass/Toscana/PERMANENT/vector/t_comuni_2003/head
> 1
> 
> we get:
> 
> Warning 1: GRASS warning: GISBASE enviroment variable was not set,
> using: /usr/lib/grass
> INFO: Open of
> `/home/Documenti/datigrass/Toscana/PERMANENT/vector/t_comuni_2003/head'
> using driver `GRASS' successful.
> DBMI-Postgres driver error:
> Cannot select:
> SELECT * FROM t_comuni_2003 WHERE nomemin=lucca ORDER BY cat
> ERROR:  la colonna "lucca" non esiste

AFAIK this should be 
SELECT * FROM t_comuni_2003 WHERE nomemin='lucca' ORDER BY
cat;

assuming column nomein is a varchar/char column.
So probably a bug in GRASS postgres implementation?!

> 
> ERROR 1: Cannot open cursor.
> 
> Layer name: 1
> Geometry: Polygon
> Feature Count: 313
> Extent: (1554732.664063, 4678313.000000) - (1771665.406250,
> 4924775.960937) Layer SRS WKT:
> PROJCS["Transverse Mercator",
>     GEOGCS["international",
>         DATUM["Monte_Mario",
> ...
> 
> as we can see, there is an error with the database connection
> (possibly due to the removal of ' ?)
> 
> Maybe related to this, mapserver cannot connect to the DB; grass
> layers are loaded and shown, but if we try connecting to PostgreSQL
> (e.g. LABELITEM, EXPRESSION...) we get an errore:

I think this is because of the missing ''-signs in the SQL-querry.
Have you inverstigated the Postgresql-driver-bindings in the sources
where the SQL is generated?

> 
> [Mon Jul 03 18:15:45 2006] [error] [client 192.168.0.110] PHP Warning:
> [MapServer Error]: msDrawMap(): Failed to draw layer named
> 'grass_POSTGRES'. \n
> in /home/Documenti/pub/prove_w/visuo_map_file.php on line 6 [Mon Jul
> 03 18:15:45 2006] [error] [client 192.168.0.110] PHP Warning:
> [MapServer Error]: msOGRLayerInitItemInfo(): Invalid Field name:
> atc_num\n in /home/Documenti/pub/prove_w/visuo_map_file.php on line 6
> [Mon Jul 03 18:15:45 2006] [error] [client 192.168.0.110] PHP Fatal
> error: Call to a member function on a non-object
> in /home/Documenti/pub/prove_w/visuo_map_file.php on line 8

[...]

> 
> Quite frustrating.

Yes, I can imagine. Hope this will be sorted out soon.

Best regards

	Stephan

> 
> 
> Stephan Holl wrote:
> > Hello Paolo,
> > 
> > On Fri, 30 Jun 2006 10:24:14 +0200 Paolo Cavallini
> > <cavallini at faunalia.it> wrote:
> > 
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Hi Stephen.
> >> In fact, www-data accesses the db; it does not seem able to use the
> >> .grasslogin6.
> >> Anybody has a hint?
> >> Many thanks.
> >> pc
> > 
> > have you set the HOME variable for user www-data using apaches
> > SetEnv-stuff in apache.conf?
> > 
> > Perhaps this might help?
> > 
> > Best
> > 	Stephan
> > 
> 
> - --
> Paolo Cavallini
> email+jabber: cavallini at faunalia.it
> www.faunalia.it
> Piazza Garibaldi 5 - 56025 Pontedera (PI), Italy   Tel:
> (+39)348-3801953 -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFEqUkX/NedwLUzIr4RAv2/AKCBoWG4XqLBfhudIyZslfxbZofeIgCeOLGP
> p8sZMWAUtjgTGlBND8PYoZ0=
> =nY2N
> -----END PGP SIGNATURE-----


-- 
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office      -     Mengendamm 16d      -     D-30177 Hannover
Internet: www.gdf-hannover.de      -      Email: holl at gdf-hannover.de
Phone : ++49-(0)511.39088507       -        Fax: ++49-(0)511.39088508




More information about the grass-user mailing list