• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H18-Dec-2021-319277

build-aux/H07-May-2022-15,07711,345

ci/H18-Dec-2021-2,2251,552

deps/H18-Dec-2021-28,75722,734

doc/H03-May-2022-1,069,009960,119

extensions/H18-Dec-2021-27,73923,654

extras/H18-Dec-2021-25,29320,706

fuzzers/H03-May-2022-1,019775

liblwgeom/H03-May-2022-89,98662,821

libpgcommon/H18-Dec-2021-2,8261,803

loader/H07-May-2022-16,90310,840

macros/H18-Dec-2021-13,39012,076

postgis/H07-May-2022-50,10835,122

raster/H18-Dec-2021-101,65576,377

regress/H03-May-2022-55,93650,594

sfcgal/H18-Dec-2021-1,190774

topology/H18-Dec-2021-24,97120,209

utils/H03-May-2022-6,8625,694

.cirrus.ymlH A D18-Dec-20211.5 KiB3633

.clang-formatH A D18-Dec-20213.1 KiB111109

.cloud-drone.ymlH A D18-Dec-2021628 2723

.drone-1.0.ymlH A D18-Dec-2021835 3530

.editorconfigH A D18-Dec-20211.4 KiB7456

.gitattributesH A D18-Dec-2021155 98

.gitignoreH A D18-Dec-20214.8 KiB200197

.gitlab-ci.ymlH A D18-Dec-20211 KiB3734

.mailmapH A D18-Dec-2021165 43

CONTRIBUTING.mdH A D18-Dec-20211 KiB2014

COPYINGH A D18-Dec-202117.7 KiB340281

CREDITSH A D18-Dec-2021147 53

ChangeLogH A D18-Dec-20217 KiB194153

GNUmakefile.inH A D18-Dec-20215.1 KiB218162

MIGRATIONH A D18-Dec-20217.2 KiB183140

MakefileH A D18-Dec-2021771 2922

NEWSH A D18-Dec-2021127.8 KiB2,9522,609

README.mdH A D18-Dec-20212.8 KiB3525

README.postgisH A D18-Dec-20219.9 KiB306204

SECURITY.mdH A D18-Dec-20211.6 KiB4230

STYLEH A D18-Dec-20212.4 KiB8864

TODOH A D18-Dec-20212.5 KiB5738

Version.configH A D18-Dec-2021755 2317

aclocal.m4H A D18-Dec-20212.5 KiB6659

astyle.shH A D18-Dec-20211.2 KiB4420

autogen.shH A D18-Dec-20212.1 KiB9569

configureH A D18-Dec-2021802.2 KiB26,64621,047

configure.acH A D18-Dec-202162.5 KiB1,8521,536

libtoolH A D18-Dec-2021340.1 KiB11,9128,270

postgis_config.h.inH A D18-Dec-20213.2 KiB13489

postgis_revision.hH A D18-Dec-202133 21

spatial_ref_sys.sqlH A D18-Dec-20217.6 MiB34,3018,511

README.md

1
2| **GitHub** | **GitLab** | **Drone.io** ||
3| :---: | :---: | :---: | :---: |
4| [![CI](https://github.com/postgis/postgis/workflows/CI/badge.svg?branch=master)](https://github.com/postgis/postgis/actions?query=branch%3Amaster) |  [![Gitlab-CI](https://gitlab.com/postgis/postgis/badges/master/pipeline.svg)](https://gitlab.com/postgis/postgis/commits/master) |  [![Build Status](https://cloud.drone.io/api/badges/postgis/postgis/status.svg?branch=master)](https://cloud.drone.io/postgis/postgis?branch=master) ||
5| **Debbie** | **Winnie** | **Dronie** ||
6| [![Build Status](https://debbie.postgis.net/buildStatus/icon?job=PostGIS_trunk)](https://debbie.postgis.net/view/PostGIS/job/PostGIS_trunk/) | [![Build Status](https://winnie.postgis.net/buildStatus/icon?job=PostGIS_trunk)](https://winnie.postgis.net/view/PostGIS/job/PostGIS_trunk/) | [![Build Status](https://dronie.osgeo.org/api/badges/postgis/postgis/status.svg?branch=master)](https://dronie.osgeo.org/postgis/postgis?branch=master) ||
7| **Bessie** | **Bessie32** | **Cirrus-ci** |  |
8|  [![Build Status](https://debbie.postgis.net/buildStatus/icon?job=PostGIS_Worker_Run%2Flabel%3Dbessie)](https://debbie.postgis.net/view/PostGIS/job/PostGIS_Worker_Run/label=bessie/) |  [![Build Status](https://debbie.postgis.net/buildStatus/icon?job=PostGIS_Worker_Run%2Flabel%3Dbessie32)](https://debbie.postgis.net/view/PostGIS/job/PostGIS_Worker_Run/label=bessie32/) |  [![Build Status](https://api.cirrus-ci.com/github/postgis/postgis.svg?branch=master)](http://cirrus-ci.com/github/postgis/postgis) |  |
9| **Berrie** | **Berrie64** | | |
10|  [![Build Status](https://debbie.postgis.net/buildStatus/icon?job=PostGIS_Worker_Run/label=berrie&build=last:${params.reference=refs/heads/master})](https://debbie.postgis.net/view/PostGIS/job/PostGIS_Worker_Run/label=berrie/) |  [![Build Status](https://debbie.postgis.net/buildStatus/icon?job=PostGIS_Worker_Run/label=berrie64&build=last:${params.reference=refs/heads/master})](https://debbie.postgis.net/view/PostGIS/job/PostGIS_Worker_Run/label=berrie64/) | | |
11
12This file is here to play nicely with modern code repository facilities.
13Actual readme is [here](README.postgis).
14
15## Official code repository, issue tracker and wiki:
16https://trac.osgeo.org/postgis/
17
18## Official chat room:
19
20Official chat room is the [#postgis:osgeo.org](https://matrix.to/#/#postgis:osgeo.org)
21Matrix room, also bridged to the irc://irc.libera.chat/#postgis
22[IRC](https://en.wikipedia.org/wiki/Comparison_of_Internet_Relay_Chat_clients) channel
23([web client](https://web.libera.chat/#postgis) may be useful)
24
25## Official source tarball releases
26
27http://postgis.net/source
28
29If you would like to contribute to this project, please refer to our
30[contributing guidelines](CONTRIBUTING.md).
31
32## Project Home Page and Manuals
33Project homepage: http://postgis.net/
34PostGIS Manuals: http://postgis.net/documentation
35

README.postgis

1PostGIS - Geographic Information Systems Extensions to PostgreSQL
2=================================================================
3
4:Version: 3.2.0
5:Date: 2021-12-17
6:Website: https://postgis.net
7
8This distribution contains a module which implements GIS simple features, ties
9the features to R-tree indexing, and provides many spatial functions for
10accessing and analyzing geographic data.
11
12Directory structure::
13
14  ./            Build scripts and install directions
15  ./deps        Extra dependencies
16  ./doc         PostGIS Documentation
17  ./extensions  Support for the PostgreSQL Extensions framework
18  ./extras      Various pieces that didn't belong to mainstream
19                (package management specfiles, WFS_locks
20                  , sample WKB parser, postgis_tiger_geocoder)
21  ./liblwgeom   LWGEOM geometry library
22  ./libpgcommon PostGIS library to bridge LWGEOM to PostgreSQL
23  ./loader      A program to convert ESRI Shape files into SQL text suitable
24                for uploading into a PostGIS/PostgreSQL database and a program
25                for converting PostGIS spatial tables into shapefiles
26  ./postgis     PostGIS library source code
27  ./raster      PostGIS rasters extension source code
28  ./regress     Online regression tests
29  ./topology    PostGIS topology extension source code
30  ./utils       Utility scripts for PostGIS (upgrade, profiling, ...)
31
32
33REQUIREMENTS
34------------
35
36PostGIS is compatible with PostgreSQL 9.6 and above.
37
38You *must* have the full PostgreSQL - including server headers - installed for
39this to work.
40
41* PROJ4 (Required, Version 4.9.0 or higher):
42
43  The PROJ4 catographic projection library is required if you want to use the
44  ST_Transform() function to reproject features within the database.
45
46    https://proj.org
47
48* GEOS (Required, Version 3.6 or higher)
49  - 3/10+ for ST_MakeValid enhancements
50  - 3.9+ is needed to take advantage of
51    fixed precision enhancements in overlay functions
52  - 3.7+ is needed just for the ST_FrechetDistance function
53
54  The GEOS library provides support for exact topological tests such as
55  ST_Touches(), ST_Contains(), ST_Disjoint() and spatial operations such as
56  ST_Intersection(), ST_Union() and ST_Buffer().
57
58    http://trac.osgeo.org/geos/
59
60* XML SUPPORT (Required, Version 2.5.0 or higher):
61
62  The LibXML2 library is required to use the ST_GeomFromGML() and
63  ST_GeomFromKML() functionality.
64
65    http://xmlsoft.org/
66
67* GNU gettext
68
69  The loader, and hence PostGIS, requires GNU gettext 0.14 or higher
70  for translation support
71  (typically in libc on GNU/Linux, in which case 0.17 is required).
72
73* JSON-C (Optional, Version 0.9 or higher)
74
75  JSON-C is used to import GeoJSON via the function ST_GeomFromGeoJson().
76
77    http://github.com/json-c/json-c/wiki
78
79  You can get it installed in apt-based systems using:
80
81    apt-get install libjson0-dev
82
83* GDAL (Optional, Version 2 or higher 3+ is strongly recommended)
84
85  GDAL (http://gdal.org) is *required* if you want to compile PostGIS
86  with raster support. To compile without raster support you
87  must ``./configure --without-raster``
88
89* CGAL 4.1+ and SFCGAL 1.3.2+ (Optional) needed for advanced 3D support
90
91  https://github.com/Oslandia/SFCGAL
92
93* protobuf-c (Optional, Version 1.1.0 or higher)
94
95  The protobuf-c library and compiler is required for ST_AsMVT and
96  ST_AsGeobuf output. Also, pkg-config is required to verify the correct
97  minimum version of protobuf-c.
98
99    https://github.com/protobuf-c/protobuf-c
100
101  To get packages on apt-based systems:
102
103    apt-get install libprotobuf-c-dev protobuf-c-compiler
104
105CONFIGURATION
106-------------
107
108To configure PostGIS, run::
109
110  ./configure
111
112If the file is missing you must be using a development version
113of the code. In that case call ./autogen.sh to generate it.
114
115The results of the configuration can be easily seen within the
116``postgis_config.h`` file.
117
118If ``pg_config`` can't be found in your ``$PATH`` configure will complain
119and refuse to proceed. You can specify it using the
120``--with-pgconfig=/path/to/pg_config`` flag.
121
122If PROJ4 has been installed but cannot be found, configure will complain and
123refuse to proceed. You can specify an alternative installation directory using
124the ``--with-projdir=DIR`` option.
125
126If GEOS has been installed but cannot be found, configure will complain and
127refuse to proceed. You can specify an alternative ``geos-config`` file using
128the ``--with-geosconfig=/path/to/geos-config`` option.
129
130If GDAL cannot be found, configure will complain and refuse to proceed.
131You can either proceed without raster support using ``--without-raster``
132or use ``--with-gdalconfig=/path/to/gdal-config`` option.
133
134By default, both Topology and Raster extensions are enabled in ``./configure``.
135
136If you want to compile PostGIS *without* Raster support,
137you must provide the ``--without-raster`` option.
138
139If you want to compile PostGIS *without* Topology support,
140you must provide the ``--without-topology`` option.
141
142If you want to compile PostGIS *without* Protobuf formats support,
143you must provide the ``--without-protobuf`` option.
144
145PostGIS will be compiled with sfcgal support if it is found.
146You can explicitly state the location with --with-sfcgal=path/to/sfcgal
147
148See ``./configure --help`` for more options.
149
150
151BUILD
152-----
153
154PostGIS uses the GNU make (aka gmake) for building. To build PostGIS library
155and utilities, as postgres run::
156
157  make
158
159
160TESTING
161-------
162
163You want to run regress tests before installation. To do so, as postgres run::
164
165  make check
166
167The above will create a test database with PostGIS extensions, run tests and
168then drop the test database.
169
170Final lines of output contain a summary of test results: run, succeeded,
171failed. If you have any failure please file a bug report using the online bug
172tracker: http://trac.osgeo.org/postgis/report/3
173
174DEBUGGING
175---------
176
177The normal build and testing procedure might not be enough for development and
178debugging as that requires a debug build of PostgreSQL and other proper compilation
179flags throughout. A way to get such an environment is to use the same docker images
180as the PostGIS CI setup and that can be done on a *nix host by first running this
181in a cloned postgis repository to later get core dump log output:
182
183> sudo bash ./ci/travis/logbt --setup
184
185Then you can run the following to get a docker container up and running with the
186correct requirements already in place and the postgis repository (at `/postgis`)
187mounted into it:
188
189> docker run -it --mount type=bind,source=/postgis,target=/src/postgis \
190postgis/postgis-build-env:pg13-geos39-gdal31-proj71 /bin/bash
191
192And finally the following command inside the container will build and run all the
193postgis tests:
194
195> bash ./ci/travis/run_usan_gcc.sh
196
197You can make customized versions of `run_usan_gcc.sh` to run only specific tests
198and skip redundant steps.
199
200If you need to get debug level logging in the PostgreSQL logs you can get it by
201manipulating configuration in the container. Add these lines after the `./configure`
202step:
203
204```sh
205sed -i 's/POSTGIS_DEBUG_LEVEL [0-9]$/POSTGIS_DEBUG_LEVEL 4/' postgis_config.h
206sed -i 's/#log_min_messages = warning/log_min_messages = debug5/' \
207/var/lib/postgresql/postgresql.conf
208```
209
210Note that PostgreSQL logs are directed to `/tmp/logfile` in fx. `run_usan_gcc.sh`.
211
212INSTALLATION
213------------
214
215To install PostGIS library and utilities, as root run::
216
217  make install
218
219Installation paths will typically be derived by ``pg_config``:
220
221 - Lib in ``pg_config --pkglibdir``
222 - Binaries (loader/dumper) in ``pg_config --bindir``
223 - Important support files in ``[prefix]/share/contrib``
224 - Manual pages in ``[prefix]/man``
225 - Documentation in in ``[prefix]/share/doc``
226
227Where `[prefix]` above is extracted from ``pg_config --configure``.
228
229You can change them using ``./configure`` switches. See CONFIGURATION section.
230
231
232CREATING NEW SPATIAL DATABASES
233------------------------------
234
235PostGIS support must be enabled for each database that requires its usage.
236Enabling spatial functionality requires a PostgreSQL super-user.
237
238    CREATE EXTENSION postgis;
239
240
241UPGRADING EXISTING SPATIAL DATABASES
242------------------------------------
243
244Upgrade PostGIS using the "ALTER EXTENSION" facility.
245
246  ALTER EXTENSION postgis UPDATE TO '2.2.0';
247
248
249USAGE
250-----
251
252Try the following example SQL statements to create tables with
253geometry columns::
254
255  CREATE TABLE geom_test ( gid int4, geom geometry, name varchar(25) );
256  INSERT INTO geom_test ( gid, geom, name )
257    VALUES ( 1, 'POLYGON((0 0 0,0 5 0,5 5 0,5 0 0,0 0 0))', '3D Square');
258  INSERT INTO geom_test ( gid, geom, name )
259    VALUES ( 2, 'LINESTRING(1 1 1,5 5 5,7 7 5)', '3D Line' );
260  INSERT INTO geom_test ( gid, geom, name )
261    VALUES ( 3, 'MULTIPOINT(3 4,8 9)', '2D Aggregate Point' );
262  SELECT * from geom_test WHERE ST_Intersects(geom, ST_MakeEnvelope(2,2,3,3));
263
264The following SQL creates proper full entries in the ``SPATIAL_REF_SYS``
265and ``GEOMETRY_COLUMNS`` tables, and ensures that all geometries are created
266with an SRID::
267
268  CREATE TABLE geotest (
269    id INT4,
270    name VARCHAR(32),
271    geopoint GEOMETRY(POINT, 4326)
272    );
273
274  INSERT INTO geotest (id, name, geopoint)
275    VALUES (1, 'Olympia', ST_GeomFromText('POINT(-122.90 46.97)', 4326));
276  INSERT INTO geotest (id, name, geopoint)
277    VALUES (2, 'Renton', ST_GeomFromText('POINT(-122.22 47.50)', 4326));
278
279  SELECT name, AsText(geopoint) FROM geotest;
280
281
282Spatial Indexes
283~~~~~~~~~~~~~~~
284
285PostgreSQL provides support for GiST spatial indexing. The GiST scheme offers
286indexing even on large objects, using a system of "lossy" indexing where a
287large object is proxied by a smaller one in the index.  In the case of the
288PostGIS indexing system, all objects are proxied in the index by their
289bounding boxes.
290
291You can build a GiST index with::
292
293  CREATE INDEX <indexname>
294    ON <tablename>
295    USING GIST ( <geometryfield> );
296
297Always run the ``VACUUM ANALYZE <tablename>`` on your tables after creating an
298index. This gathers statistics which the query planner uses to optimize index
299usage.
300
301
302PostGIS Topology support
303~~~~~~~~~~~~~~~~~~~~~~~~
304
305See topology/README for more informations about topology support.
306