ruby_kml 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/LICENSE +7 -0
  2. data/README.md +34 -0
  3. data/Rakefile +52 -0
  4. data/examples/melbourne-stations.kml +18 -0
  5. data/lib/kml/color_style.rb +34 -0
  6. data/lib/kml/container.rb +42 -0
  7. data/lib/kml/document.rb +46 -0
  8. data/lib/kml/feature.rb +185 -0
  9. data/lib/kml/folder.rb +29 -0
  10. data/lib/kml/geometry.rb +102 -0
  11. data/lib/kml/ground_overlay.rb +18 -0
  12. data/lib/kml/hot_spot.rb +31 -0
  13. data/lib/kml/icon.rb +15 -0
  14. data/lib/kml/icon_style.rb +52 -0
  15. data/lib/kml/lat_lon_box.rb +36 -0
  16. data/lib/kml/line_string.rb +40 -0
  17. data/lib/kml/line_style.rb +15 -0
  18. data/lib/kml/linear_ring.rb +67 -0
  19. data/lib/kml/link.rb +51 -0
  20. data/lib/kml/look_at.rb +28 -0
  21. data/lib/kml/model.rb +40 -0
  22. data/lib/kml/multi_geometry.rb +26 -0
  23. data/lib/kml/object.rb +37 -0
  24. data/lib/kml/overlay.rb +21 -0
  25. data/lib/kml/placemark.rb +60 -0
  26. data/lib/kml/point.rb +65 -0
  27. data/lib/kml/poly_style.rb +16 -0
  28. data/lib/kml/polygon.rb +91 -0
  29. data/lib/kml/screen_overlay.rb +61 -0
  30. data/lib/kml/snippet.rb +25 -0
  31. data/lib/kml/style.rb +23 -0
  32. data/lib/kml/style_map.rb +39 -0
  33. data/lib/kml/style_selector.rb +7 -0
  34. data/lib/kml/version.rb +9 -0
  35. data/lib/kml_file.rb +55 -0
  36. data/lib/ruby_kml.rb +8 -0
  37. data/ruby_kml.gemspec +14 -0
  38. data/test/cdata_and_snippet.kml +21 -0
  39. data/test/ground_overlays.kml +25 -0
  40. data/test/kml/point_test.rb +10 -0
  41. data/test/kml_file_test.rb +255 -0
  42. data/test/paths.kml +33 -0
  43. data/test/polygon.kml +20 -0
  44. data/test/polygon_inner.kml +25 -0
  45. data/test/polygon_style.kml +24 -0
  46. data/test/simple_placemark.kml +12 -0
  47. data/test/style_map.kml +40 -0
  48. data/test/test_helper.rb +11 -0
  49. metadata +124 -0
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <kml xmlns="http://earth.google.com/kml/2.1">
3
+ <Document>
4
+ <name>Paths</name>
5
+ <description>
6
+ <![CDATA[Examples of paths. Note that the tessellate tag is by default
7
+ set to 0. If you want to create tessellated lines, they must be authored
8
+ (or edited) directly in KML.]]>
9
+ </description>
10
+ <Style id="yellowLineGreenPoly">
11
+ <LineStyle>
12
+ <color>7f00ffff</color>
13
+ <width>4</width>
14
+ </LineStyle>
15
+ <PolyStyle>
16
+ <color>7f00ff00</color>
17
+ </PolyStyle>
18
+ </Style>
19
+ <Placemark>
20
+ <name>Absolute Extruded</name>
21
+ <description>
22
+ <![CDATA[Transparent green wall with yellow outlines]]>
23
+ </description>
24
+ <styleUrl>#yellowLineGreenPoly</styleUrl>
25
+ <LineString>
26
+ <extrude>1</extrude>
27
+ <tessellate>1</tessellate>
28
+ <altitudeMode>absolute</altitudeMode>
29
+ <coordinates>-112.2550785337791,36.07954952145647,2357 -112.2549277039738,36.08117083492122,2357 -112.2552505069063,36.08260761307279,2357 -112.2564540158376,36.08395660588506,2357 -112.2580238976449,36.08511401044813,2357 -112.2595218489022,36.08584355239394,2357 -112.2608216347552,36.08612634548589,2357 -112.262073428656,36.08626019085147,2357 -112.2633204928495,36.08621519860091,2357 -112.2644963846444,36.08627897945274,2357 -112.2656969554589,36.08649599090644,2357</coordinates>
30
+ </LineString>
31
+ </Placemark>
32
+ </Document>
33
+ </kml>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <kml xmlns="http://earth.google.com/kml/2.1">
3
+ <Placemark>
4
+ <name>The Pentagon</name>
5
+ <Polygon>
6
+ <extrude>1</extrude>
7
+ <altitudeMode>relativeToGround</altitudeMode>
8
+ <outerBoundaryIs>
9
+ <LinearRing>
10
+ <coordinates>-77.05788457660967,38.87253259892824,100 -77.05465973756702,38.87291016281703,100 -77.05315536854791,38.87053267794386,100 -77.05552622493516,38.868757801256,100 -77.05844056290393,38.86996206506943,100 -77.05788457660967,38.87253259892824,100</coordinates>
11
+ </LinearRing>
12
+ </outerBoundaryIs>
13
+ <innerBoundaryIs>
14
+ <LinearRing>
15
+ <coordinates>-77.05668055019126,38.87154239798456,100 -77.05542625960818,38.87167890344077,100 -77.05485125901024,38.87076535397792,100 -77.05577677433152,38.87008686581446,100 -77.05691162017543,38.87054446963351,100 -77.05668055019126,38.87154239798456,100</coordinates>
16
+ </LinearRing>
17
+ </innerBoundaryIs>
18
+ </Polygon>
19
+ </Placemark>
20
+ </kml>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <kml xmlns="http://earth.google.com/kml/2.1">
3
+ <Placemark>
4
+ <name>The Pentagon</name>
5
+ <Polygon>
6
+ <extrude>1</extrude>
7
+ <altitudeMode>relativeToGround</altitudeMode>
8
+ <outerBoundaryIs>
9
+ <LinearRing>
10
+ <coordinates>-77.05788457660967,38.87253259892824,100 -77.05465973756702,38.87291016281703,100 -77.05315536854791,38.87053267794386,100 -77.05552622493516,38.868757801256,100 -77.05844056290393,38.86996206506943,100 -77.05788457660967,38.87253259892824,100</coordinates>
11
+ </LinearRing>
12
+ </outerBoundaryIs>
13
+ <innerBoundaryIs>
14
+ <LinearRing>
15
+ <coordinates>-77.05668055019126,38.87154239798456,100 -77.05542625960818,38.87167890344077,100 -77.05485125901024,38.87076535397792,100 -77.05577677433152,38.87008686581446,100 -77.05691162017543,38.87054446963351,100 -77.05668055019126,38.87154239798456,100</coordinates>
16
+ </LinearRing>
17
+ </innerBoundaryIs>
18
+ <innerBoundaryIs>
19
+ <LinearRing>
20
+ <coordinates>-77.05668055019126,38.87154239798456,100 -77.05542625960818,38.87167890344077,100 -77.05485125901024,38.87076535397792,100 -77.05577677433152,38.87008686581446,100 -77.05691162017543,38.87054446963351,100 -77.05668055019126,38.87154239798456,100</coordinates>
21
+ </LinearRing>
22
+ </innerBoundaryIs>
23
+ </Polygon>
24
+ </Placemark>
25
+ </kml>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <kml xmlns="http://earth.google.com/kml/2.1">
3
+ <Style id="transBluePoly">
4
+ <LineStyle>
5
+ <width>1.5</width>
6
+ </LineStyle>
7
+ <PolyStyle>
8
+ <color>7dff0000</color>
9
+ </PolyStyle>
10
+ </Style>
11
+ <Placemark>
12
+ <name>Building 41</name>
13
+ <styleUrl>#transBluePoly</styleUrl>
14
+ <Polygon>
15
+ <extrude>1</extrude>
16
+ <altitudeMode>relativeToGround</altitudeMode>
17
+ <outerBoundaryIs>
18
+ <LinearRing>
19
+ <coordinates>-122.0857412771483,37.42227033155257,17 -122.0858169768481,37.42231408832346,17 -122.085852582875,37.42230337469744,17 -122.0858799945639,37.42225686138789,17 -122.0858860101409,37.4222311076138,17 -122.0858069157288,37.42220250173855,17 -122.0858379542653,37.42214027058678,17 -122.0856732640519,37.42208690214408,17 -122.0856022926407,37.42214885429042,17 -122.0855902778436,37.422128290487,17 -122.0855841672237,37.42208171967246,17 -122.0854852065741,37.42210455874995,17 -122.0855067264352,37.42214267949824,17 -122.0854430712915,37.42212783846172,17 -122.0850990714904,37.42251282407603,17 -122.0856769818632,37.42281815323651,17 -122.0860162273783,37.42244918858722,17 -122.0857260327004,37.42229239604253,17 -122.0857412771483,37.42227033155257,17</coordinates>
20
+ </LinearRing>
21
+ </outerBoundaryIs>
22
+ </Polygon>
23
+ </Placemark>
24
+ </kml>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <kml xmlns="http://earth.google.com/kml/2.1">
3
+ <Placemark>
4
+ <name>Simple placemark</name>
5
+ <description>
6
+ <![CDATA[Attached to the ground. Intelligently places itself at the height of the underlying terrain.]]>
7
+ </description>
8
+ <Point>
9
+ <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
10
+ </Point>
11
+ </Placemark>
12
+ </kml>
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <kml xmlns="http://earth.google.com/kml/2.1">
3
+ <Document>
4
+ <name>Highlighted Icon</name>
5
+ <description>
6
+ <![CDATA[Place your mouse over the icon to see it display the new icon]]>
7
+ </description>
8
+ <Style id="highlightPlacemark">
9
+ <IconStyle>
10
+ <Icon>
11
+ <href>http://maps.google.com/mapfiles/kml/paddle/red-stars.png</href>
12
+ </Icon>
13
+ </IconStyle>
14
+ </Style>
15
+ <Style id="normalPlacemark">
16
+ <IconStyle>
17
+ <Icon>
18
+ <href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>
19
+ </Icon>
20
+ </IconStyle>
21
+ </Style>
22
+ <StyleMap id="exampleStyleMap">
23
+ <Pair>
24
+ <key>normal</key>
25
+ <styleUrl>#normalPlacemark</styleUrl>
26
+ </Pair>
27
+ <Pair>
28
+ <key>highlight</key>
29
+ <styleUrl>#highlightPlacemark</styleUrl>
30
+ </Pair>
31
+ </StyleMap>
32
+ <Placemark>
33
+ <name>Roll over this icon</name>
34
+ <styleUrl>#exampleStyleMap</styleUrl>
35
+ <Point>
36
+ <coordinates>-122.0856545755255,37.42243077405461,0</coordinates>
37
+ </Point>
38
+ </Placemark>
39
+ </Document>
40
+ </kml>
@@ -0,0 +1,11 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
2
+ $:.unshift(File.dirname(__FILE__)) unless
3
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
4
+
5
+ require 'pp'
6
+ require 'test/unit'
7
+ require 'ruby_kml'
8
+
9
+ class Test::Unit::TestCase
10
+
11
+ end
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_kml
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.7
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - aeden, schleyfox, xaviershay, andykram, IanVaughan
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: nokogiri
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: builder
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Generate KML files with ruby
47
+ email: ''
48
+ executables: []
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - examples/melbourne-stations.kml
53
+ - lib/kml/color_style.rb
54
+ - lib/kml/container.rb
55
+ - lib/kml/document.rb
56
+ - lib/kml/feature.rb
57
+ - lib/kml/folder.rb
58
+ - lib/kml/geometry.rb
59
+ - lib/kml/ground_overlay.rb
60
+ - lib/kml/hot_spot.rb
61
+ - lib/kml/icon.rb
62
+ - lib/kml/icon_style.rb
63
+ - lib/kml/lat_lon_box.rb
64
+ - lib/kml/line_string.rb
65
+ - lib/kml/line_style.rb
66
+ - lib/kml/linear_ring.rb
67
+ - lib/kml/link.rb
68
+ - lib/kml/look_at.rb
69
+ - lib/kml/model.rb
70
+ - lib/kml/multi_geometry.rb
71
+ - lib/kml/object.rb
72
+ - lib/kml/overlay.rb
73
+ - lib/kml/placemark.rb
74
+ - lib/kml/point.rb
75
+ - lib/kml/poly_style.rb
76
+ - lib/kml/polygon.rb
77
+ - lib/kml/screen_overlay.rb
78
+ - lib/kml/snippet.rb
79
+ - lib/kml/style.rb
80
+ - lib/kml/style_map.rb
81
+ - lib/kml/style_selector.rb
82
+ - lib/kml/version.rb
83
+ - lib/kml_file.rb
84
+ - lib/ruby_kml.rb
85
+ - LICENSE
86
+ - Rakefile
87
+ - README.md
88
+ - ruby_kml.gemspec
89
+ - test/cdata_and_snippet.kml
90
+ - test/ground_overlays.kml
91
+ - test/kml/point_test.rb
92
+ - test/kml_file_test.rb
93
+ - test/paths.kml
94
+ - test/polygon.kml
95
+ - test/polygon_inner.kml
96
+ - test/polygon_style.kml
97
+ - test/simple_placemark.kml
98
+ - test/style_map.kml
99
+ - test/test_helper.rb
100
+ homepage: http://github.com/schleyfox/ruby_kml
101
+ licenses: []
102
+ post_install_message:
103
+ rdoc_options: []
104
+ require_paths:
105
+ - lib
106
+ required_ruby_version: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ requirements: []
119
+ rubyforge_project:
120
+ rubygems_version: 1.8.23
121
+ signing_key:
122
+ specification_version: 3
123
+ summary: Generate KML files with ruby
124
+ test_files: []