[GRASS-user] grass-user Digest, Vol 79, Issue 37

Pankaj Kr Sharma pkscwc at gmail.com
Thu Nov 22 01:51:49 PST 2012


Just for reference:
The gdal plugin files were scrubbed by the mail server.
Those looking to compile their own plugin may follow this route:

Just copy the following files from GDAL source directory and " ./configure
&& make && sudo make install " it.

How to make latest gdal-grass plugin.
Just copy 10 files given below from GDAL source files as given below:

grass57dataset.cpp         <gdal_source>/frmts/grass
aclocal.m4             <gdal_source>/frmts/grass/pkg
configure             <gdal_source>/frmts/grass/pkg
configure.in             <gdal_source>/frmts/grass/pkg
Makefile.in             <gdal_source>/frmts/grass/pkg
README                <gdal_source>/frmts/grass/pkg
ogrgrass.h             <gdal_source>/ogr/ogrsf_frmts/grass
ogrgrassdatasource.cpp         <gdal_source>/ogr/ogrsf_frmts/grass
ogrgrassdriver.cpp        <gdal_source>/ogr/ogrsf_frmts/grass
ogrgrasslayer.cpp         <gdal_source>/ogr/ogrsf_frmts/grass



Basically all the files can be safely copied from the above two folders and
the first file (grass57dataset.cpp) from ../frmts/grass folder.

The errors encountered during the process may be reported to the group for
reference.

Thanks.




On Thu, Nov 22, 2012 at 2:56 PM, <grass-user-request at lists.osgeo.org> wrote:

> Send grass-user mailing list submissions to
>         grass-user at lists.osgeo.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.osgeo.org/mailman/listinfo/grass-user
> or, via email, send a message with subject or body 'help' to
>         grass-user-request at lists.osgeo.org
>
> You can reach the person managing the list at
>         grass-user-owner at lists.osgeo.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of grass-user digest..."
>
>
> Today's Topics:
>
>    1. Re: How I can solve the problem like spectral correlation
>       maping (Sitansu pattnaik)
>    2. Re: error in g.extension (???)
>    3. Finally got working GDAL stable v 1.9.2 GRASS v7.0 and    their
>       Plugin! (Pankaj Kr Sharma)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 22 Nov 2012 09:02:31 +0530
> From: Sitansu pattnaik <sitansu at gmail.com>
> To: SWAPAN GHOSH <swap.ghsh at gmail.com>
> Cc: grass-user <grass-user at lists.osgeo.org>
> Subject: Re: [GRASS-user] How I can solve the problem like spectral
>         correlation maping
> Message-ID:
>         <CAO92kOnj3Ldk-Hox0TBV4nhuVjvQWWi0+tTCujO+_c-tgq=
> Aiw at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> http://grass.unibuc.ro/grass65/manuals/html65_user/r.regression.line.html
>
> Regards,
> Sitansu
>
> On Nov 21, 2012 6:34 PM, "SWAPAN GHOSH" <swap.ghsh at gmail.com> wrote:
>
> Dear sir,
>
> yes it means affine function coefficients for two spectral bands. Please
> give me suitable logic or command sequence so that I can build a single
> command for this problem. I am c/c++ developer, I have not much knowledge
> about GIS.
>
> Thanks,
>
> Swapan
>
>
>
>
> On Wed, Nov 21, 2012 at 5:51 PM, Yann Chemin <yann.chemin at gmail.com>
> wrote:
> >
> > Do you mean findi...
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/grass-user/attachments/20121122/5af92c95/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Thu, 22 Nov 2012 17:11:18 +0800 (GMT+08:00)
> From: ??? <dehuiw at gig.ac.cn>
> To: "Nikos Alexandris" <nik at nikosalexandris.net>
> Cc: grass-user at lists.osgeo.org
> Subject: Re: [GRASS-user] error in g.extension
> Message-ID: <1cdbd01.5ee3.13b2762b4ca.Coremail.dehuiw at gig.ac.cn>
> Content-Type: text/plain; charset=utf-8
>
> Hi Nikos,
> My grasssvns(7,6.5,6.4) and grass-addons are all in /usr/local/ folders,
> so the compiling and installing command need the super user permission, if
> not, the installations will be failed. For example, I use the following
> command to install all the grass7-addons:
> cd /usr/local/grass-addons/grass7;sudo make
> MODULE_TOPDIR=/usr/local/grass-7.0.svn/
> Best regards,
> dehui
>
> ?2012-11-21 15:56:15,???<dehuiw at gig.ac.cn>???
> > ???:
> >
> > > If you only want to use this addon, then you just need to download the
> addon
> > > and run the command " sudo make
> MODULE_TOPDIR=/usr/local/grass-7.0.svn/" in
> > > the addon folder.
> >
> > Dehui,
> >
> > Of course I don't know how you have setup your operating systems
> environment
> > variables and other details.  Yet, I would like point out (actually
> repeat)
> > that one shouldn't compile, e.g. use the make command, as a super-user.
> >
> > Inside a directory whose permissions grant read and write access to a
> user,
> > the use of sudo is not/should not be required.  Furthermore, I am not
> sure if
> > there are/will be other implications -- probably not.  But still, it is
> not a
> > good practice.
> >
> > The reason that  sudo  is required for the installation step, is of
> course
> > that the process itself copies files in "privileged" directories.
>  Without
> > sudo  the installation would fail.
> >
> > However, in case you know why you use  sudo  while compiling,  I kindly
> ask
> > you to share some details.  I would like to know -- since I too was
> told, in
> > the past, that doing "sudo make"  is not required (maybe not correct).
> >
> > All the best, Nikos
> >
> > [rest deleted]
>
>
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 22 Nov 2012 14:56:53 +0530
> From: Pankaj Kr Sharma <pkscwc at gmail.com>
> To: grass-user at lists.osgeo.org
> Subject: [GRASS-user] Finally got working GDAL stable v 1.9.2 GRASS
>         v7.0 and        their Plugin!
> Message-ID:
>         <CAM5_u0E8CJ0WH4biG-=
> Gnb_4M4Xu9yYmNtg_+5hoy+bpPoztzA at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Installing GDAL and GRASS was the easier part.
> Just followed all the instructions posted on the wiki.
>
> Building the plugin required some effort.
> I resolved the errors cropping up during installation through crude
> methods.
>
> The plugin worked finally and got it tested also.
>
> The Long messages received during installation and the plugin files are
> also attached.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/grass-user/attachments/20121122/962ed30a/attachment.html
> >
> -------------- next part --------------
> ---------------gdal-grass plugin begins ---------------------
>
>
> ./configure \
> --prefix=/usr/local \
> --with-gdal=/usr/local/bin/gdal-config \
> --with-grass=/usr/local/grass-7.0.svn/ \
> --with-autoload="/usr/local/lib/gdalplugins/" \
> --with-ld-shared="g++ -shared"
>
> Here, I have used installation folder path instead of source path for
> GRASS.
>
>
> rdcgis2 at rdcgis2-nswdc:/usr/gis/gdal-grass-plugin$ make
> g++ -Wall -fPIC  -DUSE_CPL -DGRASS_GISBASE=\"/usr/local/grass-7.0.svn/\"
> -I/usr/local/include -I/usr/local/grass-7.0.svn//include   -c -o
> grass57dataset.o grass57dataset.cpp
> grass57dataset.cpp:50:38: error: declaration of C function ?char*
> GPJ_grass_to_wkt(Key_Value*, Key_Value*, int, int)? conflicts with
> In file included from
> /usr/local/grass-7.0.svn//include/grass/gprojects.h:91:0,
>                  from grass57dataset.cpp:45:
> /usr/local/grass-7.0.svn//include/grass/defs/gprojects.h:17:7: error:
> previous declaration ?char* GPJ_grass_to_wkt(const Key_Value*, const
> Key_Value*, int, int)? here
> make: *** [grass57dataset.o] Error 1
>
>
> Done the correction
>
> char *GPJ_grass_to_wkt(const struct Key_Value *proj_info,
>                        const struct Key_Value *proj_units,
>                        int esri_style, int prettify);
> }
>
> Again , error
>
> rdcgis2 at rdcgis2-nswdc:/usr/gis/gdal-grass-plugin$ make
> g++ -Wall -fPIC  -DUSE_CPL -DGRASS_GISBASE=\"/usr/local/grass-7.0.svn/\"
> -I/usr/local/include -I/usr/local/grass-7.0.svn//include   -c -o
> grass57dataset.o grass57dataset.cpp
> g++ -shared grass57dataset.o -L/usr/local/grass-7.0.svn//lib
> -lgrass_raster.7.0.svn -lgrass_gmath.7.0.svn -lgrass_gis.7.0.svn
> -lgrass_datetime.7.0.svn -lgrass_gproj.7.0.svn -lgrass_vector.7.0.svn
> -lgrass_dbmibase.7.0.svn -lgrass_dbmiclient.7.0.svn -lgrass_dgl.7.0.svn
> -lgrass_dig2.7.0.svn -lgrass_rtree.7.0.svn -lgrass_linkm.7.0.svn
> -lgrass_btree2.7.0.svn -lgrass_ccmath.7.0.svn -L/usr/local/lib -lgdal  -o
> gdal_GRASS.so
> g++ -Wall -fPIC  -DUSE_CPL -DGRASS_GISBASE=\"/usr/local/grass-7.0.svn/\"
> -I/usr/local/include -I/usr/local/grass-7.0.svn//include   -c -o
> ogrgrassdriver.o ogrgrassdriver.cpp
> In file included from
> /usr/local/grass-7.0.svn//include/grass/vect/digit.h:3:0,
>                  from /usr/local/grass-7.0.svn//include/grass/vector.h:4,
>                  from ogrgrass.h:41,
>                  from ogrgrassdriver.cpp:30:
> /usr/local/grass-7.0.svn//include/grass/vect/dig_structs.h:34:22: fatal
> error: libpq-fe.h: No such file or directory
> compilation terminated.
> make: *** [ogrgrassdriver.o] Error 1
>
>
> corrected it with
>
> #ifdef HAVE_POSTGRES
> #include </usr/include/postgresql/libpq-fe.h>
> #endif
>
>
> Again , error
>
> rdcgis2 at rdcgis2-nswdc:/usr/gis/gdal-grass-plugin$ make
> g++ -Wall -fPIC  -DUSE_CPL -DGRASS_GISBASE=\"/usr/local/grass-7.0.svn/\"
> -I/usr/local/include -I/usr/local/grass-7.0.svn//include   -c -o
> ogrgrassdriver.o ogrgrassdriver.cpp
> g++ -Wall -fPIC  -DUSE_CPL -DGRASS_GISBASE=\"/usr/local/grass-7.0.svn/\"
> -I/usr/local/include -I/usr/local/grass-7.0.svn//include   -c -o
> ogrgrassdatasource.o ogrgrassdatasource.cpp
> ogrgrassdatasource.cpp: In member function ?int
> OGRGRASSDataSource::Open(const char*, int, int, int)?:
> ogrgrassdatasource.cpp:191:28: error: ?GV_FATAL_PRINT? was not declared in
> this scope
> ogrgrassdatasource.cpp:191:43: error: ?Vect_set_fatal_error? was not
> declared in this scope
> make: *** [ogrgrassdatasource.o] Error 1
> rdcgis2 at rdcgis2-nswdc:/usr/gis/gdal-grass-plugin$
>
> corrected it with
> /*   Vect_set_fatal_error ( GV_FATAL_PRINT ); // Print error and continue
> */
>
>
> And, my plugin completed the make stage successfully.
>
> Now, the sudo checkinstall time:
>
>
> Again , error
>
> ========================= Installation results ===========================
> install -d /usr/local/lib/gdalplugins/
> cp gdal_GRASS.so /usr/local/lib/gdalplugins/
> cp ogr_GRASS.so /usr/local/lib/gdalplugins/
> test -d /usr/local/share/gdal/grass || mkdir /usr/local/share/gdal/grass
> test -d /usr/local/share/gdal/grass/etc || mkdir
> /usr/local/share/gdal/grass/etc
> cp /usr/local/grass-7.0.svn//etc/ellipse.table
> /usr/local/share/gdal/grass/etc
> cp: cannot stat `/usr/local/grass-7.0.svn//etc/ellipse.table': No such
> file or directory
> make: *** [install] Error 1
>
> ****  Installation failed. Aborting package creation.
>
> Cleaning up...OK
>
> Bye.
>
> corrected it with
>
> sudo cp /usr/gis/grass_trunk/lib/gis/ellipse.table
> /usr/local/grass-7.0.svn/etc/ellipse.table
>
> Sudo Checkinstall again
>
> ========================= Installation results ===========================
> install -d /usr/local/lib/gdalplugins/
> cp gdal_GRASS.so /usr/local/lib/gdalplugins/
> cp ogr_GRASS.so /usr/local/lib/gdalplugins/
> test -d /usr/local/share/gdal/grass || mkdir /usr/local/share/gdal/grass
> test -d /usr/local/share/gdal/grass/etc || mkdir
> /usr/local/share/gdal/grass/etc
> cp /usr/local/grass-7.0.svn//etc/ellipse.table
> /usr/local/share/gdal/grass/etc
> cp /usr/local/grass-7.0.svn//etc/datum.table
> /usr/local/grass-7.0.svn//etc/datumtransform.table
> /usr/local/share/gdal/grass/etc
> cp: cannot stat `/usr/local/grass-7.0.svn//etc/datum.table': No such file
> or directory
> cp: cannot stat `/usr/local/grass-7.0.svn//etc/datumtransform.table': No
> such file or directory
> make: *** [install] Error 1
>
> ****  Installation failed. Aborting package creation.
>
> Restoring overwritten files from backup...OK
>
> Cleaning up...OK
>
> Bye.
>
> rdcgis2 at rdcgis2-nswdc:/usr/gis/gdal-grass-plugin$
>
>
> corrected it with
> sudo cp /usr/gis/grass_trunk/lib/gis/datumtransform.table
> /usr/local/grass-7.0.svn/etc/datumtransform.table
> sudo cp /usr/gis/grass_trunk/lib/gis/datum.table
> /usr/local/grass-7.0.svn/etc/datum.table
>
>
> And it worked.
>
> Done. The new package has been installed and saved to
>
>  /usr/gis/gdal-grass-plugin/gdal-grass_5-1_amd64.deb
>
>  You can remove it from your system anytime using:
>
>       dpkg -r gdal-grass
>
>
> Now , it is time to test:
>
> test 1
>
> rdcgis2 at rdcgis2-nswdc:~$ gdal_translate --formats | grep -i grass
>   GRASS (ro): GRASS Database Rasters (5.7+)
>   GRASSASCIIGrid (rov): GRASS ASCII Grid
> rdcgis2 at rdcgis2-nswdc:~$
>
> test 2
>
> ldd /usr/local/lib/gdalplugins/gdal_GRASS.so
>         linux-vdso.so.1 =>  (0x00007fff30fee000)
>         libgrass_raster.7.0.svn.so => /usr/local/grass-7.0.svn/lib/
> libgrass_raster.7.0.svn.so (0x00007f3443314000)
>
> .......................................................................
>
> .......................................................................
>         libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1
> (0x00007f3438371000)
> rdcgis2 at rdcgis2-nswdc:~$
>
>
> test 3
>
> rdcgis2 at rdcgis2-nswdc:~$ ldd /usr/local/lib/gdalplugins/ogr_GRASS.so
>         linux-vdso.so.1 =>  (0x00007fffb2fbb000)
>         libgrass_gis.7.0.svn.so => /usr/local/grass-7.0.svn/lib/
> libgrass_gis.7.0.svn.so (0x00007f858d980000)
>
> .......................................................................
>
> .......................................................................
>         libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0
> (0x00007f858784a000)
>         libcrypto.so.1.0.0 => /lib/x86_6
>
> test 4
>
> rdcgis2 at rdcgis2-nswdc:~$ gdalinfo
> /media/rdcgis2/disk2part3/rdcgis2/gisdata90m/no_nulls/cellhd/i90
> Warning 1: GRASS warning: GISBASE enviroment variable was not set, using:
> /usr/local/grass-7.0.svn/
> Driver: GRASS/GRASS Database Rasters (5.7+)
> Files: /media/rdcgis2/disk2part3/rdcgis2/gisdata90m/no_nulls/cellhd/i90
> Size is 42001, 42001
> Coordinate System is:
> GEOGCS["everest",
>     DATUM["unknown",
>         SPHEROID["Everest_1830_India",6377276.345,300.8017]],
>     PRIMEM["Greenwich",0],
>     UNIT["degree",0.0174532925199433]]
> Origin = (64.999583454444448,40.000416763611113)
> Pixel Size = (0.000833333333333,-0.000833333333333)
> Corner Coordinates:
> Upper Left  (  64.9995835,  40.0004168) ( 64d59'58.50"E, 40d 0' 1.50"N)
> Lower Left  (  64.9995835,   4.9995834) ( 64d59'58.50"E,  4d59'58.50"N)
> Upper Right ( 100.0004168,  40.0004168) (100d 0' 1.50"E, 40d 0' 1.50"N)
> Lower Right ( 100.0004168,   4.9995834) (100d 0' 1.50"E,  4d59'58.50"N)
> Center      (  82.5000001,  22.5000001) ( 82d30' 0.00"E, 22d30' 0.00"N)
> Band 1 Block=42001x1 Type=Int32, ColorInterp=Gray
>   Min=-160.000 Max=8806.000
>   NoData Value=-2147483648
>   Metadata:
>     COLOR_TABLE_RULES_COUNT=0
> rdcgis2 at rdcgis2-nswdc:~$
>
> test 5
>
> rdcgis2 at rdcgis2-nswdc:~$ ogrinfo -summary
> /media/rdcgis2/disk2part3/rdcgis2/find_sites/find_sites_vector/PERMANENT/vector/new1917_online/head
> Warning 1: GRASS warning: GISBASE enviroment variable was not set, using:
> /usr/local/grass-7.0.svn/
> DBMI-PostgreSQL driver error:
> Connection failed.
> fe_sendauth: no password supplied
>
>
> Warning 1: GRASS warning: Unable to open database
> <host=localhost,dbname=nswdc_gis> by driver <pg>
> ERROR 1: Cannot open database pg by driver
> host=localhost,dbname=nswdc_gis, check if GISBASE enviroment variable is
> set, the driver is available  and the database is accessible.
> INFO: Open of
> `/media/rdcgis2/disk2part3/rdcgis2/find_sites/find_sites_vector/PERMANENT/vector/new1917_online/head'
>       using driver `GRASS' successful.
> 1: new1917_online (Point)
> rdcgis2 at rdcgis2-nswdc:~$
>
>
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: gdal-grass-plugin.tar.gz
> Type: application/x-gzip
> Size: 245760 bytes
> Desc: not available
> URL: <
> http://lists.osgeo.org/pipermail/grass-user/attachments/20121122/962ed30a/attachment.bin
> >
>
> ------------------------------
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>
> End of grass-user Digest, Vol 79, Issue 37
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20121122/07202eaf/attachment-0001.html>


More information about the grass-user mailing list