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_GeomFromWKB

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

Définition

ST_GeomFromWKB accepte une représentation binaire connue (WKB) et un ID de référence spatiale pour retourner un objet géométrie.

Syntaxe

Oracle

sde.st_geomfromwkb (wkb blob, srid integer)

sde.st_geomfromwkb (wkb blob)

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

PostgreSQL

sde.st_geomfromwkb (wkb, srid integer)

sde.st_geomfromwkb (esri_shape bytea, srid integer)

SQLite

st_geomfromwkb (wkb blob, srid int32)

st_geomfromwkb (wkb blob)

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 et PostgreSQL

ST_Geometry

SQLite

Geometryblob

Exemple

Dans l’exemple suivant, les lignes de résultats ont été remises en forme pour améliorer leur lisibilité. L’espacement de vos résultats variera selon votre affichage en ligne. Le code suivant montre comment utiliser la fonction ST_GeomFromWKB pour créer et insérer une ligne à partir d’une représentation WKB de ligne. L'exemple suivant insère un enregistrement dans la table sample_gs avec un ID et une géométrie dans le système de référence spatiale 4326 dans une représentation WKB.

Oracle

CREATE TABLE sample_gs (
 id integer,
 geometry sde.st_geometry,
 wkb blob
);
INSERT INTO sample_gs (id, geometry) VALUES (
 1901, 
 sde.st_geomfromtext ('point (1 2)', 4326)
);
INSERT INTO sample_gs (id, geometry) VALUES (
 1902,
 sde.st_geomfromtext ('linestring (33 2, 34 3, 35 6)', 4326)
);
INSERT INTO sample_gs (id, geometry) VALUES (
 1903,
 sde.st_geomfromtext ('polygon ((3 3, 4 6, 5 3, 3 3))', 4326)
);
 
UPDATE sample_gs
 SET wkb = sde.st_asbinary (geometry)
 WHERE id = 1901;
UPDATE sample_gs
 SET wkb = sde.st_asbinary (geometry)
 WHERE id = 1902;
UPDATE sample_gs
 SET wkb = sde.st_asbinary (geometry)
 WHERE id = 1903;
SELECT id, sde.st_astext (sde.st_geomfromwkb (wkb, 4326))
 FROM sample_gs;
ID   GEOMETRY 
1901 POINT (1.00000000 2.00000000) 
1902 LINESTRING (33.00000000 2.00000000, 34.00000000 3.00000000, 35.00000000 6.00000000) 
1903 POLYGON ((3.00000000 3.00000000, 5.00000000 3.00000000, 4.00000000 6.00000000, 3.00000000 3.00000000))

PostgreSQL

CREATE TABLE sample_gs (
 id integer,
 geometry sde.st_geometry,
 wkb bytea);
INSERT INTO sample_gs (id, geometry) VALUES (
 1901, 
 sde.st_geometry ('point (1 2)', 4326)
);
INSERT INTO sample_gs (id, geometry) VALUES (
 1902,
 sde.st_geometry ('linestring (33 2, 34 3, 35 6)', 4326)
);
INSERT INTO sample_gs (id, geometry) VALUES (
 1903,
 sde.st_geometry ('polygon ((3 3, 4 6, 5 3, 3 3))', 4326)
);
 
UPDATE sample_gs
 SET wkb = sde.st_asshape (geometry)
 WHERE id = 1901;
UPDATE sample_gs
 SET wkb = sde.st_asshape (geometry)
 WHERE id = 1902;
UPDATE sample_gs
 SET wkb = sde.st_asshape (geometry)
 WHERE id = 1903;
SELECT id, sde.st_astext (sde.st_geomfromshape (wkb, 4326)) 
 FROM sample_gs;
id   st_astext
1901 POINT (1 2) 
1902 LINESTRING (33 2, 34 3, 35 6) 
1903 POLYGON ((3 3, 5 3, 4 6, 3 3))

SQLite

CREATE TABLE sample_gs (
 id integer primary key autoincrement not null,
 wkb blob
);
SELECT AddGeometryColumn (
 NULL,
 'sample_gs',
 'geometry',
 4326,
 'geometry',
 'xy',
 'null'
);
INSERT INTO sample_gs (geometry) VALUES (
 st_geomfromtext ('point (1 2)', 4326)
);
INSERT INTO sample_gs (geometry) VALUES (
 st_geomfromtext ('linestring (33 2, 34 3, 35 6)', 4326)
);
INSERT INTO sample_gs (geometry) VALUES (
 st_geomfromtext ('polygon ((3 3, 4 6, 5 3, 3 3))', 4326)
);
 
--Replace IDs with actual values.
UPDATE sample_gs
 SET wkb = st_asbinary (geometry)
 WHERE id = 1;
UPDATE sample_gs
 SET wkb = st_asbinary (geometry)
 WHERE id = 2;
UPDATE sample_gs
 SET wkb = st_asbinary (geometry)
 WHERE id = 3;
SELECT id, st_astext (st_geomfromwkb (wkb, 4326))
 FROM sample_gs;
ID   GEOMETRY 
1    POINT (1.00000000 2.00000000) 
2    LINESTRING (33.00000000 2.00000000, 34.00000000 3.00000000, 35.00000000 6.00000000) 
3    POLYGON ((3.00000000 3.00000000, 5.00000000 3.00000000, 4.00000000 6.00000000, 3.00000000 3.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