[GRASS5] Re: [GRASSLIST:8620] Re: GRASS, gdal and mapserver

Francisco Alonso alonsarp at um.es
Thu Oct 13 14:56:03 EDT 2005


> On 10/13/05, Francisco Alonso <alonsarp at um.es> wrote:
> > El Viernes, 14 de Octubre de 2005 10:25, Radim Blazek escribió:
> > > On 10/12/05, Francisco Alonso <alonsarp at um.es> wrote:
> > > > # ogrinfo
> > > > /var/www/grass5_mapserver/spearfish60/PERMANENT/vector/streams/head
> > > > Warning 1: GRASS warning: GISBASE enviroment variable was not set,
> > > > using: /usr/local/grass-6.0.1
> > > > ogrinfo: relocation error: /usr/local/lib/gdalplugins/ogr_GRASS.so:
> > > > undefined symbol: Vect_set_fatal_error
> > >

Ok I have it.

After realizing that 

# ldd ogr_GRASS.so  

didn't mention the grass vector library I remembered that I had linked just 
the grass libraries needed by gdal. On the other hand the makefile I obtained 
with:

./configure --with-gdal=/usr/local/bin/gdal-config 
--with-grass=/usr/local/grass-6.0.1

doesn't include any -lgrass_vect, so I put it myself just to try.

After that ldd ogr_GRASS .so did complain about libgrass_vect. I linked it, 
and after some more links and incluiding -lgrass_dbmidriver in the LIBS line 
of the Makefile I have ogrinfo working properly:

# ogrinfo /var/www/grass5_mapserver/spearfish60/PERMANENT/vector/streams/head
Warning 1: GRASS warning: GISBASE enviroment variable was not set, using:
/usr/local/grass-6.0.1
INFO: Open of 
`/var/www/grass5_mapserver/spearfish60/PERMANENT/vector/streams/head'
using driver `GRASS' successful.
1: 0
2: 1

Thanks a lot for your suggestions.

I am still working on my other problem (mapserver not showing GRASS raster 
files that gdal can read)

I tried to gdal_translate the spearfish soils layer to pcraster and reading it 
with mapserver (ugly colours but it worked) so it seem that grass-gdal 
connection works and mapserver-gdal also works. 

And now I have changed the roads layer definition in the map file to read the 
roads grass layer instead of shape (I'm workig with spearfish demo):

LAYER
  NAME roads
  TYPE LINE
  STATUS DEFAULT
  DATA /var/www/grass5_mapserver/spearfish60/PERMANENT/vector/roads/head
  TOLERANCE 5
  LABELITEM CAT_ID
  TEMPLATE /var/www/grass5_mapserver/spearfish/roads.html
#  OFFSITE 0
  CLASS
    NAME "Road"
    COLOR 80 80 80
    LABEL
      POSITION CC
      SIZE SMALL
      COLOR 0 0 225
    END
  END
END

but  I have a prettty similar error message

# /usr/local/mapserver-4.6.1/shp2img -m 
/var/www/grass5_mapserver/map-script/mapserver.map -o mapa.png

msDrawMap(): Image handling error. Failed to draw layer named 'roads'. <br>
msSHPOpenFile(): Unable to access file. 
(/var/www/grass5_mapserver/spearfish60/PERMANENT/vector/roads/head) <br>
msSHPOpenFile(): Unable to access file. 
(/var/www/grass5_mapserver/spearfish60/PERMANENT/vector/roads/head) <br>

but the file DO exist, do I need to specify in any way that it is a GRASS 
file?

Do you know where you can download the files of the demo 2 accesible from 
http://grass.itc.it/start.html ?

I will continue trying, but if anyone has suggestions ....

Paco

-- 
Francisco Alonso Sarría
Departamento de Geografía (Area de Geografía Física)
Universidad de Murcia. Campus La Merced
E-30001 Murcia
Telfn: +34 968364357
www.um.es/geograf/sigmur




More information about the grass-dev mailing list