encode method

  1. @override
Uint8List encode(
  1. GeoGeometry value
)
override

Converts value to a SQLite storage value.

Implementation

@override
Uint8List encode(GeoGeometry value) {
  if (srid != null && srid != 0 && value.srid != srid) {
    throw GeoException('expected SRID $srid and received ${value.srid}');
  }
  if (type != null && value.type != type) {
    throw GeoException(
      'expected ${type!.wktName} and received ${value.type.wktName}',
    );
  }
  return value.toEwkb();
}