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_GeomFromText

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

Utilisée dans Oracle et SQLite uniquement ; pour PostgreSQL, utilisez ST_Geometry.

Définition

ST_GeomFromText accepte une représentation textuelle connue et un ID de référence spatiale et retourne un objet géométrie.

Syntaxe

Oracle

sde.st_geomfromtext (wkt clob, srid integer)

sde.st_geomfromtext (wkt clob)

Si aucun identifiant de référence spatiale n’est spécifié, la référence spatiale par défaut est 4326.

SQLite

st_geomfromtext (wkt text, srid int32)

st_geomfromtext (wkt text)

Si aucun identifiant de référence spatiale n’est spécifié, la référence spatiale par défaut est 4326.

Type de retour

Oracle

ST_Geometry

SQLite

Geometryblob

Exemple

La table geometry_test contient la colonne d'identifiants entiers gid qui identifie chaque ligne de façon unique et la colonne g1 qui stocke la géométrie.

Les instructions INSERT suivantes insèrent les données dans les colonnes gid et g1 de la table geometry_test. La fonction ST_GeomFromText effectue la conversion des représentations textuelles des géométries en leurs sous-classes instantiables respectives. L'instruction SELECT à la fin permet de s'assurer que les données ont été insérées dans la colonne g1.

Oracle

CREATE TABLE geometry_test (
 gid smallint unique,
 g1 sde.st_geometry
);
INSERT INTO GEOMETRY_TEST VALUES (
 1, 
 sde.st_geomfromtext ('point (10.02 20.01)', 4326)
);
INSERT INTO GEOMETRY_TEST VALUES (
 2,
 sde.st_geomfromtext('linestring (10.01 20.01, 10.01 30.01, 10.01 40.01)', 4326)
);
INSERT INTO GEOMETRY_TEST VALUES (
 3,
 sde.st_geomfromtext('polygon ((10.02 20.01, 11.92 35.64, 25.02 34.15,
19.15 33.94, 10.02 20.01))', 4326)
);
INSERT INTO GEOMETRY_TEST VALUES (
 4,
 sde.st_geomfromtext('multipoint (10.02 20.01, 10.32 23.98, 11.92 25.64)', 4326)
);
INSERT INTO GEOMETRY_TEST VALUES (
 5,
 sde.st_geomfromtext ('multilinestring ((10.02 20.01, 10.32 23.98,
11.92 25.64), (9.55 23.75, 15.36 30.11))', 4326)
);
INSERT INTO GEOMETRY_TEST VALUES (
 6,
 sde.st_geomfromtext ('multipolygon (((10.02 20.01, 11.92 35.64,
25.02 34.15, 19.15 33.94, 10.02 20.01), (51.71 21.73, 73.36 27.04,
71.52 32.87, 52.43 31.90, 51.71 21.73)))', 4326)
);
SELECT sde.st_astext(g1)
 FROM GEOMETRY_TEST;
POINT ( 10.02000000 20.01000000)
LINESTRING ( 10.01000000 20.01000000, 10.01000000 30.01000000, 10.01000000 40.01000000)
POLYGON (( 10.02000000 20.01000000, 19.15000000 33.94000000, 25.02000000 34.15000000, 11.92000000 35.64000000, 10.02000000 20.01000000))
MULTIPOINT ( 10.02000000 20.01000000, 10.32000000 23.98000000, 11.92000000 25.64000000)
MULTILINESTRING (( 10.02000000 20.01000000, 10.32000000 23.98000000, 11.92000000 25.64000000),( 9.55000000 23.75000000, 15.36000000 30.11000000))
MULTIPOLYGON ((( 51.71000000 21.73000000, 73.36000000 27.04000000, 71.52000000 32.87000000, 52.43000000 31.90000000, 51.71000000 21.73000000)),(( 10.02000000 20.01000000, 19.15000000 33.94000000, 25.02000000 34.15000000, 11.92000000 35.64000000, 10.02000000 20.01000000)))

SQLite

CREATE TABLE geometry_test (
 gid integer primary key autoincrement not null
);
SELECT AddGeometryColumn (
 NULL,
 'geometry_test',
 'g1',
 4326,
 'geometry',
 'xy',
 'null'
);
INSERT INTO GEOMETRY_TEST (g1) VALUES (
 st_geomfromtext ('point (10.02 20.01)', 4326)
);
INSERT INTO GEOMETRY_TEST (g1) VALUES (
 st_geomfromtext('linestring (10.01 20.01, 10.01 30.01, 10.01 40.01)', 4326)
);
INSERT INTO GEOMETRY_TEST (g1) VALUES (
 st_geomfromtext('polygon ((10.02 20.01, 11.92 35.64, 25.02 34.15,
19.15 33.94, 10.02 20.01))', 4326)
);
INSERT INTO GEOMETRY_TEST (g1) VALUES (
 st_geomfromtext('multipoint (10.02 20.01, 10.32 23.98, 11.92 25.64)', 4326)
);
INSERT INTO GEOMETRY_TEST (g1) VALUES (
 st_geomfromtext ('multilinestring ((10.02 20.01, 10.32 23.98,
11.92 25.64), (9.55 23.75, 15.36 30.11))', 4326)
);
INSERT INTO GEOMETRY_TEST (g1) VALUES (
 st_geomfromtext ('multipolygon (((10.02 20.01, 11.92 35.64,
25.02 34.15, 19.15 33.94, 10.02 20.01), (51.71 21.73, 73.36 27.04,
71.52 32.87, 52.43 31.90, 51.71 21.73)))', 4326)
);
SELECT st_astext(g1)
 FROM geometry_test;
POINT ( 10.02000000 20.01000000)
LINESTRING ( 10.01000000 20.01000000, 10.01000000 30.01000000, 10.01000000 40.01000000)
POLYGON (( 10.02000000 20.01000000, 19.15000000 33.94000000, 25.02000000 34.15000000, 11.92000000 35.64000000, 10.02000000 20.01000000))
MULTIPOINT ( 10.02000000 20.01000000, 10.32000000 23.98000000, 11.92000000 25.64000000)
MULTILINESTRING (( 10.02000000 20.01000000, 10.32000000 23.98000000, 11.92000000 25.64000000),( 9.55000000 23.75000000, 15.36000000 30.11000000))
MULTIPOLYGON ((( 51.71000000 21.73000000, 73.36000000 27.04000000, 71.52000000 32.87000000, 52.43000000 31.90000000, 51.71000000 21.73000000)),(( 10.02000000 20.01000000, 19.15000000 33.94000000, 25.02000000 34.15000000, 11.92000000 35.64000000, 10.02000000 20.01000000)))

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