Skip to content
Prev 7526 / 29559 Next

RE : rgdal problem when connecting with postgres

Dear Roger

Thank you for your answer. 

I have done the following :
-----------------------------------------
Run in OSGeo4W console, after setting:
set OSGEO4W_BUILD=yes
set GDAL_HOME=%OSGEO4W_ROOT%
download rgdal sources
cd C:/rgdal/src
using visuel c++ (vc9) command line
cl /MT /Ox /EHsc /D "WIN32" /c /I "C:/Program Files/R/R-2.10.1/include" /I C:/OSGeo4W/include /I "C:\Program Files\Microsoft Visual Studio 9.0\VC\include" /D OSGEO4W *.cpp
-------------------------------------------------------
at this point, following your insctructions,  I need a rdll.lib, and was not able to produce it ...

I understand I have to download the source and try the following code, but it fails. 

C:\R-2.10.1\src\gnuwin32>make R.exp
-------------------------------------------------
gcc -std=gnu99 -I../include -I. -I../extra -DHAVE_CONFIG_H -DR_DLL_BUILD  -O3 -W
all -pedantic   -c console.c -o console.o
console.c:23:20: error: config.h: No such file or directory
console.c:73: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Ch
aracterMode'
console.c: In function 'console_normalkeyin':
console.c:1357: error: 'CharacterMode' undeclared (first use in this function)
console.c:1357: error: (Each undeclared identifier is reported only once
console.c:1357: error: for each function it appears in.)
console.c:1357: error: 'RGui' undeclared (first use in this function)
make: *** [console.o] Error 1
---------------------------------------------------
C?dric

________________________________________
De : Roger Bivand [Roger.Bivand at nhh.no]
Date d'envoi : vendredi 29 janvier 2010 20:11
? : C?dric Briand
Cc : r-sig-geo at stat.math.ethz.ch
Objet : Re: [R-sig-Geo] rgdal problem when connecting with postgres
On Fri, 29 Jan 2010, C?dric Briand wrote:

            
If you mean the Windows binary rgdal package, then the answer is in

file.show(system.file("README", package="rgdal"))
file.show(system.file("README.windows", package="rgdal"))

The Windows binary package builds the minimal set of drivers, with only
one external dependency (expat for reading GPX and KML). The file refered
to describes how you might build rgdal from source, using FWTools or
OSGEO4W as the provider of GDAL and its dependent DLLs. If you do try this
out (look for the chunk beginning: "Initial notes for OSGeo4W"), and if:

source(system.file("OSGeo4W_test", package="rgdal"), echo=TRUE)

works, as well as PostGIS access, please let me know.

Roger
PS. That example was run on Linux with GDAL built with PostGIS, and rgdal
installed as a source package.
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no