Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi GIS Stackoverflow people,

I wanted to use the PostGIS functionality raster2pgsql, but I had to discover that the Python function was not installed with my PostGIS installation.

Do you know if raster2pgsql is generally part of the PostGIS installation or do I have to install a special package?

I installed PostGreSQL and PostGIS on my mac via homebrew. > brew upgrade postgis tells my that the latest version is installed, which is obviously not the case (1.5.3 installed, but 1.5.5 available).

The complete installation is

select PostGIS_full_version();
POSTGIS="1.5.3" GEOS="3.3.2-CAPI-1.7.2" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.3" USE_STATS

Thank you for your answer!

share|improve this question
up vote 3 down vote accepted

According to the latest PostGIS docs on loading raster data:

The older version of this tool was a python script. The executable has replaced the python script. If you still find the need for the Python script Examples of the python one can be found at GDAL PostGIS Raster Driver Usage. Please note that the raster2pgsql python script may not work with future versions of PostGIS raster and is no longer supported.

To the question about versions, homebrew doesn't provide the latest version of a software package, it just provides the latest version that someone has packaged for homebrew. If the absolute latest isn't up there, then you won't get the absolute latest. An alternative source is KyngChaos.

If you are looking for the latest in raster processing for PostGIS I suggest checking out WKTRaster, too.

share|improve this answer

For PostGIS 1.5, there is no way to be using the latest raster support in PostGIS. You will need to be on PostGIS 2.0 for the latest public release.

BUT for your needs, you can simply download the python script from raster/scripts/python/ from any recent source tarball. I think you'll need numpy though...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.