ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcMap

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

ST_NumPoints

  • 定義
  • 構文
  • 戻り値のタイプ
  • 例

定義

ST_NumPoints は、ジオメトリ内にあるポイント (頂点) の数を返します。

ポリゴンの場合、始点の頂点と終点の頂点が同じ位置にあっても、別々にカウントされます。

この数値は、ST_Geometry タイプの NUMPTS 属性とは違いますので注意してください。NUMPTS 属性では、パート間のセパレーターを含む、ジオメトリのすべての部分における頂点がカウントされます。各パートの間には 1 つのセパレーターがあります。たとえば、3 つの部分があるマルチパート ラインストリングには 2 つのセパレーターがあります。NUMPTS 属性では、各セパレーターは 1 つの頂点としてカウントされます。それに対して ST_NumPoints 関数では、セパレーターは頂点としてカウントされません。

構文

Oracle および PostgreSQL

sde.st_numpoints (geometry1 sde.st_geometry)

SQLite

st_numpoints (geometry1 geometryblob)

戻り値のタイプ

Integer

例

geotype 列と、geometry タイプを格納する g1 列を持つ numpoints_test テーブルを作成します。

INSERT ステートメントは、ポイント、ラインストリング、ポリゴンを挿入します。

SELECT クエリは ST_NumPoints 関数を使用して、各フィーチャ タイプについて、各フィーチャ内にあるポイントの数を取得します。

Oracle

CREATE TABLE numpoints_test (
 geotype varchar(12),
 g1 sde.st_geometry
);
INSERT INTO NUMPOINTS_TEST VALUES (
 'point',
 sde.st_pointfromtext ('point (10.02 20.01)', 4326)
);
INSERT INTO NUMPOINTS_TEST VALUES (
 'linestring',
 sde.st_linefromtext ('linestring (10.02 20.01, 23.73 21.92)', 4326)
);
INSERT INTO NUMPOINTS_TEST VALUES (
 'polygon',
 sde.st_polyfromtext ('polygon ((10.02 20.01, 23.73 21.92, 24.51 12.98, 11.64 13.42, 10.02 20.01))', 4326)
);
SELECT geotype, sde.st_numpoints (g1) Number_of_points
 FROM NUMPOINTS_TEST;
GEOTYPE     Number_of_points
point                       1
linestring                  2
polygon                     5

PostgreSQL

CREATE TABLE numpoints_test (
 geotype varchar(12),
 g1 sde.st_geometry
);
INSERT INTO numpoints_test VALUES (
 'point',
 sde.st_point ('point (10.02 20.01)', 4326)
);
INSERT INTO numpoints_test VALUES (
 'linestring',
 sde.st_linestring ('linestring (10.02 20.01, 23.73 21.92)', 4326)
);
INSERT INTO numpoints_test VALUES (
 'polygon',
 sde.st_polygon ('polygon ((10.02 20.01, 23.73 21.92, 24.51 12.98, 11.64 13.42, 10.02 20.01))', 4326)
);
SELECT geotype, sde.st_numpoints (g1)
 AS Number_of_points
 FROM numpoints_test;
geotype     number_of_points
point                       1
linestring                  2
polygon                     5

SQLite

CREATE TABLE numpoints_test (
 geotype text(12)
);
SELECT AddGeometryColumn(
 NULL,
 'numpoints_test',
 'g1',
 4326,
 'geometry',
 'xy',
 'null'
);
INSERT INTO numpoints_test VALUES (
 'point',
 st_point ('point (10.02 20.01)', 4326)
);
INSERT INTO numpoints_test VALUES (
 'linestring',
 st_linestring ('linestring (10.02 20.01, 23.73 21.92)', 4326)
);
INSERT INTO numpoints_test VALUES (
 'polygon',
 st_polygon ('polygon ((10.02 20.01, 23.73 21.92, 24.51 12.98, 11.64 13.42, 10.02 20.01))', 4326)
);
SELECT geotype AS "Type of geometry", st_numpoints (g1) AS "Number of points"
 FROM numpoints_test;
Type of geometry     Number of points
point                       1
linestring                  2
polygon                     5

関連トピック

  • SQLite の ST_Geometry ライブラリの読み込み

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • Esri ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
Copyright © 2021 Esri. | プライバシー | リーガル