postgis/postgis
Regina Obe a895ebc543 Reject infinite coordinates in _ST_BestSRID
to prevent crash on ARM (maybe other systems too)
References #5347 for PostGIS 3.2.5

Also change convert to gserialized logic to use newer syntax
2023-03-13 02:44:26 -04:00
..
brin_2d.c Fix some spelling errors 2018-03-02 01:47:41 +00:00
brin_common.c Add support for BRIN indexes - missed new files on last commit 2016-07-31 04:34:16 +00:00
brin_nd.c Address warnings across liblwgeom/ and postgis/ 2018-02-13 13:08:25 +00:00
DEBUG Change the name of the main source directory. This is going to break the build for a little while until I fix all the references, but I want to do it atomically to ensure version history is preserved. 2009-02-11 18:22:32 +00:00
flatgeobuf.c Error out when asked to build flatgeobuf on table with no geometry (references #5173) 2022-06-20 10:55:53 -07:00
flatgeobuf.h FlatGeobuf format input/output 2021-09-20 20:05:25 +02:00
geobuf.c Enforce protobuf-c dependency 2020-10-05 10:52:13 +02:00
geobuf.h Enforce protobuf-c dependency 2020-10-05 10:52:13 +02:00
geobuf.LICENSE Geobuf output support via ST_AsGeobuf 2017-02-26 18:16:54 +00:00
geobuf.proto specific protobuf syntax 2020-03-02 11:34:11 -08:00
geography_brin.sql.in Remove support for Postgres < 9.5. 2018-12-03 09:03:57 +00:00
geography_btree.c Avoid memory exhaustion when building a btree index (references #4004) 2018-01-26 12:43:51 +00:00
geography_centroid.c Lengthen proj cache lifetime to the life of the backend, and move memory context appropriately to match. Simplify the retrieval of global constants somewhat to not require FunctionCallInfo anymore. References #4890 2021-05-17 08:43:22 -07:00
geography_inout.c Fix PG 15 building pg_atoi removed. References #5100 for PostGIS 3.2.2 2022-02-19 01:36:33 -05:00
geography_measurement_trees.c Share gserialized objects between different cache types 2020-05-11 12:53:58 +02:00
geography_measurement_trees.h Share gserialized objects between different cache types 2020-05-11 12:53:58 +02:00
geography_measurement.c Reject infinite coordinates in _ST_BestSRID 2023-03-13 02:44:26 -04:00
geography.h Style only change: remove trailing whitespaces 2016-04-27 14:45:28 +00:00
geography.sql.in Use the more standard integer instead of int4. References #5191 for PostGIS 3.2.3 2022-07-26 10:02:24 -04:00
geometry_inout.c Optimize geometry_to_point 2020-05-01 16:58:04 +02:00
gserialized_estimate.c Correctly read geometry extent off multi-key GIST indexes. References #5032 2022-08-17 11:13:18 -07:00
gserialized_gist_2d.c gist sortsupport -- clean up 2021-09-02 17:01:47 +03:00
gserialized_gist_nd.c gist sortsupport -- clean up 2021-09-02 17:01:47 +03:00
gserialized_spgist_2d.c Lengthen proj cache lifetime to the life of the backend, and move memory context appropriately to match. Simplify the retrieval of global constants somewhat to not require FunctionCallInfo anymore. References #4890 2021-05-17 08:43:22 -07:00
gserialized_spgist_3d.c Lengthen proj cache lifetime to the life of the backend, and move memory context appropriately to match. Simplify the retrieval of global constants somewhat to not require FunctionCallInfo anymore. References #4890 2021-05-17 08:43:22 -07:00
gserialized_spgist_3d.h SP-GiST implementation polishing 2018-07-13 20:06:43 +00:00
gserialized_spgist_nd.c Lengthen proj cache lifetime to the life of the backend, and move memory context appropriately to match. Simplify the retrieval of global constants somewhat to not require FunctionCallInfo anymore. References #4890 2021-05-17 08:43:22 -07:00
gserialized_supportfn.c Ensure that additional operators are not appended when the function and opfamily disagree about dimensionality. References #5025 2022-08-17 12:23:51 -07:00
gserialized_typmod.c Move to snprintf where easily done 2022-07-25 15:25:57 -07:00
legacy_gist.sql.in Use the more standard integer instead of int4. References #5191 for PostGIS 3.2.3 2022-07-26 10:02:24 -04:00
legacy_minimal.sql.in Use the more standard integer instead of int4. References #5191 for PostGIS 3.2.3 2022-07-26 10:02:24 -04:00
legacy.sql.in Use the more standard integer instead of int4. References #5191 for PostGIS 3.2.3 2022-07-26 10:02:24 -04:00
long_xact.c Move to using snprintf for fixed length buffers. 2022-07-25 14:02:30 -07:00
long_xact.sql.in Formatting: remove trailing whitespace from .sql files. 2018-01-17 20:39:03 +00:00
lwgeom_accum.c Expose fixed-precision overlay functions 2020-09-11 10:52:02 +02:00
lwgeom_accum.h Expose fixed-precision overlay functions 2020-09-11 10:52:02 +02:00
lwgeom_box.c Speed up ST_CombineBbox(box2d, geometry) for compressed values 2020-07-29 13:15:42 +02:00
lwgeom_box3d.c Use lwprint_double for printing box types 2020-07-29 12:16:51 +02:00
lwgeom_box3d.h SP-GiST implementation polishing 2018-07-13 20:06:43 +00:00
lwgeom_btree.c Fast Hilbert btree. 2019-07-14 14:24:18 +00:00
lwgeom_dump.c Expose fixed-precision overlay functions 2020-09-11 10:52:02 +02:00
lwgeom_dumppoints.c ST_DumpPoints and ST_DumpSegments crash on multipolygon 2022-09-27 20:58:31 -04:00
lwgeom_export.c Include srs in GeoJSON where it exists in spatial_ref_sys, closes #4799 2021-08-25 10:56:07 -07:00
lwgeom_functions_analytic.c Speed up ST_Simplify 2019-09-24 10:58:30 +00:00
lwgeom_functions_analytic.h Update copyright header to add explicit license version 2015-12-14 10:11:21 +00:00
lwgeom_functions_basic.c Prefilter to check for non-finite coordinates before feeding 2023-02-16 16:06:52 -05:00
lwgeom_functions_lrs.c Typo: 2st -> 2nd 2022-08-30 14:48:40 +02:00
lwgeom_functions_temporal.c Remove unused errno.h includes. 2018-09-12 17:21:38 +00:00
lwgeom_generate_grid.c Remove unused variable 2020-12-05 18:59:36 +03:00
lwgeom_geos_clean.c Add a new ST_MakeValid() signature that takes options to control 2021-04-27 12:04:43 -07:00
lwgeom_geos_prepared.c Share gserialized objects between different cache types 2020-05-11 12:53:58 +02:00
lwgeom_geos_prepared.h Share gserialized objects between different cache types 2020-05-11 12:53:58 +02:00
lwgeom_geos_relatematch.c Drop cstring2text/text2cstring in favor of PostgreSQL functions 2018-02-20 16:16:45 +00:00
lwgeom_geos.c Free lwgeom 2023-02-17 01:51:33 -05:00
lwgeom_geos.h Share gserialized objects between different cache types 2020-05-11 12:53:58 +02:00
lwgeom_in_encoded_polyline.c Drop cstring2text/text2cstring in favor of PostgreSQL functions 2018-02-20 16:16:45 +00:00
lwgeom_in_flatgeobuf.c FlatGeobuf format input/output 2021-09-20 20:05:25 +02:00
lwgeom_in_geohash.c Cache getSRIDbySRS 2020-05-01 16:48:39 +02:00
lwgeom_in_geojson.c Cache getSRIDbySRS 2020-05-01 16:48:39 +02:00
lwgeom_in_gml.c Allow repeated points in GML poslist inputs, references #4910 2021-07-30 11:05:22 -07:00
lwgeom_in_kml.c Move postgres.h include to top to fix mingw64 issues 2021-03-11 13:04:48 -05:00
lwgeom_inout.c ST_AsLatLon infinite coordinate. 2023-02-18 05:16:58 -05:00
lwgeom_ogc.c Test for empty before reading start point. Closes #5036 2022-01-20 18:05:16 -08:00
lwgeom_out_flatgeobuf.c FlatGeobuf format input/output 2021-09-20 20:05:25 +02:00
lwgeom_out_geobuf.c Repair crashes in raster aggregates, references #4916, #4770, #4724, #4916 2021-08-20 14:02:03 -07:00
lwgeom_out_geojson.c PG15 compile error with geojson out. References #5231 for PostGIS 3.2.4 2022-09-03 15:03:51 -04:00
lwgeom_out_mvt.c Lengthen proj cache lifetime to the life of the backend, and move memory context appropriately to match. Simplify the retrieval of global constants somewhat to not require FunctionCallInfo anymore. References #4890 2021-05-17 08:43:22 -07:00
lwgeom_rectree.c Share gserialized objects between different cache types 2020-05-11 12:53:58 +02:00
lwgeom_rtree.c Share gserialized objects between different cache types 2020-05-11 12:53:58 +02:00
lwgeom_rtree.h Share gserialized objects between different cache types 2020-05-11 12:53:58 +02:00
lwgeom_spheroid.c Move to snprintf where easily done 2022-07-25 15:25:57 -07:00
lwgeom_sqlmm.c Implement extended ST_CurveToLine signature 2017-06-19 16:06:59 +00:00
lwgeom_transform.c Replace home-grown axis swapping code with the proj_normalize_for_visualization() 2021-07-28 13:20:38 -07:00
lwgeom_triggers.c Update copyright header to add explicit license version 2015-12-14 10:11:21 +00:00
lwgeom_window.c fix kmeans crash on 32-bit. Closes #4985 2021-09-06 01:24:35 +03:00
Makefile.in FlatGeobuf format input/output 2021-09-20 20:05:25 +02:00
mvt.c Turn off windowing support in ST_AsMVT 2021-10-06 12:42:59 -07:00
mvt.h MVT: Improve performance and memory usage 2020-08-17 18:14:38 +02:00
postgis_after_upgrade.sql Add support for upgrading in presence of views using deprecated ST_DWithin 2021-12-27 10:52:13 +01:00
postgis_before_upgrade.sql search_path vulnerability during install/upgrade. 2022-02-11 03:44:04 -05:00
postgis_brin.h Add support for BRIN indexes - missed new files on last commit 2016-07-31 04:34:16 +00:00
postgis_brin.sql.in Add parallellism and cost properties to brin functions 2019-11-15 15:46:25 +01:00
postgis_legacy.c postgis_svn_version is deprecated 2020-11-29 02:01:23 +03:00
postgis_libprotobuf.c Remove --without-wagyu option 2021-01-08 17:14:29 +01:00
postgis_module.c Lengthen proj cache lifetime to the life of the backend, and move memory context appropriately to match. Simplify the retrieval of global constants somewhat to not require FunctionCallInfo anymore. References #4890 2021-05-17 08:43:22 -07:00
postgis_spgist.sql.in Drop PG 9.5 support 2019-11-15 10:46:01 +01:00
postgis.sql.in Use the more standard integer instead of int4. References #5191 for PostGIS 3.2.3 2022-07-26 10:02:24 -04:00
README Change the name of the main source directory. This is going to break the build for a little while until I fix all the references, but I want to do it atomically to ensure version history is preserved. 2009-02-11 18:22:32 +00:00
sqldefines.h.in Reduce _COST_LOW and _COST_MEDIUM and change ST_Simplify 2020-04-30 12:44:15 +02:00
TODO Drop extraneous task (if it referred to loader we do have a switch for index creation now) 2010-03-12 15:25:33 +00:00
uninstall_geography.sql.in Formatting: remove trailing whitespace from .sql files. 2018-01-17 20:39:03 +00:00
uninstall_legacy.sql.in Drop the .c suffix of sql files to preprocess 2013-03-18 17:20:18 +00:00
uninstall_long_xact.sql.in Formatting: remove trailing whitespace from .sql files. 2018-01-17 20:39:03 +00:00
uninstall_sfcgal.sql.in Formatting: remove trailing whitespace from .sql files. 2018-01-17 20:39:03 +00:00
uninstall_sqlmm.sql.in Formatting: remove trailing whitespace from .sql files. 2018-01-17 20:39:03 +00:00
vector_tile.LICENSE Mapbox vector tile output support via ST_AsMVT 2017-02-06 16:33:23 +00:00
vector_tile.proto MVT: Improve performance and memory usage 2020-08-17 18:14:38 +02:00

Welcome to the Initial version of LWGEOM.

More information is available on the PostGIS user's mailing list and 
the PostGIS developer's mailing list.  

Differences
-----------

The LWGEOM is very much like the original PostGIS GEOMETRY type.  The 
main differences are:

a) LWGEOMs are much smaller than the PostGIS GEOMETRY
b) LWGEOMs natively support 2d, 3d, and 4d points
c) LWGEOMs are indexed using single-precision bounding boxes.  This
   make the indexes significantly smaller than PostGIS GEOMETRY
   indexes.
d) LWGEOMs are internally very similar to OGC WKB   
e) The "normal" view of LWGEOMs is OGC WKB - PostGIS GEOMETRY is OGC WKT
f) PostGIS geometries have a built-in BOX3D.  LWGEOMs have an *optional*
   BOX2D (see below).


Also included with the LWGEOMs is a type called 'box2d'.  This is
very similar to PostGIS BOX3D type:

a) BOX2Ds are 2D - BOX3D is 3D
b) BOX2Ds are represented by single-precision floating point numbers,
   while BOX3Ds are double-precision floating point numbers.
c) BOX2Ds will sometimes be slightly larger than you might expect.
   This is because the conversion from double-precision to 
   single-precision is inexact.  When this happens, the BOX2D will
   automatically expand itself.
   

Bounding Boxes
--------------

<this section for advanced users.  Ignore it if you don't understand
 what its saying.>

Bounding boxes are optional in LWGEOMs.  By not having one, you are
saving a small amount of space per LWGEOM geometry (16 bytes).

Bounding boxes are attached to any non-POINT geometry by default.

You can disable this automatic addition setting AUTOCACHE_BBOX to 0
in the top-builddir Makefile.config and read BBOXCACHE_BEHAVIOURS
for function-by-function behaviour explanation.

Manual control of bbox cache is available using DropBBOX() and AddBBOX().

UPDATE <table> SET <geomcol> = DropBBOX(<geomcol>);
UPDATE <table> SET <geomcol> = AddBBOX(<geomcol>);

Note that if you don't cache a BBOX spatial operators will be much slower,
as they'll need to compute all the boxes at every invokation.
If you use GiST indexes you will still note a slow down as a RECHECK
clause is specified for GiST operators. Also, GiST index updating
will be slower w/out a BBOX cache.


Space Saving
------------

LWGEOM indexes are approximately 40% smaller than PostGIS indexes.

A LWGEOM 'POINT(0 0)' takes up 21 bytes, a POSTGIS 'POINT(0 0)' takes
up 140 bytes.  This shows that LWGEOMs have a much smaller overhead.

LWGEOMs will store 2D points as 2 double precision numbers (16 bytes) -
PostGIS will store 2D points with 3 numbers (24 bytes).   This can be 
another big savings.