A lot of people ask me about how to use PostGIS Raster and the GDAL PostGIS Raster driver in Windows systems. And most of them are, comprehensibly, using the last stable releases of both libraries (PostGIS and GDAL). The problem is PostGIS Raster and GDAL driver are being developed in these moments. There’s no stable release, so far.
PostGIS Raster was included as official part of PostGIS in October 2010. The old version, formerly named WKT Raster has been abandoned. So, if you want to use PostGIS Raster, with new functionalities and many bugs fixed, you’ll have to use the latest PostGIS development snapshot. The use of the old WKT Raster extension is strongly unrecommended, and there’s no support for it.
About GDAL, there was an important change in the driver on October 20st, 2010. A new version was committed, and this is the only version that works with PostGIS Raster. This new driver version was included in the release 1.8.0, currently the stable release. So, the use of an older release to connect with PostGIS Raster is also unrecommended.
With these facts in mind, I understand the Windows users who want to use PostGIS Raster and the GDAL driver are a bit unprotected. I’m not a Windows user, but I consider it my fault. For this reason, I’ve decided to create this howto. I’m going to install and configure PostGIS Raster and GDAL in Windows. And fortunately, you don’t need to compile anything. Let’s go for it:
Enviroment: Windows 7 32 bits
Step 1: Installing Python and Numpy
PostGIS Raster loader uses GDAL Python bindings and numpy. So, we’ll first install Python and numpy. Several options here:
- Python 2.5, unofficial numpy 1.5.1 (download numpy-1.5.1.win32-py2.5.exe from here)
- Python 2.6, unofficial numpy 1.5.1 (download numpy-1.5.1.win32-py2.6.exe from here)
- Python 2.7, unofficial numpy 1.5.1 (download numpy-1.5.1.win32-py2.7.exe from here)
I’m using:
- Python 2.6.6
- Numpy 1.5.1 (numpy-1.5.1.win32-py2.6.exe)
Step 2: Installing GDAL
I think the easiest way to have a complete GDAL installation (library + binaries + Python bindings) working on Windows is using the GDAL binaries mantained by Tamas Szekeres, here. Last GDAL versions from trunk are compiled daily with MSVC 2003, MSVC 2005 and MSVC 2008. Pick one. For example, the version compiled with MSVC 2003, here.
The faster way now would be to download the generic installer for the GDAL core components, and choose the complete installation

After the installation, you will need to add C:Program FilesGDAL to the PATH enviroment var. And create this new var:
GDAL_DATA=C:Program FilesGDALgdal-data
UPDATE 2011-10-07: About the GDAL Python bindings
After installing GDAL core components, you must install the Python bindings separately. You can use this installer (for Python 2.7 and GDAL 1.8.0), or grab one of the executables existent at http://www.lfd.uci.edu/~gohlke/pythonlibs/
Depending on your Python installation, you can choose GDAL-1.8.1.win32-py2.6.exe, GDAL-1.8.1.win32-py2.7.exe, GDAL-1.8.1.win32-py3.1.exe or GDAL-1.8.1.win32-py3.2.exe
UPDATE 2011-03-25: Alicia Duarte, from IDESF, told me she was to additionally set the next enviroment vars to make it work:
GDAL_DRIVER_PATH=C:Program FilesGDALgdalplugins PROJ_LIB=C:Program FilesGDALprojlib
WARNING: This directory (GDAL Python bindings location) may not exist in your GDAL installation. In my case, the bindings are in C:Python27Libsite-packagesosgeo, and I didn’t need to define this variable.
PYTHONPATH=C:Program FilesGDALpython
UPDATE 2011-07-19: I think I introduced some confusion in the comments. I apologize for that. Several people are having problems with GDAL Python bindings. I’ll try to make it clearer:
On one hand, there’s a sure thing: you need GDAL library + GDAL Python bindings installed in your system. There’s an easy way of doing it, by executing the generic installer: gdal-18-1310-core.msi. This installer includes the Python bindings, and they’re installed at C:Program FilesGDALpython directory by default. This should be enough.If you previously have a Python interpreter and a GDAL version installed on your system (check it from a console, executing gdalinfo –formats), you may want to simply install the proper GDAL Python bindings. Let’s assume your GDAL version is 1.8 (lower versions won’t work with PostGIS Raster), and your Python version is 2.7. Then, you simply need to install GDAL-1.8.0.win32-py2.7.msi. This installer will put GDAL Python bindings at C:Python27Libsite-packages by default. This is a different location than above, but at the end, you should have a working version of GDAL Python bindings on your system.Finally, the PostGIS Windows experimental binaries with PostGIS Raster support (step 4) are packed with their own version of GDAL library, used only by the raster2pgsql loader.
GDAL installed. Now, let’s go with step 3
Step 3: Installing PostgreSQL
I recommend Postgresql 8.4.x or higher. You can download the 1-click-installer from here, and install it in the common Windows’ way.
During the installation, you’ll be asked to install some nice additional stuff using the Application Stack Builder, like PostGIS 1.5.x or PostGIS 1.4.x. Don’t install anything. The PostGIS versions that can be installed doesn’t include PostGIS Raster. And you can’t install it separately, because, remember, now is part of PostGIS. We’re going to install last PostGIS version by hand. Don’t be afraid, it’ll be easy.
Step 4: Installing PostGIS
We’re going to use the PostGIS Windows experimental binaries. We need the binaries compiled for PostgreSQL 8.4, these ones
Once uncompressed, you can see this

Following the instructions of README.txt file, let’s edit makepostgisdb.bat to adapt the vars to our enviroment. We may want to change these vars:
set PGPORT=5432 set PGHOST=localhost set PGUSER=postgres set PGPASSWORD=password_of_postgres_user set THEDB=template_postgis20 set PGBIN=C:Program FilesPostgreSQL8.4bin set PGLIB=C:Program FilesPostgreSQL8.4lib After that, we make a backup of our PostgreSQL bin and lib directories (PGBIN and PGLIB). Just in case.
We now execute makepostgisdb.bat. Take into account you may want to execute the script as administrator, in case your Windows user doesn’t have needed privileges (it was my case).
UPDATE 2011-06-08: For all Windows XP Professional SP2 users:
when you run makepostgisdb.bat from the binaries of POSTGIS SVN2.0, please rename the libiconv-2.dll in bin folder of Postgresql/8.4/bin folder to any other name. Now run the makepostgisdb.bat file. You will not get any error of “operation aborted …. transaction block” (Thanks to C Patnaik)
Once executed, we have PostGIS 2.0 + PostGIS Raster installed and configured. A new database called template_postgis20 is created, enabled with PostGIS and PostGIS Raster. Easy! Let’s test it with the next query:
select postgis_full_version(), postgis_raster_lib_build_date(), postgis_raster_lib_version()
And the result:

Of course, you can create your own database using template_postgis20 as template. From the command line:
createdb -U postgres -T template_postgis20 your_database
Or from pgAdmin III:

If you want to use the SHP2PGSQL GUI, you must copy the postguisgui folder (inside bin folder in the downloaded PostGIS experimental binaries file) into pgAdmin III folder (mine is C:Program FilespgAdmin III1.12) and add the next lines to plugins.ini file, inside pgAdmin III folder too:
; ;PostGIS shp2pgsql-gui (Windows): ; Title=PostGIS Shapefile and DBF loader Command="$$PGBINDIRpostgisguishp2pgsql-gui.exe" -h "$$HOSTNAME" -p $$PORT -U "$$USERNAME" -d "$$DATABASE" -W "$$PASSWORD" Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database. KeyFile=$$PGBINDIRpostgisguishp2pgsql-gui.exe Platform=windows ServerType=postgresql Database=Yes SetPassword=Yes
After that, you can use the GUI inside pgAdmin III:

Now you can load raster data into your database in 2 steps. In the first step, you will generate a SQL file. Open a command line and execute this:
python C:Program FilesPostgresql8.4binraster2pgsql.py -r image.tif -t tablename -o image.sql
As result of this step, a SQL file named image.sql will be created in the directory where you executed the Python line above.
In the second step, you’ll need to load the SQL file in your_database, by using your favourite PostgreSQL client. For example, pgAdmin. If your use the psql command line client, the line to execute is:
psql -h localhost -U postgres -d your_database -f image.sql
If you want to translate your raster data from the database to image files at disk again, execute gdal_translate.
gdal_translate PG:"dbname=your_database user=postgres table=your_table mode=2" your_file.tif
Basically, this is all what you need to work with PostGIS Raster in Windows. Anyway, take into account the next additional notes:
Additional notes:
In step 2, I installed the whole GDAL library, including binaries and Python bindings. In step 4, I installed PostGIS 2.0 with all its pre-requisites. One of them is GDAL. The optimal way would be to use the existent GDAL library, but we’re working with pre-compiled binaries and DLLs. So, we have 2 copies of GDAL library:
- C:Program FilesGDALgdal18.dll: Installed with generic installer for GDAL, in step 2. Used by gdal_translate, when reading data from database, and in any operation involving GDAL, except the raster loading with raster2pgsql.py script
- C:Program FilesPostgreSQL8.4binlibgdal.dll: Installed with PostGIS Windows experimental binaries, in step 4. Used by raster2pgsql.py script, to load raster data into PostgreSQL.
Both library files were compiled from GDAL 1.8.0 from trunk. But they will be slightly different, for sure. This is a suboptimal solution, of course, but it shouldn’t cause problems, because libgdal.dll is only used when loading raster data into the database. The rest of operations involving GDAL will be executed linking with gdal18.dll
If you want to translate the raster data to any image format different from TIFF, you can use the -of option in gdal_translate. For example:
gdal_translate -of "PNG" PG:"dbname=your_database user=your_user password=your_password table=your_table mode=2" your_file.png
To get available raster formats:
gdalinfo --formats
UPDATE 2011-06-11: I changed the gdal_translate line. I’m using the ‘postgres’ user and the ‘trust’ method to authenticate this user (so, no password is needed), but it’s only a simplification. In general, you should use a different user and a password-enabled authentication method, like md5. Thanks to C.Patnaik again, because his comment remainded me this issue
Conclussions:
It’s possible to work with the last version of PostGIS Raster and GDAL PostGIS Raster driver in Windows, but assuming that:
- You’re using experimental build. Not recommended for production enviroments.
- The previous versions of PostGIS Raster (WKT Raster) and GDAL PostGIS Raster driver (before GDAL 1.8.0) are discontinued. Don’t use them.
- It’s a suboptimal solution, because you install 2 copies of GDAL library. But I think this is the best available solution right now.
Do you have problems, something to add, modify or correct? Let me know it in the comments
it give me that error
“ImportError: No module named osgeo”
when i run raster2pgsql.py
please help
thanks
That error is caused because the GDAL Python bindings are not properly installed. Execute python from a console and try this:
>>> from osgeo import gdal
If you get an error like:
Traceback (most recent call last):
File “”, line 1, in
ImportError: cannot import name gdal
You have to install GDAL Python bindings. Do it following instructions in step 2, by using the GDAL generic installer for core components. Choose the “complete” installation or the custom installation, if you want to manually choose the components to install. In that case, be sure the last option (Python bindings) is selected.
Let me know if you continue having problems.
give me that in the python console
>>> from osgeo import gdal
LookupError: unknown encoding: cp720
i reinstall GDAL-1.8 “complete” and still the same problem
Sounds like your console is using a locale unsupported by Python. To help you, I should know the python version you’re running and the locale of your console. If you’re using Python 3.x, you should try executing this:
http://hg.python.org/cpython/file/default/Lib/encodings/cp720.py
Further information here: http://www.velocityreviews.com/forums/t722822-encoding-issue-cp720.html
python version 2.6
Probably, your console is using a locale not supported by Python. Could you change it?
i reinstall python to be 2.6.5 and change locale
and give me this error
>>> from osgeo import gdal
File “”, line 1
from osgeo import gdal
^
IndentationError: unexpected indent
>>>
You probably introduced a space before starting writing in python console. Simply call python interpreter from console and write this, with no spaces at all before or after the text:
from osgeo import gdal
i’m sorry but there is another error
>>> from osgeo import gdal
Traceback (most recent call last):
File “”, line 1, in <modul
ImportError: No module named osgeo
and thank you for your replay
Ok, try with:
import gdal
instead of:
from osgeo import gdal
Maybe you’ve installed old-gen python bindings, because you chose an old binary version of GDAL.
Did you install GDAL 1.8? It’s the only GDAL version that will properly work with PostGIS Raster
thank you very much
it is success after install GDAL-1.8.0.win32-py2.6.exe
i am trying now to import .jpg image by
raster2pgsql.py -r 555.jpg -t public.image -o image.sql
psql -h localhost -U postgres -d template_postgis -f image.sql
the sconde command give me this error
CREATE TABLE
psql:image.sql:3: ERROR: function addrastercolumn(unknown, unknown, unknown, in
teger, text[], boolean, boolean, numeric[], numeric, numeric, unknown, unknown,
unknown) does not exist
LINE 1: SELECT AddRasterColumn(‘public’,’image’,’rast’,-1, ARRAY[‘8B…
^
HINT: No function matches the given name and argument types. You might need to
add explicit type casts.
psql:image.sql:4: ERROR: current transaction is aborted, commands ignored until
end of transaction block
ROLLBACK
Check if the template_postgis database has a table named “raster_columns”. This message seems to appear because the PostGIS Raster extension wasn’t properly installed in template_postgis. Strange.
when i make new database and it’s tamplate is postgis20 it create
2 schemas the first one “public”
contain one table “raster_overviews”
and the second schema called “topology”
which contain two tables “layer and topology”
and no tables called “raster_columns”.
If you use http://postgis.refractions.net/download/windows/pg84/experimental/postgis/postgis-pg84-binaries-2.0.0svn.zip as PostGIS binaries, the database template_postgis should be created with all the PostGIS and PostGIS Raster stuff, in only 1 schema (public schema). If it wasn’t created (I don’t know the reason), you can create it manually:
Inside that zip file, there are several SQL files with all the functions and tables you need to activate a new or existent PostgreSQL database with PostGIS and PostGIS Raster. These SQL files are inside sharecontribpostgis-2.0 folder.
So, do these steps, from console:
createdb -U postgres
createlang -U postgres plpgsql
psql -U postgres -f postgis.sql -d
psql -U postgres -f spatial_ref_sys.sql -d
psql -U postgres -f rtpostgis.sql -d
Then, you’ll can load raster files in by using raster2pgsql.py
Hi, I am trying to use the postgis raster, after i installed postgis raster and GDAL and python3.2
when I run type raster2pgsql.py, i got the following error, don’t know how to fix.
C:Program FilesOpenGeoOpenGeo Suitepgsql8.4bin>raster2pgsql.py
File “C:Program FilesOpenGeoOpenGeo Suitepgsql8.4binraster2pgsql.py”, l
ine 633
print ‘BEGIN BLOCK SCANLINES (numpy): (%d, %d)’ %(len(pixels[0]), len(pixels
))
^
SyntaxError: invalid syntax
Hello,
This line is from a debug only function (dump_block_numpy). Calls to that function are commented in the official version of the script, in PostGIS trunk (http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/python/raster2pgsql.py).
Could you check if the calls to function dump_block_numpy (in lines 799 and 824) are commented? If not, please comment them and execute the script again.
Hi, thank you for the reply. However, both lines are commented.
Hi,
The error is fixed. This’s just python 3.2 has different print function.
But now I am facing another problem:
C:Program FilesOpenGeoOpenGeo Suitepgsql8.4bin>raster2pgsql.py
Traceback (most recent call last):
File “C:Program FilesOpenGeoOpenGeo Suitepgsql8.4binraster2pgsql.py”, line 34, in
from osgeo import gdal
File “C:Program FilesGDALpythonosgeo__init__.py”, line 21, in
_gdal = swig_import_helper()
File “C:Program FilesGDALpythonosgeo__init__.py”, line 17, in swig_import_helper
_mod = imp.load_module(‘_gdal’, fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.
C:Program FilesOpenGeoOpenGeo Suitepgsql8.4bin>
This error is because the GDAL library can not be found. Did you add the path to gdal bin folder to your PATH enviroment var?
Further information here: http://lists.osgeo.org/pipermail/gdal-dev/2010-October/026526.html
More related info: http://trac.osgeo.org/gdal/ticket/3426
Hi, I think i already set up the PATH:
Variable name: Path
Variable value: C:Program FilesGDAL
I install GDAL 18 by default (complete program file/), the postSQL under program file/opengeo/opengeo suite/
Your PATH var should include more things. For example, if you open a console and put “dir” on it, you’ll get a directory listing. This is because the path to “dir” binary is part of PATH enviroment var.
Open a console and put:
set
You’ll get all your enviroment vars. PATH between them. You’ll have to see the complete path to GDAL binaries (I guess C:Program FilesGDALbin), and the path to your gdal18.dll file (I guess C:Program Files/opengeo/opengeo suite/).
You can test if GDAL is correctly added to your PATH var by executing
gdalinfo –formats
in a console.
hello Mr.jorgearevalo
i build a new enviroment with postgres9.0 and postgis-pg90-binaries-2.0.0svn, the postgis20 template contain “raster_columns”
there is no error in raster2pgsql.py command and take alot of time to convert one image .jpg in to one table with one row but i could’t see it becouse there is an error on the starting the web site
ERROR: function force_2d(geometry) does not exist
so what i can do please?
What’s the size of JPG image?
And yes, function force_2d(geometry) doesn’t exist. It was changed by ST_Force2D a long time ago (I think): http://trac.osgeo.org/postgis/browser/trunk/postgis/postgis.sql.in.c#L1162. Anyway, the script doesn’t directly call this function.
There should be more information apart from the error. I’d need all the output generated by raster2pgsql.
I suggest you to use PostGIS users list to ask this kind of questions. Maybe someone experimented that problems before: http://postgis.refractions.net/mailman/listinfo/postgis-users
the jpg size 1.45 MB it is converted in to one table with only one row is this correct?
but i can’t see it on the map and there is no erorrs
i changed the extent of the map but still nothing seen although it is added as a layer in the legend map!
The image is small, and one row is enough. No problem there.
About the rest… Sorry, but I don’t understand you. You could execute raster2pgsql with no problems, and you’re trying to see the image in any kind of visualizator (web based?, geoserver?). Am I right?
In that case, the problem probably is in another part, not in PostGIS Raster (the GDAL driver, if you’re using it, for example).
i am using mapserver for windows (ms4w) pmapper template and try to see the raster on the website
note:when i am trying to open the raster table data which contain one row on postgres , postgres stopped and hanging!
Ah, ok. I didn’t test Mapserver yet. I think Regina Obe did it. I think we should move this discussion to PostGIS user list… Could you send a mail to the list with your problem?
Anyway, if postgres backend crash, it should generate a log output. Could you provide it?
thank you for replay,
the log file of postgres told me that when i opened the raster table:
2011-03-31 14:15:23 EET LOG: could not receive data from client: No connection could be made because the target machine actively refused it.
2011-03-31 14:15:25 EET LOG: unexpected EOF on client connection
Sorry, no clues on what’s happening. I recommend you to translate the question to PostGIS list.
Hi,
I installed POSTGIS successfully and also was able to execute raster2pgsql.py and store the raster data in POSTGIS but when i execute GDAL-translate I m getting the below error
GDALOpen failed – 1
Error checking geometry type existence. Is PostGIS correctly installed?: no connection to the server
Can you pls help
Which version of gdal did you install? Could you please paste the line that caused the error?
For all Windows XP Professional SP2 users:
when you run makepostgisdb.bat from the binaries of POSTGIS SVN2.0, please rename the libiconv-2.dll in bin folder of Postgresql/8.4/bin folder to any other name. Now run the makepostgisdb.bat file. You will not get any error of “operation aborted …. transaction block”. I discovered it the hard way, Jorge!! As long as this file exists, the batch file does not do the Xcopy and then the prob starts. Cheers!
Updated in the post. Many thanks!
raster2pgsql.py [with its arguments of -r, -t and -o] – when invoked from python throws an error mentioning OCI.dll could not load. This pops up 3-4 times followed by the message : “Cant load requested dll: C:gdalbingdalpluginsgdal_GEOR.dll. The specified module could not be found.” I have this file in its proper place and environment properly set ! In spite of this message, the corresponding sql file gets created and has been successfully incorporated in postgreSQl->PGAdminIII.
I assume this error is non-fatal.
You can borrow the OCI.dll file from any software installed on any Windows machine or get from a reliable site. Put this OCI.dll in the GDAL folder [I have also put in the PostgresQL folder] It works and it stops the gdal_GEOR.dll error too.
Hi, I’m getting the dreaded “ImportError: No module named osgeo” message when trying to run raster2pgsql. GDAL seems to be working otherwise. I set PYTHONPATH=C:Program FilesGDALpython but I now see that there is no GDALpython folder……is this the problem? I used the core components installer and selected “complete”.
Thanks.
Stevie, please download the mapserver version of GDAL called “release-1500-gdal-1-8-0-mapserver-6-0-0”. Run this. This will create a GDAL version on C: only. This will have python too but in C;GDALbingdalpython. Please maintain this GDAL installation separate from C:Program FilesGDAL.
Thanks for the response!
Thanks for the reply, but I’m still a bit confused. When going to the link you specify, there are a list of files:
release-1500-gdal-1-8-0-mapserver-6-0-0.zip
GDAL-1.8.0.win32-py2.6.exe
gdal-18-1500-core.msi etc.
Which of these do I need? I have python 2.6 so I thought it made sense to install “GDAL-1.8.0.win32-py2.6.exe” and “gdal-18-1500-core.msi”, but you mentioned GDAL would install to just “C:GDAL” but it installed in “C:Program FilesGDAL”. So now I’m not sure which PATH to set, etc.
Thanks for the help,
Steve
Stevie, you should simply install “GDAL-1.8.0.win32-py2.6.exe”. This file installs GDAL at C:Program FilesGDAL by default. As result of that installation, you’ll get C:Program FilesGDALgdal18.dll. This is the GDAL library used in your system.
Apart from this, when you install PostGIS 2.0 using PostGIS Windows experimental binaries, you get C:Program FilesPostgreSQL8.4binlibgdal.dll. This version of GDAL library is only used by the raster2pgsql.py loader, to read raster data from disk. The rest of the operations involving GDAL use the previous GDAL library, installed in step 2 at C:Program FilesGDAL
Working great!. Thanks a lot, I think this will work very well for my project.
Happy to hear that 😀
For Windows XP SP2 users: [Jorge, I would help out with Windows components as the ball rolls!]:
In the event of the following error with gdal_translate
“error checking geometry type existence: Is PostGIS correctly installed? No connection to the server.”
Please do the following:
1. Open the configuration file C:Program FilesPostgreSQL8.4datapg_hba.conf in notepad.
2. Optionally you may read thru the file OR do the next step:
3. For a stand alone system: change the METHOD to “trust”. [towards the end of the file].
But for a server based system please chek the server connection and establish proper authentications accordingly. Your sys admin can help you out.
Thanks again. Post updated 🙂
1. Once a raster is loaded into PostGreSQl database, how do we get the
>> attribute values. We tried the ST_Values but it displayed on screen or
>> into an Excel file. We would like to store them in a db file to be
>> accessed later. How?
>>
>> 2. How to view changes on the raster in real time after running an SQL
>> query? Should linkages be established to OpenEV/Fwtools? If so, how? We
>> need a display system, something like what ARC/INFO or ARCView does.
>>
>> 3. How to optimise the run time for running SQLs on large images, say,
>> 10000×10000 lines and pixels (~400 MB). We have tried GIST indexes but
>> still it takes 15-20 minutes.
>>
>> 4. How to dump results onto the table/new table? We need these results as
>> an accessible field in the table.
>>
>> 5. How to run a mathematical model or any algorithm specific to a raster
>> in conjunction with other attributes/values?
In short how do we read/load raster attributes and use them for further zonating regions on image for analysis?
Hello, sorry for taking so much time to response. I had some hard days.
1.- You may try the “CREATE TABLE AS” command, to store the query results as a new table (check http://www.postgresql.org/docs/8.4/static/sql-createtableas.html)
2.- The PostGIS Raster data visualization with graphical clients is still immature. See http://trac.osgeo.org/postgis/wiki/WKTRaster, “Displaying PostGIS Raster” section
3.- Which kind of queries are you running? If you could provide an example directly to postgis-user list (postgis-users@postgis.refractions.net) I think you would get some help.
4.- See point 1. I think it applies here.
5.- Mmmm… I’m not sure. You may use GDAL to abstract your algorithm from the raster source used. Anyway, I recommend you to ask this question in postgis-user list.
Best regards
Hello,
I am at step 3. I have installed postgis2.0. But i don’t understand how to loading raster in my database. I have an error message when i try to generate this sql file with DOS :
python C:Program FilesPostgresql9.0binraster2pgsql.py -r image.tif -t tablename -o image.sql”.
“python” is not recognized as a command.
Could you throw light for me please?
You don’t have Python installed in your system, or it isn’t properly configured. Ensure you installed Python and the path to Python exec (python.exe) was added to PATH enviroment variable.
Hello,
Thank you for your message. today, i have begun again the installation procedure. i have already the same error message when i run the following command line via DOS :
python C:Program FilesPostgresql9.0binraster2pgsql.py -r image.tif -t tablename -o image.sql
“python” is not recognized as a command. Nevertheless, Python is well installed on my computer and i have given good information about python path (path to python.exe).
Really, i’m embrassed. I don’t. What is to be done?
If you have got an idea, don’t hesit to throw light for me. in advance, i thank you.
Kind regards.
Hello,
Did you install the Python interpreter from http://www.python.org/download/releases/? What happens if you open a command line (cmd.exe), write python and hit enter key? It should show you the python interpreter.
If you get an error instead, maybe you installed python only for a user of your machine, and you’re in another user’ session. I’m not a Windows user, but I think you should be able to install Python interpreter for all your machine’s users. I did it with Windows 7 for this tutorial.
If you’re sure you installed Python properly and still get that error, you should try adding the path to Python interpeter (C:Python26python.exe in my case) to the PATH enviroment variable. You have instructions on how to do this:
– Here, for Windows 2000/XP: http://www.computerhope.com/issues/ch000549.htm
– Here, for Windows 7: http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
Try to execute Python interpreter after doing this.
Hello,
I’ve used your helpful steps to install python 2.2.2, numpy1.6,gdal18,postgres 9.0.4.1 and postgis svn 2.0
It worked as you said except for 2 cases: one was minor: in step 4, the bat file needs to be edited so that the xcopy commands are copying the files form postgis2.0 to postgres bin folders.
but i havent quite gotten the raster support to work. when i try
python “C:Program FilesPostgresql8.4binraster2pgsql.py” –help
i get ‘no module named osgeo’
should i try editing the raster2pgsql.py and remove the osge reference? i do have various Paths defined as in your post, except
– in step 2:PYTHONPATH=C:Program FilesGDALpython : i dont python under the GDAL folder
-and mmy path to Python is set as C:Python27 (not C:Python27python.exe)
Can you suggest what i need to do to get it working?
Thanks!
sorry i meant python 2.7.2 above..
Hello,
Don’t modify raster2pgsql. The ‘osgeo’ include is necessary to work. The problem is your system can’t find the GDAL Python bindings. The PYTHONPATH enviroment var must point to the directory containing these bindings (osgeo directory, gdal.py, ogr.py, gdalconst.py, gdalnumeric.py). If you installed GDAL properly in step 2, you should see C:Program FilesGDALPython directory.
Anyway, if you installed GDAL in a different location, please check it. Run a search in your system for gdal.py, or ogr.py. The directory containing these files is the directory that should be pointed by PYTHONPATH.
As a quick test, execute the python console and simply write this:
import osgeo
What do you see? An error message? nothing?
Jorge,
I installed GDAL from your link ‘generic installed for gdal core components’ which was gdal-18-1310-core.msi
This installer installed GDAL under C:Program Files (x86)GDAL
But it did not install a python folder under the above.
And ‘import osgeo’ in a Python installer gives me an error like ‘…import error: no module named osgeo’
Also, i searched for gdal.py and ogr.py on my machine- i found them under a different application on my machine (QGIS) under gdal-17 (which i guess is not what we want anyway for this exercise).
Last, in your additional notes you refer to
“C:Program FilesPostgreSQL8.4binlibgdal.dll: Installed with PostGIS Windows experimental binaries, in step 4. Used by raster2pgsql.py script, to load raster data into PostgreSQL”
In my case, I have
C:Program Files (x86)PostgreSQL9.0binlibgdal-1.dll
I’m wondering if maybe i also have to install one of the other gdal?, namely
GDAL-1.8.0.win32-py2.7.msi from the other link in step 2 i.e
http://vbkto.dyndns.org/sdk/PackageList.aspx?file=release-1310-gdal-1-8-mapserver-5-6.zip
I have tried to follow the June 13th conversations but am still confused. Do i need to install BOTH gdal-18-1310-core.msi as well as GDAL-1.8.0.win32-py2.7.msi
or just one of these?
thanks again,
V
Hi,
My short answer is: install gdal-18-1310-core.msi, but I updated the post with some information. Please check step 2 again. I think it should solve your doubts.
Best regards,
Jorge
Jorge,
I managed to get it to work. But i did have to install both gdal-18-1310-core.msi as well as GDAL-1.8.0.win32-py2.7.msi
FYI, I’m trying it out and posting my experiments (and questions/solutions) here:
http://algoesalgo.wordpress.com/2011/07/21/experiments-with-postgis2-0-rasters/
And THANKS for your help!
Vishal
Hi,
Glad to see things working :-). And to help you, of course. I’ll carefully read your blog post and try to answer your questions. It’s nice to have the user’s feedback.
Just a comment. Your blog has a spanish name. Are you a spanish spoker?
Jorge, i speak some spanish, but am not a native speaker. for example i cant do technical spanish:) i am originally from India, live in Davis, California right now.
I am developing some geospatial information tools and would like to connect a bit more with the community. we are a non-profit research group and dont have in-house web-programming skills to develop the kinds of application i would like to. Still, I have some good experiences with GRASS-R-PHP -Postgis that I would like to take further…perhaps with interns or in some collaborative fashion…
cheers,
Vishal
Hi Jorge,
I was trying to do what you wrote regarding Postgis raster on Win, but I stacked somewhere…pls can you help me to solve this:
I downloaded postgis-pg84-binaries-2.0.0svn.zip and extracted on C, than I made all this changed in makepostgisdb.bat, and when run it as admin I got following massage in cmd:
C:Windowssystem32>”C:Program Files (x86)PostgreSQL9.0binpsql” -d “template_postgis20” -f “sharecontribpostgis-2.0postgis.sql”
share/contrib/postgis-2.0/postgis.sql: No such file or directory
Where I made mistake?
FYI, I Have Win 7 Pro, x64, postgresql 9.0 (x86)
Thak you in advance,
Kemal
Hello,
I don’t see any obvious mistake. Try to directly execute that line from console:
C:Program Files (x86)PostgreSQL9.0binpsql -d template_postgis20 -f sharecontribpostgis-2.0postgis.sql
You may want to include the complete path to postgis.sql before.
Anyway, you can manually execute all the commands included in the BAT file. Could you try it?
Hello
i’m installing gdal 1.8 and python 1.6 but when i commande in python console
from osgeo import gdal i’s not working error of module !
Thanks
Hello,
Which error are you getting from Python console? The exact text.
Did you test with?
import gdal
instead of
from osgeo import gdal
Traceback (most recent call last):
File “”, line 1, in
import gdal
ImportError: No module named gdal
Hello
i installed
Windows x86 MSI Installer (2.6.6) (sig)
numpy-1.6.1.win32-py2.6.exe
gdal MSV 2003
But This problem and Other question is what i wright in python console line, is that!
python C:Program FilesPostgresql8.4binraster2pgsql.py -r image.tif -t tablename -o image.sql
SyntaxError: invalid syntax : C: is colored by red
Thanks Jorge
good now is work when i make from osgeo import gdal ( when i install GDAL-1.8.0.win32-py2.6.exe with gdalMSV …)
But Now i work in python console and i have a image called torn.tiff in C : i write this in python console:
python C:Program FilesPostgresql8.4binraster2pgsql.py -r torno.tif -t tablename -o image.sql
thers is error :
SyntaxError: invalid syntax the caracter c is colored by red ( it’s accept pas C:)???????????????!!!!!!!
All THANKS(sorry of english 🙂
Hi,
Silly question, but did you enter the Python console or are you writing that directly in the command line (cmd.exe)?
Follow these steps:
1.- Start –> Run –> cmd.exe
2.- From command like (NOT entering python console) write this (or the equivalent with your paths):
python C:Program FilesPostgresql8.4binraster2pgsql.py -r torno.tif -t tablename -o image.sql
(You may get an error because python.exe is not part of the PATH enviroment variable. Add the path to python.exe to PATH in that case)
And don’t worry, I’m not a native english spoker 🙂
Thank you for this information
Then it’s back to the command (cmd.exe), after I set the directory python (python.exe) in the path:::
C: Python26 to PATH and
PYTHONPATH to C: Python26 Lib site-packages
But there are some errors in syntax near surtoout C: Program Files???
error : python cant’t open file ‘C:program’: No such file or directry
Hi, sorry for the delay
Are you sure the complete path does exist? Could you paste the whole line that caused that error?
cant’t open file ‘C:program’: No such file or directry
I mean the line that caused that error message
Currently, I stopped working on this but I will restart again. I think the history of the path that poses the problem
I will work to solve even
thank you
Jorge,
please i need your help on this,
I followed your instructions and conversations on biding GDAL on python, still this refused to work.
This is just a pain!
I still receive this error:
Traceback (most recent call last):
File “”, line 1, in
import gdal
File “C:Python27libsite-packagesgdal.py”, line 2, in
from osgeo.gdal import deprecation_warn
File “C:Python27libsite-packagesosgeo__init__.py”, line 21, in
_gdal = swig_import_helper()
File “C:Python27libsite-packagesosgeo__init__.py”, line 17, in swig_import_helper
_mod = imp.load_module(‘_gdal’, fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.
I really need to install postgis 2.0 for my research work.
When did you receive that error? What did you execute? What was you trying to do? I need the whole context
Looks like Windows is not detecting GDAL dll. What happens if you execute gdalinfo –formats from the command line (cmd.exe)? Any error message?
Yeah Jorge just saw your response now, i had to uninstall and install again, then configured properly the system’s environment variables and it eventually worked on the importing gdal.
Now succeded in binding GDAL on python, but i dont think this PostGIS Windows experimental binaries is running properly becuase it was saying some file can not be found while i ran it.
The template_postgis2.0 it created does not have a raster column.
I did not see any file like libgdal.dll in the postgres bin folder
I only saw 2 schemas the first one “public”
contain one table “raster_overviews”
and the second schema called “topology”
Please Jorge, how can i get this postgis2.0 working in my machine.
Does it has have both vector geometry functions as well as raster?
Thanks in advance.
About your question: yes, PostGIS 2.0 have both, vector and raster functions.
About your problem, I assume you followed my instructions. So, let’s see how all pieces work. First of all, which version of GDAL, Python, PostgreSQL and PostGIS are you using? I mean the concrete exe name tou used to install each program.
Now, perform these tests:
GDAL: execute gdalinfo –formats or gdalinfo –version in cmd. If there’re no errors, we can assume GDAL is properly installed (check version is 1.8.x)
Python: from cmd, execute python interpreter (simply write python and hit ENTER). If you see the Python command line, we can assume Python is properly installed
GDAL python bindings: from Python command line, write: import gdal. And hit ENTER. If you get an error “ImportError: No module named gdal”, the bindings are not installed.
PostgreSQL + PostGIS 2.0: Execute a PostgreSQL client (pgAdmin or psql) and connect to your template_postgis20 database (and tell me how many tables this schema has, and their names). Then, execute this query:
select postgis_full_version()
And paste here the information you get.
If any of these steps cause an error, paste it here, as detailed as possible.
Jorge,
both gdalinfo-format or version and python are said not recognised as an internal or external operable programs or batch files.
Could this be the problem?, but i called up python command line or the python GUI and typed ‘import gdal’ and it worked.
Is really tiring!
Jorge,
on the template_postgis20 database schema, i have only one table called raster_overviews
and i did ran this query : select postgis_full_version()
and it gave me this :
ERROR: function postgis_full_version() does not exist
LINE 1: select postgis_full_version()
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
********** Error **********
ERROR: function postgis_full_version() does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 8
Sorry I forgot to mention, i installed, numpy, Python 2.7, gdal-18-1310-core.msi as well as GDAL-1.8.0.win32-py2.7.msi, Postgres 9.0 and PostGIS Windows experimental binaries for 9.0.
Lyke,
You must add the GDAL installation path (C:Program FilesGDAL, I guess) to your enviroment variable PATH. Check the PostgreSQL bin path (C:Program FilesPostgreSQL9.0bin) is in PATH too.
And about PostGIS, the error tells me your database has not been spatially enabled. Delete the database “template_postgis20” and manually create it. Then, connect with it and execute, in order, the files:
1.- postgis.sql
2.- spatial_ref_sys.sql
3.- rtpostgis.sql
Thy should be in the directory created when you unzipped PostGIS Windows experimental binaries.
After this, your template_postgis20 database should have the tables:
– geometry_columns
– spatial_ref_sys
– raster_columns
– raster_overviews
Jorge, thanks for this help, we really have to get this working on my system.
I have added the directory paths for GDAL and PosgreSQL as you said.
Deleted and Created manually the templete_postgis20 table
then try to execute the first file postgis.sql on this table
comes this error message:
ERROR: could not access file “$libdir/postgis-2.0”: No such file or directory
********** Error **********
ERROR: could not access file “$libdir/postgis-2.0”: No such file or directory
SQL state: 58P01
Jorge,
in which directory should i unzipp this folder, postgis-pg90-binaries-2.0.0svn
becuase I discovered that when i run the ‘makepostgisdb’ file, nothing is copied from this postgis-pg90-binaries-2.0.0svn folder.
Becuase it says File not found, 0 File copied.
That means all the neccesary files that should be copied from that folder to postgres directory are not copied. Which are supposed to be copied in by this statements
xcopy bin*.* “%PGBIN%”
xcopy /I /S binpostgisgui* “%PGBIN%postgisgui”
xcopy lib*.* “%PGLIB%”
Ok. So, the problem is your “PostGIS enviroment” hasn’t been set, and the DLL files are not found. Execute the BAT file from the command line, to see the output (not from the Windows explorer).
Unzip the file wherever you want. The important thing is to execute the BAT file. Once unzipped, the files under ‘bin’ directory are copied to PGBIN, and ‘lib’ files are copied to PGLIB. Ensure these enviroment variables point to the right directories: the ‘bin’ and ‘lib’ directories of your PostgreSQL installation. Probably:
– C:Program FilesPostgreSQL9.0bin
– C:Program FilesPostgreSQL9.0lib
And your welcome 🙂
Jorge, please can you give me a little bit detail on this command line execution?.
Because when i click Run as Administrator, it automatically executes it on the ‘black’ command line. Am really not too sure of what to do right now.
You need to run cmd.exe (the ‘black’ command line) in Administrator mode. So:
– If you’re running Windows 2000/XP, open the file explorer and go to C:WindowsSystem32. Locate cmd.exe, right click on it and select “Run as administrator”.
– If you’re running Windows Vista/7, follow these instructions http://www.softwareok.com/?seite=faq-Win-7&faq=23
Once a command line is opened, go to the directory where the bat file is located. So, if you unzipped the PostGIS binaries at C:postgis-pg90-binaries-2.0.0svn, write in command line:
cd C:postgis-pg90-binaries-2.0.0svn
Then, execute the bat file, writing in the command line:
makepostgisdb.bat
You will see the bat execution option. If there’s a problem, an error will be raised. I recommend you to make a screenshot of the command line and paste it here.
Jorge,
i was trying to paste the screenshot here, but am not sure if images can be pasted here because it could not be pasted. If there another way i can send u the screen shot, please i will glad to do that immediately.
There were errors everywhere that the files don’t exist.
Send me an e-mail to jorge.arevalo@deimos-space.com
Thanks Jorge,
I have sent you an email.
Thanks for the information, It really works fine.
Good to hear that :-). Thank you
Hai Jorge, thanks for the information.
I have try this on my windows 7 but those steps do not give same result.
There is no PostGIS Raster in my PostgreSQL tree (but you have , based on screenshot above).
Can you give me advices about that? Please send me by email to wendiadriansaga@yahoo.com.
Thank you.
Hi Wendi,
I’ve responded you in the postgis-users list.
Hi Jorge,
can you let me know how to install Mercator and PostGIS Raster which are displayed on screenshot of SHP2PGSQL GUI installed under pgAdmin III above?
Because they are not appear on my PostgreSQL.
Please advise. Thanks.
Hi Wendi,
I’ve used the list to response you (because the wider audience) and I’ve updated the post again. Now, it should work.
Best regards
HI,
I have followed all your step to install postresql in my machine having OS windows 7 home premium.As such I installed python 2.7, related numpy extension(i.e.numpy-1.5.1-win32-superpack-python2.7), GDAL core and binding( GDAL-1.8.0.win32-py2.7)as well. I create the environment for GDALtoo. After that I install PostgreSQL 9.1 and PostGIS 2.0. Up to this everything is ok. I can create a table with a data type raster as well as geometry. Now the Problem in loading *.tif file using raster2pgsql.py with command line. Error is as :
Traceback (most recent call last):
File “C:Program FilesPostgresql9.1binraster2pgsql.py”, line 34, in
from osgeo import gdal
File “C:Python27libsite-packagesosgeo__init__.py”, line 21, in
_gdal = swig_import_helper()
File “C:Python27libsite-packagesosgeo__init__.py”, line 17, in swig_impor
t_helper
_mod = imp.load_module(‘_gdal’, fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.
C:Python27>
So here is the error in the first line of the file raster2pgsql.py while importing gdal.
Can you please give me idea regarding this problem.
Regards,
Deepak
Hello,
Your system can’t find the GDAL dll. It should be placed at C:Program FilesPostgreSQL9.1binlibgdal.dll
Please check that file exists, and add C:Program FilesPostgreSQL9.1bin to your system path (PATH enviroment var). Then check raster2pgsql again.
Hello jorgearevalo,
Thanks for your reply.
In the place C:Program FilesPostgreSQL9.1bin there is libgdal-1.dll instead of libgdal.dll. However I set the system path for C:Program FilesPostgreSQL9.1bin and still not working. Shall I have to change libgdal-1.dll to libgdal.dll or not?
with best regards,
Deepak
Hello,
Yes, change the name to libgdal.dll and test again.
Best regards,
Jorge
Hi,
Sorry, again same error it does not work even I changed the dll name. What can be the problem.
best regards
Deepak
Hi Jorge,
Though I have install PostGIS 2.0, I think there was a problem in the installation of it thats why I am facing the problem mentioned above. Actually when I first run the makepostgisdb.bat it gave error even in copying file from Postgis unzipped folder to postgresql folder. Later I did first four step of makepostgisdb.bat file manually i.e. copied my self in the respective folder of postgresql. These are the following four steps
xcopy bin*.* “%PGBIN%”
xcopy /I /S binpostgisgui* “%PGBIN%postgisgui”
xcopy /I plugins.d “%PGADMIN%plugins.d”
xcopy lib*.* “%PGLIB%”
And then I removed these four line and run the batch file with administrator and it runs with some error. When I connected the database with pgadmin I found only three table in postgis 2.0 templete and are:
– spatial_ref_sys
– raster_columns
– raster_overviews
where as geometry_column and geography_column appear in a views folder.
So now I can create the raster and vector table using script by create command but facing problem in loading thats why my intuition is that there is problem in running the batch file.
I though it might be security issue of windows 7 and even disable the firewall and antivirus and run the batch file from command prompt but still not working .
Hope you can give me best solution.
thanks
best regards,
Deepak
Mmm… not sure. I’m not a Windows user. Try starting a Python console and simply importing gdal module:
from osgeo import gdal;
Are you getting the same error?
Maybe there are some changes in the latest Postgis 2.0.0 binaries, because it worked before, but now I’m getting the same error. I tried this with Postges 8.4 and 9.0, Python 2.6.6 and 2.7.1. No change. I’m getting the same error from Python console.
Are you getting the GDAL error too?
Yes, the same error like Deepak discribed it.
Try the same solution I’ve proposed to him: open a Python console and load the gdal module, if possible:
from osgeo import gdal
Hi Jorge,
Earlier there was an error when I executed from osgeo import gdal from Python conlsole. I forgot to set C:Program Files (x86)GDAL to my PATH environment variable (I’m on 64 bit Windows 7). Now it works. Thanks!
Regards,
Dimitar
Hi Jorge,
Yes earlier there was error on running the from osgeo import gdal . Then I again install binding and set again path variable now I can load raster via raster2pgsql.py loader.
But I would like share the problem in running makepostgisdb.bat file in windows .As mentioned in my earlier post while running batch file it still unable to copy the files from postgis bin, lib etc to postgresql bin , lib etc. I did manually these things and run the batch file by removing these lines.
Yes I able to run now the batch but it runs with error and finally I obtained three table in templete_postgis20 folder as
– spatial_ref_sys
– raster_columns
– raster_overviews
where as geometry_column and geography_column appear in a views folder.
Anyway,so far I have access some functions related to raster and they work well if I get error in some case of-course I remember you on that time. Thanks
Another things I would like to know about the source code for raster datatype especially “geomval” how it construct. Do you have idea about it if yes can you please provide me the link for it . Thanks a lot.
Regards,
deepak
Hi,
Yes, geometry_columns and geography_columns are views, but I don’t work in that area. If you want further information on the topic, try asking the postgis-devel list.
About geomval datatype, is defined here http://trac.osgeo.org/postgis/browser/trunk/raster/rt_core/rt_api.h#L1287
The datatype was thought to hold all the adjacent pixels sharing a value, but as a geometry (polygonized).
Best regards,
Jorge
Thanks a lot Jorge
You’re welcome 🙂
Hello dear Jorge,
-I have a error message when i try to generate this SQL file (command line C:Program FilesPostgresql9.0binraster2pgsql.py -r image.tif -t tablename -o image.sql ) :
python : can’t open file ‘C:Program’: [Errno2] No such file or directory
-However, when i try to load sql file in my data base via command line (psql -h localhost
-U postgres -d template_postgis20 -f image.sql), all seems ok and i have not error message.
.According to my configuration and installation is ok?
.How to load a sql file via pgadmin 3?
Could you throw light for me please?
Have a good sunday?
Laurent Celati.
Hello Laurent,
You should add C:Program FilesPostgresql9.0bin to your PATH enviroment variable. Other way, you could change to that directory in your command line:
cd “C:Program FilesPostgresql9.0bin”
And then execute raster2pgsql without the path
raster2pgsql.py -r /path/to/image.tif -t tablename -o image.sql
But I’d chose the first option (add the path to PostgreSQL bin directory to PATH variable)
To load a SQL file via pgAdmin III, you need to:
1.- Open pgAdmin III and open a connection to your database
2.- Click in the SQL button in the menu bar
3.- In the new Window, choose “Open” and select your SQL file
4.- Once the file is open, Click on the “play” button (or hit F5 in your keyboard). This will execute the sql file against your database, like psql does.
Best regards,
Jorge
Hello,
Thank you for your reply. i have suceed in generating and loading sql file in my databse.
What is the next step ? How import raster file (tiff for instance) in my databse? Sorry if my question seems idiotic but i’m a thematic geograph and i ‘ m starting out with data base and postgis…
Thank you to throw light for me.
Laurent Celati.
Dear Jorge,
Thank you for your reply. I have succed in generating sql file in my database. Is there a next step ? How import raster files (.tiff for instance) in my database now?
i ‘m sorry if my question seems idiotic but i ‘m start out with data base.
Thank to throw light for me.
Laurent.
Dear Jorge,
Thank you for your last reply. I have suceed in generating and loading sql file in my
database.
What is the next step ? How import raster file (tiff for instance) in my databse? Sorry
if my question seems idiotic but i’m a thematic geograph and i ‘ m starting out with data
base and postgis?
Thank you to throw light for me.
Laurent Celati.
Hello,
If you’ve loaded the SQL file generated by raster2pgsql.py into your PostGIS Raster-activated database, you actually got it. The raster file you specified with ‘-r’ parameter is imported in your database.
If you wanna see your data, check http://trac.osgeo.org/postgis/wiki/WKTRaster#DisplayingPostGISrasters
Anyway, the PostGIS Raster visualization is related with the GDAL PostGIS Raster driver. You can use it (GDAL 1.8.0 or superior. Check http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html), but It’s under development. I’d love to devote more time to this task, and I’m actually working on it (until end of 2011, I couldn’t work on it harder). Stay tuned, because I’ll notifiy here when I finish a complete and stable version.
And don’t worry about questions. I’m the first one with a looooooot of things to learn. I still consider myself as a ‘GIS n00b’ 🙂
Hi
I’ve gone through your instructions to add postgis raster.
When I renamed libiconv-2.dll the batch file wouldn’t run as it couldn’t fine the dll.
Running the batch without renaming the dll was somewhat successful. The postgis_template20 is there but when I check the new database with the postgis 2.o template with select postgis_full_version() I get the error ERROR: function postgis_full_version() does not exist.
If you could help it would be much appreciated.
If you need a copy of the batch file run I can send it along.
Bob