Skip to content
Browse files

Added extensions to get latlngs out of shapes

  • Loading branch information...
1 parent 4a8fa50 commit 657b1f779c2b32fad06a125188369851b19bb784 @mmangino committed Dec 30, 2008
Showing with 18 additions and 1 deletion.
  1. +14 −0 lib/shape_lib/shape.rb
  2. +2 −0 lib/shapelib.rb
  3. +2 −1 shapelib.gemspec
View
14 lib/shape_lib/shape.rb
@@ -0,0 +1,14 @@
+module ShapeLib
+ class Shape
+ def each
+ latlngs.each do |l|
+ yield l
+ end
+ end
+
+ def latlngs
+ @latlngs ||= yvals.zip(xvals)
+ end
+ end
+end
+
View
2 lib/shapelib.rb
@@ -0,0 +1,2 @@
+require 'shapelib.so'
+require 'shape_lib/shape'
View
3 shapelib.gemspec
@@ -1,13 +1,14 @@
Gem::Specification.new do |s|
s.name = %q{shapelib}
s.version = "0.6.1"
- s.files = %w{depend extconf.rb Interface.html Interface.rd libtest.rb main.c README.txt sfcode.h sflist.h shapelib.gemspec shpplus.c shpplus.h spcode.h splist.h spwkt.h style.css valconv.h zsample1.rb ztest1.rb}
+ s.files = %w{depend extconf.rb Interface.html Interface.rd libtest.rb main.c README.txt sfcode.h sflist.h shapelib.gemspec shpplus.c shpplus.h spcode.h splist.h spwkt.h style.css valconv.h zsample1.rb ztest1.rb lib/shapelib.rb lib/shape_lib/shape.rb}
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["prasinos@users.sourceforge.net", "Mike Mangino"]
s.date = %q{2008-02-13}
s.description = %q{== DESCRIPTION: A ruby wrapper around the shapefile library}
s.email = %q{mmangino@elevatedrails.com}
s.has_rdoc = false
+ s.require_paths = ["lib"]
s.extensions << "extconf.rb"
s.summary = %q{Ruby wrapper around the libshapefile library}

0 comments on commit 657b1f7

Please sign in to comment.
Something went wrong with that request. Please try again.