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_ConvexHull

  • 定义
  • 语法
  • 返回类型
  • 示例

定义

ST_ConvexHull 返回 ST_Geometry 对象的凸包。

语法

Oracle 和 PostgreSQL

sde.st_convexhull (geometry1 sde.st_geometry)

SQLite

st_convexhull (geometry1 geometryblob)

返回类型

Oracle 和 PostgreSQL

ST_Geometry

SQLite

Geometryblob

示例

这些示例创建 sample_geometries 表,其中包含三列:id、spatial type 和 geometry。Spatial type 列为 varchar(18) 类型,用于存储 geometry 列中存储的几何子类的名称。表中会插入三种要素:线、面及多点。

针对该表执行的 SELECT 语句返回各子类几何的凸包。

Oracle

--Create table and insert three sample geometries.
CREATE TABLE sample_geometries (
 id integer,
 spatial_type varchar(18),
 geometry sde.st_geometry
);

INSERT INTO sample_geometries (id, spatial_type, geometry) VALUES (
 1,
 'ST_LineString',
 sde.st_geometry ('linestring (20 20, 30 30, 20 40, 30 50)', 4326)
);

INSERT INTO sample_geometries (id, spatial_type, geometry) VALUES (
 2,
 'ST_Polygon',
 sde.st_geometry ('polygon ((30 30, 25 35, 15 50, 35 80, 40 85, 80 90, 70 75, 65 70, 55 50, 75 40, 60 30, 30 30))', 4326)
);

INSERT INTO sample_geometries (id, spatial_type, geometry) VALUES (
 3, 
 'ST_MultiPoint',
 sde.st_geometry ('multipoint (20 20, 30 30, 20 40, 30 50)', 4326)
);
--Find the convex hull of each geometry subtype.
SELECT id, spatial_type, sde.st_astext (sde.st_convexhull (geometry)) CONVEXHULL
 FROM  SAMPLE_GEOMETRIES;

ID    SPATIAL_TYPE       CONVEXHULL

 1    ST_LineString      POLYGON ((20.00000000 40.00000000, 
                           20.00000000 20.00000000, 30.00000000 
                           30.00000000, 30.00000000 50.00000000, 
                           20.00000000 40.00000000)) 

 2    ST_Polygon         POLYGON ((15.00000000 50.00000000, 
                           25.00000000 35.00000000, 30.00000000 
                           30.00000000, 60.00000000 30.00000000,
                           75.00000000 40.00000000, 80.00000000 
                           90.00000000, 40.00000000 85.00000000,
                           35.00000000 80.00000000, 15.00000000 
                           50.00000000))

 3    ST_MultiPoint      POLYGON ((20.00000000 40.00000000, 
                           20.00000000 20.00000000, 30.00000000 
                           30.00000000, 30.00000000 50.00000000, 
                           20.00000000 40.00000000))

PostgreSQL

--Create table and insert three sample geometries.
CREATE TABLE sample_geometries (
 id integer,
 spatial_type varchar(18),
 geometry sde.st_geometry
);

INSERT INTO sample_geometries (id, spatial_type, geometry) VALUES (
 1,
 'ST_LineString',
 sde.st_geometry ('linestring (20 20, 30 30, 20 40, 30 50)', 4326)
);

INSERT INTO sample_geometries (id, spatial_type, geometry) VALUES (
 2,
 'ST_Polygon',
 sde.st_geometry ('polygon ((30 30, 25 35, 15 50, 35 80, 40 85, 80 90, 70 75, 65 70, 55 50, 75 40, 60 30, 30 30))', 4326)
);

INSERT INTO sample_geometries (id, spatial_type, geometry) VALUES (
 3, 
 'ST_MultiPoint',
 sde.st_geometry ('multipoint (20 20, 30 30, 20 40, 30 50)', 4326)
);
--Find the convex hull of each geometry subtype.
SELECT id, spatial_type, st_astext (sde.st_convexhull (geometry)) 
 AS CONVEXHULL
 FROM sample_geometries;

id    spatial_type       convexhull

 1    ST_LineString      POLYGON (( 20 40, 20 20, 30 30, 30 50, 
                           20 40)) 

 2    ST_Polygon         POLYGON (( 15 50, 25 35, 30 30, 60 30,
                           75 40, 80 90, 40 85, 35 80, 15 50))

 3    ST_MultiPoint      POLYGON (( 20 40, 20 20, 30 30, 30 50, 
                           20 40))

SQLite

--Create table and insert three sample geometries.
CREATE TABLE sample_geometries (
 id integer primary key autoincrement not null,
 spatial_type varchar(18)
);

SELECT AddGeometryColumn(
 NULL,
 'sample_geometries',
 'geometry',
 4326,
 'geometry',
 'xy',
 'null'
);

INSERT INTO sample_geometries (spatial_type, geometry) VALUES (
 'ST_LineString',
 st_geometry ('linestring (20 20, 30 30, 20 40, 30 50)', 4326)
);

INSERT INTO sample_geometries (spatial_type, geometry) VALUES (
 'ST_Polygon',
 st_geometry ('polygon ((30 30, 25 35, 15 50, 35 80, 40 85, 80 90, 70 75, 65 70, 55 50, 75 40, 60 30, 30 30))', 4326)
);

INSERT INTO sample_geometries (spatial_type, geometry) VALUES (
 'ST_MultiPoint',
 st_geometry ('multipoint (20 20, 30 30, 20 40, 30 50)', 4326)
);
--Find the convex hull of each geometry subtype.
SELECT id, spatial_type, st_astext (st_convexhull (geometry)) 
 AS CONVEXHULL
 FROM sample_geometries;

id    spatial_type       CONVEXHULL

 1    ST_LineString      POLYGON ((20.00000000 40.00000000, 
                           20.00000000 20.00000000, 30.00000000 
                           30.00000000, 30.00000000 50.00000000, 
                           20.00000000 40.00000000)) 

 2    ST_Polygon         POLYGON ((15.00000000 50.00000000, 
                           25.00000000 35.00000000, 30.00000000 
                           30.00000000, 60.00000000 30.00000000,
                           75.00000000 40.00000000, 80.00000000 
                           90.00000000, 40.00000000 85.00000000,
                           35.00000000 80.00000000, 15.00000000 
                           50.00000000))

 3    ST_MultiPoint      POLYGON ((20.00000000 40.00000000, 
                           20.00000000 20.00000000, 30.00000000 
                           30.00000000, 30.00000000 50.00000000, 
                           20.00000000 40.00000000))

相关主题

  • 加载 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. | 隐私政策 | 法律声明