New Method With PostgreSQL 9.1
Thanks to the advice of R.K. below, I took a look at this tutorial and found that for PostgreSQL 9.1 all you need to do is add the extensions postgis and postgis_topology to an existing database using the pgAdmin context menus. To create a postgis template, I created a new database called template-postgis and then added these ...
If you are running PostgreSQL 9.1+, you don't need to bother with the template database. Just create a database and then on the SQL view in pgAdmin, type and run
CREATE EXTENSION postgis;
That will spatially enable your database.
You are trying to mix different things:
1) You want to use the Homebrew version of QGIS:
Everything must be installed by Homebrew as binaries and libraries in /usr/local/Cellar with symbolic links in /usr/local/bin, GDAL/OGR, QGIS, ....
the Homebrew QGIS version uses the Homebrew Python version with modules in /usr/local/lib/python2.7/site-packages
All the ...
When you look at the grass-70 recipe info from homebrew, you'll see:
Rainers-MacBook-Pro:~ rainerkrug$ brew info grass-70
osgeo/osgeo4mac/grass-70: stable 7.0.1
Geographic Resources Analysis Support System
/usr/local/Cellar/grass-70/7.0.1 (3708 files, 83M) *
Built from source with: --with-mysql --with-postgresql --with-liblas
I had the same problem and figured it out. You did brew tap osgeo/osgeo4mac before and thereby expanded your brew with the osgeo-tap. The repository documentation mentions they are currently 'renaming' formulae. It turns out they're renaming formula postgresql to osgeo-postgresql etc. So my trick was to type on the shell:
for f in libgeotiff libspatialite ...
In Processing options (alt+ cmd+ c), in GRASS GIS 7 commands deselect Activate button and delete path in GRASS7 folder slot. Do the same with GRASS commands.
I did it to work with R and works. But if this not work for you, install GRASS disabling SIP and change path.
As @Deo_Leung reported, the OSGeo Github is your friend. But it is even easier:
brew tap osgeo/osgeo4mac
#brew search gdal (if you want to see the various available versions)
brew install gdal2
Start it and grab a coffee, as it is doing a real make behind the scene ;-)
Check as well the output to add the correct symlinks
IMHO homebrew will be best/easiest, once their build issues are fixed. They are on the case, so if you have a GitHub account you may want to subscribe to notifications on the relevant issue - that way you'll know the moment it is available: https://github.com/Homebrew/homebrew/pull/42845
I just tried the Python easy_install route and it blew up my meagre ...
If you want to use the Kyngchaos's version of QGIS, you should use his version of GDAL/OGR (Framework in /Library/Frameworks/GDAL.framework). This version also installs the Python osgeo module (in /Library/Python/2.7/site-packages because QGIS use the Apple Python).
If you want to use the Homebrew version of GDAL/OGR (library in /usr/local/Cellar with ...
The GDAL version of QGIS:
If you use the QGIS version of KyngChaos (framework), it uses the version of GDAL which is in:
/Library/Frameworks/GDAL.framework/Versions/1.9 (or 1.8, 1.10)
and has nothing to do with Homebrew.
If you want to use the Kyngchaos version of GDAL in the shell:
or write in the .bash_profile file in your Home folder:
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/raster2pgsql.py from any recent source tarball. I think you'll need numpy though...
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 ...
in fact this is the foundation of postgis installation.
if you have postgis template you can create a new database from it as :
createdb -T postgistemplate -O gis gisdb
if you not have it, you can do this with this way:
sudo su postgres
createlang plpgsql postgistemplate
psql -d postgistemplate -f /usr/share/postgresql-8.2-...
As far as I remember there is some script available for the workshop to create those template databases. It's also available here: https://github.com/pgRouting/pgrouting-contrib/blob/master/scripts/create_templates.sh
Eventually you need to change a few things here and there, because it was written to work for Debian/Ubuntu. But you can just pick what you ...
I know it's been 5 months since this question was posted, but I thought I'd add in my $.02. I, too, had the problem of ogr2ogr not being able to connect.
In my case, it turned out that ogr2ogr expects the mysql.sock file to be in /tmp/. If you're running MAMP, your sock file is actually located in /Applications/MAMP/tmp/mysql/mysql.sock. Creating a ...
=== Work on My Mac ===
I hope this can solve your problem to.
The problem because Qgis Connect with TCP / IP protocol, refer to this link : http://hub.qgis.org/issues/735
QGIS uses tcp/ip connections to PostgreSQL, regardless of whether both client and server are on the same host. You can configure PostgreSQL to accept such connections as trusted, however ...
After a whole day of trial & error, I found one possible solution.
The PostGIS website describes the hard upgrade path, which boils down to the following steps:
Dump the entire database
pg_dump -h localhost -p 5432 -U postgres -Fc -b -v -f "/somepath/olddb.backup" olddb
Initialize and enable PostGIS on the new database.
Run the restore utility
If you are already working with conda a better option would be to install GDAL 2.1 though conda rather than trying to install via homebrew and use this version with conda (which is likely to cause conflicts between different versions of packages). The conda-forge community packages have a version of GDAL 2.1 built with support for JPEG2000 via the OpenJPEG ...
Mac OS X is an Unix system where the paths and the links are very important and you are mixing two things (look at QGIS on Mavericks, Error Updating Gdal with Homebrew or QGIS python location problem, for example).
In short, the installation paths and the links are different:
Homebrew uses libraries and executables installed in /usr/local/Cellar with ...
I covered this issue in this article.
In a nutshell, PostGIS 2.4 only adds in new functions, so you can simply copy your postgis-2.4., rtpostgis-2.4. and call it postgis-2.3., rtpostgis-2.3. in your new instance.
I was able to install PostGIS on OSX an old Postgres version without upgrading or manual compilation using Pex:
git clone git://github.com/petere/pex.git
sudo make install
pex install postgis
CREATE EXTENSION postgis;
I missed this thread and had much the same question.
Mac version 1.3 still works for some purposes (data translation with ogr2ogr is all I've tested so far) if installed as a shared gdal plugin. @dakcarto maintains a homebrew formula for doing this: