Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • M mapnik3
  • Project information
    • Project information
    • Activity
    • Members
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
Collapse sidebar
  • 周峰
  • mapnik3
  • Wiki
  • MacPostGIS_Setup

MacPostGIS_Setup · Changes

Page history
clone mapnik wiki from github. authored May 14, 2021 by 周峰's avatar 周峰
Hide whitespace changes
Inline Side-by-side
MacPostGIS_Setup.md 0 → 100644
View page @ 8516de00
<!-- Name: MacPostGIS_Setup -->
<!-- Version: 4 -->
<!-- Last-Modified: 2008/11/10 13:47:55 -->
<!-- Author: springmeyer -->
## Mac PostGIS / Postgres Setup
After you have installed PostgreSQL and PostGIS you will need to perform further setup before you can begin to use them with mapnik.
* Setup for *Binaries/Frameworks* from [kyngchaos.com](http://www.kyngchaos.com/wiki/software:frameworks).
* Add the bin and man page directories to your path (assumes bash shell which is default on 10.5). You may create or append the ~/.profile with the following:
```sh
export PATH=/usr/local/pgsql/bin:$PATH
export MANPATH=/usr/local/pgsql/man:$MANPATH
```
* Register your changes
```sh
$ source ~/.profile
```
You should now be able to type the following from any directory and see the man page.
```sh
$ man psql
```
* Create a database. The installer you used from [kyngchaos.com](http://www.kyngchaos.com/wiki/software:frameworks) automatically created a Mac OS user on your system named postgres. Use that user to create a new database user/role and setup the database. (change "gisuser" to your liking)
```sh
$ sudo -u postgres -i
$ createuser gisuser
$ createdb -E UTF8 -O gisuser mapnik
$ createlang plpgsql mapnik
```
* Alternatively you can run all commands from your normal shell user but use the '-U' flag to call them as the postgres user:
```sh
$ createdb -E UTF8 -U postgres <dbname>
$ createlang plpgsql -U postgres <dbname>
```
* PostGIS support must be enabled for each database that requires its usage. This is done by feeding the lwpostgis.sql (the enabler script) file to the target database.
```sh
$ psql -d mapnik -f /usr/local/pgsql/share/lwpostgis.sql
$ psql -d mapnik -f /usr/local/pgsql/share/spatial_ref_sys.sql
$ echo "ALTER TABLE geometry_columns OWNER TO gisuser; ALTER TABLE spatial_ref_sys OWNER TO gisuser;" | psql -d mapnik
```
At this point your database should be setup to create a PostGIS table.
TODO - full example showing PostGIS use.
\ No newline at end of file
Clone repository
  • A perfect testcase
  • API changes between v2.0 and v2.1
  • API changes between v3.0 and v3.1
  • AWS Lambda
  • About Mapnik
  • AlsoFilter
  • Api changes between v2.1 and v2.2
  • Api changes between v2.2 and v2.3
  • Api changes between v2.3 and v3.0
  • ArchInstallation
  • Aspect Fix Mode
  • Benchmark Notes
  • BoundsClipping
  • BrokenExceptions
  • BuildingSymbolizer
View All Pages