shapekit 0.3.2
shapekit: ^0.3.2 copied to clipboard
Read and write ESRI Shapefiles and GeoPackage feature data in Dart, with streaming, typed geometries, and DBF attribute support.
0.3.2 #
Added #
- Added
GpkgConnectionfor low-level GeoPackage SQL access with read-only and read-write modes, parameterizedselect/execute, and transaction support. - Added
hasTable()helpers toGpkgConnectionandGpkgReader.
0.3.1 #
Bug Fixes #
- WKB encoder: wrong geometry type for multi-part polylines —
MultiLineStringwas encoded with WKB type3002(LineStringZM) instead of5(MultiLineString). This produced corrupt R-Tree spatial index entries (coordinates at0.0 → Infinity), making affected features invisible in viewport queries. - WKB encoder: buffer overflow on multi-ring polygons with unclosed rings —
_ensureClosed()could add extra points not accounted for in the buffer size calculation, causing aRangeErrorcrash. - WKB encoder: empty MultiPoint encoded as phantom Point(0,0) — replaced with a proper empty MultiPoint WKB (0 sub-points) so no phantom geometry pollutes the spatial index.
- Replaced magic WKB type literals (
4,5) with named constants to prevent future type confusion bugs.
0.3.0 #
- Added GeoPackage support for reading feature tables, inspecting metadata, streaming typed features, and reading full tables
- Added GeoPackage writing helpers with explicit schema definition and streaming row insertion
- Added GeoPackage spatial index helpers for building and validating R-Tree indexes
- Added
ShapefileStreamReaderfor streaming shapefile reads - Added polygon hole support
- Improved WKB decoding, including Z and M handling
- Improved SQL identifier safety and resource cleanup in GeoPackage workflows
0.2.4 #
fix the incorrect meta package version
0.2.3 #
Breaking Changes #
ShapeProjectionTypeenum removed — the enum hard-coded a handful of EPSG codes and silently returnednonefor any unrecognised CRSShapefile.projectionTyperemoved, replaced byShapefile.epsgCode(int?) —nullmeans noAUTHORITYtag was found in the .prj fileCShapeProjectionFile.projectionTyperemoved, replaced byCShapeProjectionFile.epsgCode(int?)
Bug Fixes #
readPrj()no longer defaults to WGS84 (EPSG:4326) when noAUTHORITYtag is present; it now correctly returnsnullreadPrj()now uses the lastAUTHORITY["EPSG","…"]match, which is the coordinate system authority per the WKT CRS spec
Migration Guide #
// Before (0.2.2)
if (shapefile.projectionType != ShapeProjectionType.none) {
print(shapefile.projectionType.epsgCode); // String
}
// After (0.2.3)
if (shapefile.epsgCode != null) {
print(shapefile.epsgCode); // int
}
0.2.2 #
Breaking Changes #
- Optional M values: M (measure) values are now optional per ESRI shapefile spec
BoundsM:minMandmaxMare now nullable (double?)BoundsZ:minMandmaxMare now nullable (double?)PolylineM,PolygonM,MultiPointM:arrayMis now nullable (List<double>?)PolylineZ,PolygonZ,MultiPointZ:arrayMis now nullable (List<double>?)- Added
hasMgetter to check if M values are present - Note:
PointMandPointZstill require M values (not optional for single points)
- BoundsZ constructor order changed: Z values now come before optional M values
- Old:
BoundsZ(minX, minY, maxX, maxY, minM, maxM, minZ, maxZ) - New:
BoundsZ(minX, minY, maxX, maxY, minZ, maxZ, [minM, maxM])
- Old:
0.2.1 #
- Relaxed
metadependency constraint (^1.15.0) for Flutter SDK compatibility - Updated README examples to use new API (
read(),writeComplete()) - Clarified MultiPatch is not yet implemented
0.2.0 #
Breaking Changes #
- Error handling refactored: Methods no longer return
boolfor success/failurereader()→read()(now returnsvoid, throws on error)writer()→write()(now returnsvoid, throws on error)writerEntirety()→writeComplete()(now returnsvoid, throws on error)analysis()→analyze()(now returnsvoid, throws on error)
- All I/O methods now throw
ShapefileExceptionsubclasses instead of returningfalse - Changed
PointZconstructor parameter order for consistency - Removed
minM/maxMparameters from methods - now using properBoundsMclasses - Changed type dependencies to immutable
Improvements #
- Switched bounds to use multiple classes (
Bounds,BoundsM,BoundsZ) for type safety - Implemented MultiPoint, MultiPointM, and MultiPointZ in
analyze()method - Reordered
analyze()method cases for cleaner code organization - Improved test coverage for all geometry types (PointM, PolylineM/Z, PolygonM/Z)
- Cleaned up duplicate tests and improved test organization
- Added 120-character line width formatting rule in
analysis_options.yaml - Minor README fixes
- Various bug fixes
Migration Guide #
// Before (0.1.0)
if (shapefile.reader('path.shp')) {
// success
} else {
// error
}
// After (0.2.0)
try {
shapefile.read('path.shp');
// success
} on ShapefileException catch (e) {
// error handling
}
0.1.0 #
- Initial release of ShapeKit
- Complete support for reading and writing ESRI Shapefiles (.shp, .shx, .dbf, .prj)
- Support for all 13 standard shapefile geometry types
- Full dBASE III+ (.dbf) file support for feature attributes
- UTF-8 encoding support
- Type-safe geometry classes with immutable data structures
- Clean architecture with well-organized codebase