feature method

FeatureEntry? feature(
  1. TableName name
)

Looks up a feature entry by name.

@param name THe name of the feature entry. @return The entry, or null if no such entry exists.

Implementation

FeatureEntry? feature(TableName name) {
  if (!_sqliteDb
      .hasTable(TableName(TABLE_GEOMETRY_COLUMNS, schemaSupported: false))) {
    return null;
  }
  String compat =
      forceVectorMobileCompatibility ? "and c.srs_id = $WGS84LL_SRID" : "";
  String sql = """
      SELECT a.*, b.column_name, b.geometry_type_name, b.m, b.z, c.organization_coordsys_id, c.definition
      FROM $TABLE_GEOPACKAGE_CONTENTS a, $TABLE_GEOMETRY_COLUMNS b, $TABLE_SPATIAL_REF_SYS c WHERE a.table_name = b.table_name
      AND a.srs_id = c.srs_id $compat AND lower(a.table_name) = lower(?)
      AND a.data_type = ?
      """;

  var res = _sqliteDb.select(sql, [name.name, DataType.Feature.value]);
  if (res.length != 0) {
    return createFeatureEntry(res.first);
  }
  return null;
}