You can store point, line, polygon, multipoint, multiline, multipolygon, and geometrycollections. These are specified in the Open GIS Well Known Text Format (with 3d extentions).
Build an index. The following SQL, for example:
CREATE INDEX <index name> ON <table name> USING GIST (<geometry column name> GIST_GEOMETRY_OPS) WITH (islossy); SET ENABLE_SEQSCAN = OFF; SELECT * FROM <table> WHERE <geometry column name> && 'BOX3D(0 0 0, 100 100 0)'::BOX3D
The operators work on the bounding box of the geometry, not the underlying geometry.
Since the " &&" operator only checks for bounding box overlap, use the truly_inside() function. For example:
SELECTt * FROM <table> WHERE <geometry column> && <BOX3D> AND truly_inside(<geometry column>,<BOX3D>);
Since the && is quick (and indexable), this will execute quickly.
length3d(GEOMETRY) - 3d length of all linestrings in GEOMETRY
length2d(GEOMETRY) - 2d length of all linestringsin GEOMETRY
area2d (GEOMETRY) - area of all polygons (projected to the XY plane)
perimeter2d(GEOMETRY) - 2d length of all polygon rings
perimeter3d(GEOMETRY) - 3d length of all polygon rings
truly_inside(GEOMETRY,GEOMETRY) - true if part of A is inside B's bounding box
A <& B - true if A's bounding box overlaps or is to the right of B's
A << B - true if A's bounding box is strictly to the right of B's
A &> B - true if A's bounding box overlaps or is strictly to the right of B's
A >> B - true if A's bounding box is strictly to the left of B's
A ~= B - true if A's geometry is the same as B's (order of sub-geometry unimportant)
A ~ B - true if A's bounding box is contained by B's bounding box
A @ B - true if A's bounding box contains B's bounding box
A && B- true if A's bounding box overlaps B's bounding box
npoints(GEOMETRY) - (info) how many points are in the geometry
nrings(GEOMETRY) - (info) how many rings are there in the geometry
mem_size(GEOMETRY) - (info) how much space does this geometry take up
numb_sub_objs(GEOMETRY) - (info) how many sub objects are inside this geometry
summary(GEOMETRY) - (info) give a text summary of whats inside the geometry
They (unlike GiST) cannot handle geometries that are are > 8kb in size, and they take a lot longer to create.