使用者の手引きおよび解説書

EnvelopesIntersect

EnvelopesIntersect は、2 つの図形エンベロープが交差する場合に 1 (TRUE) を戻します。そうでない場合 0 (FALSE) を戻します。

構文

db2gse.EnvelopesIntersect(g1 db2gse.ST_Geometry, g2 db2gse.ST_Geometry)

戻りタイプ

整数

get_window 関数は、アプリケーションから表示ウィンドウの座標を検索します。 window パラメーターは、実際には、表示ポリゴンを表す座標のストリングを含む、ポリゴンの形状構造です。 PolyFromShape 関数は、表示ウィンドウの形状を地理情報エクステンダーのポリゴンに変換します。 EnvelopesIntersect 関数は地理情報エクステンダーのポリゴンを交差エンベロープとして使います。表示ウィンドウの内部または境界と交差するすべての SENSITIVE_AREAS ゾーン・ポリゴンが戻されます。それぞれのポリゴンは結果セットから取り出されて、draw_polygon 関数に渡されます。

/* Get the display window coordinates as a polygon shape.
get_window(&window)
 
/* Create the SQL expression. The db2gse.EnvelopesIntersect function
  will be used to limit the result set to only those zone polygons
  that intersect the envelope of the display window. */
strcpy(sqlstmt, "select db2gse.AsShape(zone) from SENSITIVE_AREAS where
db2gse.EnvelopesIntersect (zone, db2gse.PolyFromShape(cast(? as blob(1m)), 
db2gse.coordref()..srid(0)))");
 
/* Set blob_len to the byte length of a 5 point shape polygon. */
blob_len = 128;
 
/* Prepare the SQL statement. */
SQLPrepare(hstmt, (UCHAR *)sqlstmt, SQL_NTS);
 
/* Set the pcbvalue1 to the window shape */
pcbvalue1 = blob_len;
 
/* Bind the shape parameter */
SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_BLOB, 
blob_len,0, window, blob_len, &pcbvalue1);
 
/* Execute the query */
rc = SQLExecute(hstmt);
 
/* Assign the results of the query, (the Zone polygons) to the
   fetched_binary variable. */
SQLBindCol (hstmt, 1, SQL_C_Binary, fetched_binary, 100000, &ind_blob);
 
/* Fetch each polygon within the display window and display it. */
while(SQL_SUCCESS == (rc = SQLFetch(hstmt))
  draw_polygon(fetched_binary);


[ ページのトップ | 前ページ | 次ページ | 目次 | 索引 ]