I'm using the shapefile NPM library which works well, but it doesn't provide a count of the number of features in a Shapefile. Is there some other library which can access this information (other than shelling out to ogrinfo), or some other technique?

  • Shapefile_feature_count = (dBase_file_size - dBase_header_size) / dBase_record_size also Shapefile_feature_count = littleEndianInt(bytes 4-7 of .dbf file header) – Vince Jan 5 '18 at 0:36
  • Thank you, that's helpful info - not sure if that library exposes such low level details yet. – Steve Bennett Jan 5 '18 at 1:33
  • Ok, I've opened a pull request there now. – Steve Bennett Jan 5 '18 at 4:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.