MoonBit Shapefile geometry, index and attribute table reader/writer
let files = @moonbit9.write_shp(@moonbit9.Point, [
{ kind: @moonbit9.Point, points: [@moonbit9.coordinate(116.4, 39.9)], parts: [] },
])
let parsed = @moonbit9.read_shp(files.shp)fn Dataset::filter_bbox(self : Dataset, bounds : Bounds, include_deleted? : Bool) -> Dataset raise ShapeErrorfn Dataset::filter_equal(self : Dataset, field : String, value : Value, include_deleted? : Bool) -> Dataset raise ShapeErrorfn Dataset::to_geojson(self : Dataset, allow_projected? : Bool, include_deleted? : Bool) -> Json raise ShapeErrorpub struct IndexedReader {
data : Bytes
file_header : Header
entries : Array[IndexEntry]
limits : ReadLimits
}fn IndexedReader::open(shp : Bytes, shx : Bytes, limits? : ReadLimits) -> IndexedReader raise ShapeErrorfn IndexedReader::select(self : IndexedReader, indices : Array[Int]) -> Array[Record] raise ShapeErrorpub(all) struct ReadLimits {
max_records : Int
max_points_per_record : Int
max_parts_per_record : Int
max_file_bytes : Int
} derive(Debug)pub struct ShpWriter {
kind : ShapeType
limits : ReadLimits
records : Array[Bytes]
total_bytes : Int
bounds : Bounds?
zrange : (Double, Double)?
mrange : (Double, Double)?
}fn read_dataset(shp : Bytes, shx : Bytes, dbf : Bytes, encoding? : Encoding, prj? : String?) -> Dataset raise ShapeErrorfn write_shp(kind : ShapeType, shapes : Array[Shape], limits? : ReadLimits) -> ShapeFiles raise ShapeErrorInstall
Download zipMoonBit Shapefile geometry, index and attribute table reader/writer