geospatial-kml 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa1bf3132bd9b7cf265e59c85e2d26e6efad07f238a5d3396627d91eb09b2e43
4
- data.tar.gz: 59afaf2f3e3105be1b7ed5abc75167328a2d06f48ed16c9145054e93348ccf8c
3
+ metadata.gz: 2c3aac2c7282055dac63ad9e94ef2420b224651e3c4b3b5e1c7a02b0cd34071a
4
+ data.tar.gz: 80cfc73658725c29ecfd355f4d10531cea916df7d3499f1852862e5d41667a38
5
5
  SHA512:
6
- metadata.gz: b4035d21afe6ad6223b951aa5f2f3d057c458ddb71dd8b78765ece25aa5b31952ed84088773799a296aa91557fc428d60864a87938253e903be43a1d6ed49da4
7
- data.tar.gz: 0b23e4bb964f04af39831c617cf310cb07f9173af9e2571ae80decfacdc227a4ce4310d17ff9d3346b6e4fadcb07a7a4523f61933be9fde38601b749928141be
6
+ metadata.gz: 46f031388c4a2d17c193209be31ba100302ed1fea277a1ec5ac7a962543faad4ccee88a53e46221e2f28448b2c662c3fa2b7d7c13adcb1e77d9843ea6e80b834
7
+ data.tar.gz: 7703e5d487050a110e2b32e0a74f956cecaffc44d25c2654d6ba59df3a678a975a9a3f1e057e672b319f105d0be95599f5f30b3f33973318263a19a651d715d7
@@ -19,6 +19,9 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  require 'nokogiri'
22
+
23
+ require 'geospatial/location'
24
+ require 'geospatial/circle'
22
25
  require 'geospatial/polygon'
23
26
 
24
27
  module Geospatial
@@ -29,7 +32,27 @@ module Geospatial
29
32
  end
30
33
 
31
34
  def name
32
- @node.css("name").text.strip
35
+ if node = @node.css("name").first
36
+ node.text.strip
37
+ end
38
+ end
39
+
40
+ def description
41
+ if node = @node.css("description").first
42
+ node.text.strip
43
+ end
44
+ end
45
+
46
+ def bounding_circle
47
+ if look_at = @node.css("LookAt").first
48
+ longitude = look_at.css("longitude").first.text.to_f
49
+ latitude = look_at.css("latitude").first.text.to_f
50
+ range = look_at.css("range").first.text.to_f
51
+
52
+ center = Location.new(longitude, latitude)
53
+
54
+ return Circle.new(center, range)
55
+ end
33
56
  end
34
57
 
35
58
  def polygons
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Geospatial
22
22
  module KML
23
- VERSION = "0.3.0"
23
+ VERSION = "0.4.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geospatial-kml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-19 00:00:00.000000000 Z
11
+ date: 2018-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: geospatial
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.7.7
121
+ rubygems_version: 2.7.8
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Read geo data from keyhole markup language files.