fromWkbId static method
Selects a Geom enum based on the WKB type id
.
Expected values (for the 2-dimensional geometry) are:
1
for thepoint
type2
for thelineString
type3
for thepolygon
type4
for themultiPoint
type5
for themultiLineString
type6
for themultiPolygon
type7
for thegeometryCollection
type
References:
Implementation
static Geom fromWkbId(int id) {
switch (id % 1000) {
case 1:
return Geom.point;
case 2:
return Geom.lineString;
case 3:
return Geom.polygon;
case 4:
return Geom.multiPoint;
case 5:
return Geom.multiLineString;
case 6:
return Geom.multiPolygon;
case 7:
return Geom.geometryCollection;
default:
throw FormatException('Invalid WKB id $id');
}
}