Class: SmoOsBngGrids::ShapefileWriter
- Inherits:
-
Object
- Object
- SmoOsBngGrids::ShapefileWriter
- Defined in:
- lib/smo_os_bng_grids/shapefile_writer.rb
Overview
Writes a set of BNG grid squares to ESRI Shapefile format (.shp/.shx/.dbf/.prj). Pure Ruby, no external dependencies. Output CRS: OSGB36 British National Grid (EPSG:27700).
Constant Summary collapse
- SHAPE_TYPE_POLYGON =
5- DBF_VERSION =
0x03
Instance Method Summary collapse
Instance Method Details
#write(entries, path) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/smo_os_bng_grids/shapefile_writer.rb', line 15 def write(entries, path) FileUtils.mkdir_p(File.dirname(path)) write_shp_shx(entries, path) write_dbf(entries, path) write_prj(path) puts "Written #{entries.size} features to:" puts " #{path}.shp" puts " #{path}.shx" puts " #{path}.dbf" puts " #{path}.prj" end |