Module: BorderPatrol

Defined in:
lib/border_patrol.rb,
lib/border_patrol/region.rb,
lib/border_patrol/polygon.rb,
lib/border_patrol/version.rb

Defined Under Namespace

Classes: InsufficientPointsToActuallyFormAPolygonError, Point, Polygon, Region

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.parse_kml(string) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/border_patrol.rb', line 5

def self.parse_kml(string)
  doc = Nokogiri::XML(string)

  polygons = doc.search('Polygon').map do |polygon_kml|
    parse_kml_polygon_data(polygon_kml.to_s)
  end
  BorderPatrol::Region.new(polygons)
end