open method

Future<void> open()

Implementation

Future<void> open() async {
  await dbf?.open();
  await shp.open();

  header = dbf?.getHeader();
  if (header != null) {
    numFields = header!.getNumFields();
  }
  // idxBuffer = StringBuffer(schema.getTypeName());
  // idxBuffer.write('.');
  // idxBaseLen = idxBuffer.length;

  // if (dbf != null) {
  //     // build the list of dbf indexes we have to read taking into consideration the
  //     // duplicated dbf field names issue
  //     List<AttributeDescriptor> atts = schema.getAttributeDescriptors();
  //     dbfindexes = new int[atts.size()];
  //     DbaseFileHeader head = dbf.getHeader();
  //     for (int i = 0; i < atts.size(); i++) {
  //         AttributeDescriptor att = atts.get(i);
  //         if (att is GeometryDescriptor) {
  //             dbfindexes[i] = -1;
  //         } else {
  //             String attName = att.getLocalName();
  //             int count = 0;
  //             Map<Object, Object> userData = att.getUserData();
  //             if (userData[ShapefileDataStore.ORIGINAL_FIELD_NAME] != null) {
  //                 attName = userData[ShapefileDataStore.ORIGINAL_FIELD_NAME] as String;
  //                 count =

  //                                 userData
  //                                         [ShapefileDataStore.ORIGINAL_FIELD_DUPLICITY_COUNT] as int;
  //             }

  //             bool found = false;
  //             for (int j = 0; j < head.getNumFields(); j++) {
  //                 if (head.getFieldName(j)== attName && count-- <= 0) {
  //                     dbfindexes[i] = j;
  //                     found = true;
  //                     break;
  //                 }
  //             }
  //             if (!found) {
  //                 throw IOException(
  //                         "Could not find attribute " + attName + " (mul count: $count");
  //             }
  //         }
  //     }
  // }
}