ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Aide
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS Desktop

Un SIG professionnel complet

ArcGIS Enterprise

SIG dans votre entreprise

ArcGIS Developers

Outils de création d'applications de localisation

ArcGIS Solutions

Modèles d'applications et de cartes gratuits pour votre secteur d'activité

ArcGIS Marketplace

Téléchargez des applications et des données pour votre organisation.

  • Documentation
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

ArcMap

  • Accueil
  • Commencer
  • Carte
  • Analyser
  • Gérer les données
  • Outils
  • Extensions

ST_ConvexHull

  • Définition
  • Syntaxe
  • Type de retour
  • Exemple

Définition

ST_ConvexHull renvoie l'enveloppe convexe d'un objet ST_Geometry.

Syntaxe

Oracle et PostgreSQL

sde.st_convexhull (geometry1 sde.st_geometry)

SQLite

st_convexhull (geometry1 geometryblob)

Type de retour

Oracle et PostgreSQL

ST_Geometry

SQLite

Geometryblob

Exemple

Ces exemples créent la table sample_geometries qui contient trois colonnes : id, spatial type et geometry. Spatial type, au format varchar(18), stocke le nom de la sous-classe de géométrie stockée dans la colonne geometry. Trois entités sont insérées dans la table : une ligne, un polygone et une entité multi-points.

L'instruction SELECT exécutée sur la table renvoie l'enveloppe convexe de chaque géométrie de sous-classe.

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))

Rubriques connexes

  • Charger la bibliothèque ST_Geometry SQLite

ArcGIS Desktop

  • Accueil
  • Documentation
  • Support

ArcGIS

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

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog d’Esri
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
Copyright © 2021 Esri. | Confidentialité | Légal