Class GeoRuby::Shp4r::ShpFile
In: lib/geo_ruby/shp4r/shp.rb
Parent: Object

An interface to an ESRI shapefile (actually 3 files : shp, shx and dbf). Currently supports only the reading of geometries.

Methods

[]   close   create   each   each_record   empty?   fields   new   open   records   reload!   transaction  

Included Modules

Enumerable

Attributes

file_length  [R] 
file_root  [R] 
mmax  [R] 
mmin  [R] 
record_count  [R] 
shp_type  [R] 
xmax  [R] 
xmin  [R] 
ymax  [R] 
ymin  [R] 
zmax  [R] 
zmin  [R] 

Public Class methods

create a new Shapefile of the specified shp type (see ShpType) and with the attribute specified in the fields array (see Dbf::Field). If a block is given, the ShpFile object newly created is passed to it.

Opens a SHP file. Both "abc.shp" and "abc" are accepted. The files "abc.shp", "abc.shx" and "abc.dbf" must be present

opens a SHP "file". If a block is given, the ShpFile object is yielded to it and is closed upon return. Else a call to open is equivalent to ShpFile.new(...).

Public Instance methods

Returns record i

Closes a shapefile

each_record()

Alias for each

Tests if the file has no record

return the description of data fields

Returns all the records

force the reopening of the files compsing the shp. Close before calling this.

starts a transaction, to buffer physical file operations on the shapefile components.

[Validate]