名前

ST_MakeBox2D — 二つの2次元のポイントジオメトリで定義されるBOX2Dを生成します。

概要

box2d ST_MakeBox2D(geometry pointLowLeft, geometry pointUpRight);

説明

二つのポイントジオメトリで定義されるbox2d を生成します。これは範囲のクエリを実行する時に便利です。

Return all features that fall within or partly reside in a US National Atlas coordinate bounding box. It is assumed here that the geometries are stored with SRID=2163 (US National Atlas equal area).

Code
SELECT feature_id, feature_name, geom
FROM features
WHERE geom && ST_SetSRID(
  ST_MakeBox2D(
    ST_Point(-989502.1875, 528439.5625),
    ST_Point(-987121.375, 529933.1875)
  ),
  2163
);

関連情報

ST_Point, ST_SetSRID, ST_SRID