georust / geozero

Zero-Copy reading and writing of geospatial data.
Apache License 2.0
336 stars 33 forks source link

Updating the dbase version to 0.3 and exporting the now public FieldType #52

Closed apps4uco closed 1 year ago

apps4uco commented 1 year ago

The use case for this is so that the following is possible

use geozero_shp::reader::FieldType;

reader.dbf_fields().unwrap().iter().for_each(
    |f| {
        println!("{} {} len {}",f.name(),f.field_type(),f.length());
        let ft=match f.field_type() {
            FieldType::Character => {"char"}
            // FieldType::Date => {}
            // FieldType::Float => {}
            FieldType::Numeric => {"num"}
            // FieldType::Logical => {}
            // FieldType::Currency => {}
            // FieldType::DateTime => {}
            // FieldType::Integer => {}
            // FieldType::Double => {}
            // FieldType::Memo => {}
            _ => {"other"}
        };
        println!("{}",ft);
    }