Postgis St_Extent Example

Postgis St_Extent Example



ST_Extent returns a bounding box that encloses a set of geometries. The ST_Extent function is an aggregate function in the terminology of SQL. That means that it operates on lists of data, in the same way the SUM () and AVG () functions do.


ST_Extent. Starting around version 1.2.2, Extent and Extent3d will be deprecated in favor of ST_Extent. ST_Extent will return a BOX3D object. Expand (< 1.3.1), ST_Expand (1.2.2 +) Expand returns a geometry object that is a box encompassing a given geometry. Unlike extent, it.Examples . SELECT ST_EstimatedExtent ('ny', 'edges', 'the_geom') --result-- BOX (-8877653 4912316,-8010225.5 5589284) SELECT ST_EstimatedExtent ('feature_poly', 'the_geom') --result-- BOX (-124.659652709961 24.6830825805664,-67.7798080444336 49.0012092590332), Examples SELECT ST_3DExtent(foo.the_geom) As b3extent FROM (SELECT ST_MakePoint(x,y,z) As the_geom FROM generate_series(1,3) As x CROSS JOIN generate_series(1,2) As y CROSS JOIN generate_series(0,2) As Z) As foo b3extent ----- BOX3D(1 1 0,3 2 2) --Get the extent of various elevated circular strings SELECT ST_3DExtent(foo.the_geom) As b3extent FROM (SELECT.ST_Extent - PostGIS, ST_Extent - PostGIS, ST_Extent - PostGIS, Part 1: Getting Started With PostGIS : An almost Idiot's ...Just use ST_Extent for the sub-query that selects your airports. The only trick is that in PostgreSQL you must use an alias for the subquery. Look at a in the following example which gives the aggregated extent of the 5 first geometries of the table. select ST_AsText(ST_Extent(a.geom)) from (select geom from tableName limit 5) as a, SELECT ST_Extent(geom) FROM towns WHERE town = 'BOSTON' SELECT ST_Area(ST_Union(geom)) FROM towns WHERE town = 'BOSTON' Viewing the Data. If you are a GIS newbie, I highly recommend using QGIS. QGIS has ability to view PostGIS data both geometry and raster directly, do simple filters on it, is free, is cross-platform (Linux, Windows, MacOSX,Unix) and is.6/15/2012  · st_extent along with st_area but this doesn't quite give me the. results I am after. For example if the polygon was already a rectangle but was orientated. on an angle the bounding box area is much larger than the area of the. original rectangle, whereas I would like it to be the same value. I.Units are in the units of the spatial reference system in use denoted by the SRID. Pre version 1.3, ST_Expand was used in conjunction with ST_Distance to do indexable distance queries. For example , the_geom && ST_Expand ('POINT (10 20)', 10) AND ST_Distance (the_geom, 'POINT (10 20)') < 10 .

Advertiser