12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>252 / 3107.12.5 ST_ExpandST_Expand — Returns bounding box expanded in all directions from the bounding box of the input geometry. Uses doubleprecisionSynopsisgeometry ST_Expand(geometry g1, float units_to_expand);box2d ST_Expand(box2d g1, float units_to_expand);box3d ST_Expand(box3d g1, float units_to_expand);DescriptionThis function returns a bounding box expanded in all directions from the bounding box of the input geometry, by an amountspecified in the second argument. Uses double-precision. Very useful for distance() queries, or bounding box queries to add anindex filter to the query.There are 3 variants of this. The one that takes a geometry will return a POLYGON geometry representation of the bounding boxand is the most commonly used variant.ST_Expand is similar in concept to ST_Buffer except while buffer expands the geometry in all directions, ST_Expand expandsthe bounding box an x,y,z unit amount.Units are in the units of the spatial reference system in use denoted by the SRIDNotePre 1.3, ST_Expand was used in conjunction with distance to do indexable queries. Something ofthe form the_geom && ST_Expand(’POINT(10 20)’, 10) AND ST_Distance(the_geom, ’PO-INT(10 20)’) < 10 Post 1.2, this was replaced with the easier ST_DWithin construct.NoteBounding boxes of all geometries are currently 2-d even if they are 3-dimensional geometries.NoteAvailability: 1.5.0 behavior changed to output double precision instead of float4 coordinates.ExamplesNoteExamples below use US National Atlas Equal Area (SRID=2163) which is a meter projection--10 meter expanded box around bbox of a linestringSELECT CAST(ST_Expand(ST_GeomFromText(’LINESTRING(2312980 110676,2312923 110701,2312892110714)’, 2163),10) As box2d);st_expand------------------------------------←↪

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!