[GRASS-dev] GDAL,GRASS 7 and PostGIS on Ubunutu 12.04

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Thu Dec 12 01:33:23 PST 2013


Hi Markus

Thanks for your feedback.

I had read ticket #2953 and found it a bit confusing in that sense that Martin modified GDAL (and not the plugin). The plugin (on http://download.osgeo.org/gdal/) was last modified 05-Aug-2007. To me it seems that GDAL is now (with Martins fixes in place) using a mixture of GRASS 6 and 7 libs. GDAL itself does not complain (if both GRASS versions can be found) but raster2pgsql does (and maybe OGR would as well)...

libgrass_I.so is GRASS 6 specific right? So after I compiled GDAL (not the plugin) against GRASS 7 it should not use that library at all?
And the message that the GISBASE /usr/local/grass-7.0.svn was used (see below) indicates that GDAL somehow operates based on GRASS 7.

So I went back to GRASS 6 support in GDAL (which is OK for raster data).

Out of curiosity I copied this section:
  AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_raster -lgrass_imagery -lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase  -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime)
  
   if test "$GRASS_SETTING" != "no" ; then
    if test "$GRASS_SETTING" = "grass70+" ; then
      G_RASTLIBS="-lgrass_raster -lgrass_imagery"
      G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
    else
      G_RASTLIBS="-lgrass_I"
      G_VECTLIBS="-lgrass_vect -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
    fi
    GRASS_INCLUDE="-I$with_grass/include"
    GRASS_GISBASE="$with_grass"
    HAVE_GRASS=yes

>From GDALs configure to the configure.in in the plugin. Then , after "autoreconf --force --install" the plugin compiles using GRASS 7. However "make" of course still references grass57+ code...
 
Looks like both GDAL and the GRASS-GDAL plugin need some update...

Shall I add an error-report to ticket #2953?

Cheers
Stefan



-----Original Message-----
From: neteler.osgeo at gmail.com [mailto:neteler.osgeo at gmail.com] On Behalf Of Markus Neteler
Sent: 11. desember 2013 15:18
To: Blumentrath, Stefan
Cc: grass-dev at lists.osgeo.org
Subject: Re: [GRASS-dev] GDAL,GRASS 7 and PostGIS on Ubunutu 12.04

On Wed, Dec 11, 2013 at 12:26 PM, Blumentrath, Stefan <Stefan.Blumentrath at nina.no> wrote:
> Dear all,
>
> Do not know if this post belongs here or to PostGIS:
> I compiled GDAL (rev 26701) with support for GRASS 7 (not the plugin but recompiled GDAL with GRASS support after building GRASS 7 from source (rev 58438)).

I don't think that GDAL is already compliant with GRASS 7:
See http://trac.osgeo.org/gdal/ticket/2953


> /usr/local/grass-7.0.svn/lib
> /usr/local/grass-6.4.4svn/lib
> In /etc/ld.so.conf (in that order).

I guess the order should be reverse.

> gdal_translate gives a warning message:
>
> Warning 1: GRASS warning: GISBASE enviroment variable was not set, using:
> /usr/local/grass-7.0.svn
>
> However, it takes GRASS raster gladly, so that works.

... for me surprising :-)

> Then I build PostGIS 2.1.2 against the compiled GDAL version with GRASS support.
> Unfortunately raster2pgsql gives error messages when I try to feed GRASS raster:
> "Segmentation fault (core dumped)"
>
> After I removed the link to GRASS 6.4.4svn/lib in /etc/ld.so.conf the errormessage changes to:
> ERROR 1: libgrass_I.so: cannot open shared object file: No such file 
> or directory
> *** glibc detected *** raster2pgsql: corrupted double-linked list: 
> 0x00000000012e59f0 ***
>
> Any Ideas?

IMHO the GDAL ticket should be fixed.

Best
Markus


More information about the grass-dev mailing list