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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>173 / 310ImportantFor geography only Polygon covers point is supported.ImportantDo not use this function with invalid geometries. You will get unexpected results.This function call will automatically include a bounding box comparison that will make use of any indexes that are available onthe geometries. To avoid index use, use the function _ST_Covers.Availability: 1.2.2 - requires GEOS >= 3.0Availability: 1.5 - support for geography was introduced.NOTE: this is the "allowable" version that returns a boolean, not an integer.Not an OGC standard, but Oracle has it too.There are certain subtleties to ST_Contains and ST_Within that are not intuitively obvious. For details check out Subtleties ofOGC Covers, Contains, WithinExamplesGeometry example--a circle covering a circleSELECT ST_Covers(smallc,smallc) As smallinsmall,ST_Covers(smallc, bigc) As smallcoversbig,ST_Covers(bigc, ST_ExteriorRing(bigc)) As bigcoversexterior,ST_Contains(bigc, ST_ExteriorRing(bigc)) As bigcontainsexteriorFROM (SELECT ST_Buffer(ST_GeomFromText(’POINT(1 2)’), 10) As smallc,ST_Buffer(ST_GeomFromText(’POINT(1 2)’), 20) As bigc) As foo;--Resultsmallinsmall | smallcoversbig | bigcoversexterior | bigcontainsexterior--------------+----------------+-------------------+---------------------t | f | t | f(1 row)Geeography Example-- a point with a 300 meter buffer compared to a point, a point and its 10 meter bufferSELECT ST_Covers(geog_poly, geog_pt) As poly_covers_pt,ST_Covers(ST_Buffer(geog_pt,10), geog_pt) As buff_10m_covers_centFROM (SELECT ST_Buffer(ST_GeogFromText(’SRID=4326;POINT(-99.327 31.4821)’), 300) As ←↪geog_poly,ST_GeogFromText(’SRID=4326;POINT(-99.33 31.483)’) As geog_pt ) As foo;poly_covers_pt | buff_10m_covers_cent----------------+------------------f| tSee AlsoST_Contains, ST_CoveredBy, ST_Within

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

Saved successfully!

Ooh no, something went wrong!