ST_CoordDim renvoie les dimensions des coordonnées associées à la valeur ST_Geometry. Pour une explication des dimensions des coordonnées, reportez-vous à la section Points.
Syntaxe
db2gse.ST_CoordDim(g1 db2gse.ST_Geometry)
Type de retour
Integer
Exemples
La table coorddim_test est crée avec les colonnes GEOTYPE et G1. La colonne GEOTYPE stocke le nom de la sous-classe de la géométrie enregistrée dans la colonne G1.
CREATE TABLE coorddim_test (geotype varchar(20), g1 db2gse.ST_Geometry)
Les instructions INSERT insèrent une sous-classe exemple dans la table coorddim_test.
INSERT INTO coorddim_test VALUES( 'Point', db2gse.ST_PointFromText('point (10.02 20.01)', db2gse.coordref()..srid(0)) ) INSERT INTO coorddim_test VALUES( 'Linestring', db2gse.ST_LineFromText('linestring (10.02 20.01,10.32 23.98,11.92 25.64)', db2gse.coordref()..srid(0)) ) INSERT INTO coorddim_test VALUES( 'Polygon', db2gse.ST_PolyFromText('polygon ((10.02 20.01,11.92 35.64, 25.02 34.15, 19.15 33.94,10.02 20.01))', db2gse.coordref()..srid(0)) ) INSERT INTO coorddim_test VALUES( 'Multipoint', db2gse.ST_MPointFromText('multipoint (10.02 20.01,10.32 23.98, 11.92 25.64)', db2gse.coordref()..srid(0)) ) INSERT INTO coorddim_test VALUES( 'Multilinestring', db2gse.ST_MLineFromText('multilinestring ((10.02 20.01, 10.32 23.98,11.92 25.64),(9.55 23.75,15.36 30.11))', db2gse.coordref()..srid(0)) ) INSERT INTO coorddim_test VALUES( 'Multipolygon', MPolyFromText('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)))', db2gse.coordref()..srid(0)) )
L'instruction SELECT ci-après répertorie le nom de la sous-classe stocké dans la colonne geotype, accompagné des dimensions des coordonnées associées à ce type de géométrie.
SELECT geotype, db2gse.ST_coordDim(g1)' coordinate_dimension' FROM coorddim_test GEOTYPE coordinate_dimension -------------------- -------------------------- ST_Point 2 ST_Linestring 2 ST_Polygon 2 ST_Multipoint 2 ST_Multilinestring 2 ST_Multipolygon 2 6 record(s) selected.