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 +4 -4
- data/lib/geospatial/kml/placemark.rb +24 -1
- data/lib/geospatial/kml/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c3aac2c7282055dac63ad9e94ef2420b224651e3c4b3b5e1c7a02b0cd34071a
|
4
|
+
data.tar.gz: 80cfc73658725c29ecfd355f4d10531cea916df7d3499f1852862e5d41667a38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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").
|
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
|
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.
|
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
|
+
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.
|
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.
|