kmlbo 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ kmlbo
2
+ ======
3
+
4
+ A Gem for converting kml path data to ruby arrays, and applying douglas peucker path simplification.
5
+
6
+ Features:
7
+
8
+ 1. Simplify a path using the [Douglas Peucker algorithm](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).
9
+ 2. Apply Douglas Peucker multiple times on the same path, allowing you to compress a line arbitrarily.
10
+ 3. Output as KML or a ruby array.
11
+ 4. KML files are readable by Google Earth.
12
+
13
+ ##Installation
14
+ gem install kmlbo
15
+
16
+ ##Usage Examples
17
+ Parse KML file. Simplify with 5 passes of douglas peucker.
18
+
19
+ ./kmlbo sample.kml simple.rb -s 0.000000001 -k -m 5
20
+ Simplified path from 6371 to 397 points
21
+
22
+ Parse KML file and output all coordinates to a ruby array in a file called simple.rb
23
+
24
+ ./kmlbo sample.kml sample.rb
25
+
26
+ Parse KML file. Simplify the path and output all coordinates to a ruby array in a file called simple.rb
27
+
28
+ ./kmlbo sample.kml simple.rb -s
29
+ Simplified path from 6371 to 3796 points
30
+
31
+ Parse KML file. Simplify the path with a very aggressive epsilon value and output all coordinates to a ruby array in a file called simple.rb
32
+
33
+ ./kmlbo sample.kml simple.rb -s 0.0000001
34
+ Simplified path from 6371 to 3134 points
35
+
36
+ Parse KML file. Simplify the path and output a file called simple.kml
37
+
38
+ ./kmlbo sample.kml simple.kml -k -s
39
+ Simplified path from 6371 to 3796 points
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new do |t|
4
+ t.test_files = FileList['test/*_test.rb']
5
+ end
data/bin/kmlbo ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+ require 'optparse'
3
+ require 'kmlbo/kml'
4
+ require 'kmlbo/pointlist'
5
+
6
+ options = {}
7
+ option_parser = OptionParser.new do |opts|
8
+ opts.banner = "Usage: kmlbo kmlfile outputfile [options]"
9
+ opts.on("-s", "--simplify [EPSILON]", Float, "Simplify the path using the Douglas Peucker algorithm (optionally using EPSILON as simplification factor)") do |epsilon|
10
+ options[:simplify] = true
11
+ options[:epsilon] = epsilon
12
+ end
13
+ opts.on("-m", "--multipass [PASSES]", Integer, "Make n=PASSES # of passes over the same path. If passes not specified defaults to 1.") do |passes|
14
+ options[:passes] = passes
15
+ end
16
+ opts.on("-k", "--kml", "Emit kml instead of ruby") do |kml|
17
+ options[:kml] = true
18
+ end
19
+ end
20
+
21
+ option_parser.parse!
22
+
23
+ kml_file = ARGV[0]
24
+ output_file = ARGV[1]
25
+
26
+ if (kml_file == nil || output_file == nil)
27
+ puts "Missing required argument."
28
+ puts option_parser.banner
29
+ exit 1
30
+ end
31
+
32
+ if options[:simplify]
33
+ coordinates = KML.new(kml_file).simplify!(options[:epsilon], options[:passes])
34
+ else
35
+ coordinates = KML.new(kml_file)
36
+ end
37
+
38
+ if options[:kml]
39
+ File.open(output_file, "w+") do |file|
40
+ file.write(coordinates.to_kml)
41
+ end
42
+ else
43
+ File.open(output_file, "w+") do |file|
44
+ file.write("PATH_COORDINATES = #{coordinates.to_a.to_s}")
45
+ end
46
+ end
data/lib/kmlbo/kml.rb ADDED
@@ -0,0 +1,55 @@
1
+ require 'erb'
2
+
3
+ class KML
4
+ def initialize(kml_file)
5
+ @coordinates = []
6
+ @file_data = ""
7
+ File.open(kml_file, "r") do |file|
8
+ @file_data = file.read
9
+ parse_coordinates
10
+ end
11
+ end
12
+
13
+ def to_a
14
+ @coordinates
15
+ end
16
+
17
+ def simplify!(epsilon=nil, passes=nil)
18
+ original_number_of_coords = @coordinates.size
19
+ @coordinates = PointList.new(@coordinates, epsilon, passes).simplify.tuple_array
20
+ puts "Simplified path from #{original_number_of_coords} to #{@coordinates.size} points"
21
+ self
22
+ end
23
+
24
+ def to_kml
25
+ kml = "No Result."
26
+ File.open("lib/kmlbo/output.kml.erb", "r") do |file|
27
+ mapname = "The Oregon Twail"
28
+ template = ERB.new file.read
29
+ kml = template.result(binding)
30
+ end
31
+ kml
32
+ end
33
+
34
+ private
35
+ def parse_coordinates
36
+ coordinate_string = get_data_between_coordinates_markup
37
+ @coordinates = convert_string_data_to_array_data(coordinate_string) if coordinate_string != ""
38
+ end
39
+
40
+ def get_data_between_coordinates_markup
41
+ result_string = ""
42
+ data_string = @file_data.split("coordinates")
43
+ if data_string[1]
44
+ result_string = data_string[1][1..-3]
45
+ else
46
+ raise "Invalid KML file: Missing coordinates entity"
47
+ end
48
+ result_string
49
+ end
50
+
51
+ def convert_string_data_to_array_data(coordinate_string)
52
+ string_tuples = coordinate_string.split(" ").map!{|s| s.strip}
53
+ coordinate_array = string_tuples.map{|tuple| tuple.split(",").map!{|s| s.to_f }}
54
+ end
55
+ end
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
3
+ <Document>
4
+ <name><%= mapname %>.kml</name>
5
+ <Style id="s_ylw-pushpin">
6
+ <IconStyle>
7
+ <scale>1.1</scale>
8
+ <Icon>
9
+ <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
10
+ </Icon>
11
+ <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
12
+ </IconStyle>
13
+ </Style>
14
+ <StyleMap id="m_ylw-pushpin">
15
+ <Pair>
16
+ <key>normal</key>
17
+ <styleUrl>#s_ylw-pushpin</styleUrl>
18
+ </Pair>
19
+ <Pair>
20
+ <key>highlight</key>
21
+ <styleUrl>#s_ylw-pushpin_hl</styleUrl>
22
+ </Pair>
23
+ </StyleMap>
24
+ <Style id="s_ylw-pushpin_hl">
25
+ <IconStyle>
26
+ <scale>1.3</scale>
27
+ <Icon>
28
+ <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
29
+ </Icon>
30
+ <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
31
+ </IconStyle>
32
+ </Style>
33
+ <Placemark>
34
+ <name><%= mapname %></name>
35
+ <styleUrl>#m_ylw-pushpin</styleUrl>
36
+ <LineString>
37
+ <tessellate>1</tessellate>
38
+ <coordinates>
39
+ <% @coordinates.each do |point| %>
40
+ <%= point[0] %>,<%= point[1] %>,<%= point[2] %>
41
+ <% end %>
42
+ </coordinates>
43
+ </LineString>
44
+ </Placemark>
45
+ </Document>
46
+ </kml>
@@ -0,0 +1,59 @@
1
+ class PointList
2
+
3
+ attr_accessor :tuple_array
4
+ attr_accessor :epsilon
5
+ attr_accessor :passes
6
+ def initialize(tuple_array, epsilon=nil, passes=nil)
7
+ @tuple_array = tuple_array
8
+ @epsilon = epsilon || 0.000001
9
+ @passes = passes || 1
10
+ end
11
+
12
+ def simplify
13
+ @passes.times{@tuple_array = douglas_peucker(@tuple_array, @epsilon)}
14
+ return PointList.new(@tuple_array)
15
+ end
16
+
17
+ def ==(other)
18
+ return true if other.equal?(self)
19
+ return false unless other.instance_of?(self.class)
20
+ @tuple_array == other.tuple_array
21
+ end
22
+
23
+ private
24
+ def douglas_peucker(point_list, epsilon)
25
+ #http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
26
+ maximum_distance_of_point = 0
27
+ index_of_point = 0
28
+ point_list[1..-1].each_with_index do |point, index|
29
+ distance = perpendicular_distance(point, point_list)
30
+ if distance > maximum_distance_of_point
31
+ index_of_point = index + 1
32
+ maximum_distance_of_point = distance
33
+ end
34
+ end
35
+ if maximum_distance_of_point >= epsilon
36
+ douglas_peucker(point_list[0..index_of_point - 1],epsilon) + douglas_peucker(point_list[index_of_point + 1..-1], epsilon)
37
+ else
38
+ point_list
39
+ end
40
+ end
41
+
42
+ def perpendicular_distance(point, point_list)
43
+ distance = Math.sqrt(dist_to_segment_squared(point, point_list.first, point_list.last))
44
+ return distance
45
+ end
46
+
47
+ def magnitude(v,w)
48
+ (w[0] - v[0])**2 + (w[1] - v[1])**2
49
+ end
50
+
51
+ def dist_to_segment_squared(point,seg_start,seg_end)
52
+ l2 = magnitude(seg_start, seg_end)
53
+ return magnitude(point, seg_start) if l2 == 0
54
+ t = ((point[0] - seg_start[0]) * (seg_end[0] - seg_start[0]) + (point[1] - seg_start[1]) * (seg_end[1] - seg_start[1])) / l2;
55
+ return magnitude(point, seg_start) if t < 0
56
+ return magnitude(point, seg_end) if t > 1
57
+ return magnitude(point, [seg_start[0] + t * (seg_end[0] - seg_start[0]), seg_start[1] + t * (seg_end[1] - seg_start[1])]);
58
+ end
59
+ end
data/test/data.rb ADDED
@@ -0,0 +1,266 @@
1
+ class Data
2
+ PATH = [ [-94.42434787909789,39.13594499803094,0], [-94.42434713169446,39.1355875721549,0], [-94.424343522331,39.13486866498771,0],
3
+ [-94.42433930314023,39.13414897981443,0], [-94.42433298666054,39.13307029557503,0], [-94.42432772546127,39.13217218417481,0],
4
+ [-94.42432035853568,39.13091603534691,0], [-94.42408523183347,39.12948549342534,0], [-94.42407999261358,39.12752519556805,0],
5
+ [-94.42384590159547,39.1257436619155,0], [-94.42384356724747,39.12485380961318,0], [-94.42361109912144,39.12360786359678,0],
6
+ [-94.42337922597972,39.12254041387907,0], [-94.42314835768781,39.12182889572636,0], [-94.42268859574925,39.12111707694598,0],
7
+ [-94.42268787473758,39.1204076123314,0], [-94.42245935836796,39.11969879020655,0], [-94.42200234808978,39.11828116075478,0],
8
+ [-94.42177385236366,39.11757234228045,0], [-94.42154527553687,39.11668629986669,0], [-94.42131679491283,39.11597750393334,0],
9
+ [-94.42086017081489,39.11526887051254,0], [-94.42063170047577,39.11456006322743,0], [-94.42040316017187,39.11367404488821,0],
10
+ [-94.42017463078172,39.11278804655583,0], [-94.41994597155094,39.11154764660695,0], [-94.41971705953091,39.11048446668687,0],
11
+ [-94.41925969992695,39.10906708162087,0], [-94.41903041568195,39.10747282939408,0], [-94.41880156576374,39.10641018031532,0],
12
+ [-94.41857251399196,39.10499357357227,0], [-94.41857203715509,39.10428543146035,0], [-94.41834317306746,39.10304625935382,0],
13
+ [-94.41834271235973,39.10233834428542,0], [-94.41834213758936,39.1014535754908,0], [-94.41834156106445,39.10056894211989,0],
14
+ [-94.41834144647518,39.10039203106903,0], [-94.41834075668976,39.09933068777081,0], [-94.41834041104873,39.09880009121007,0],
15
+ [-94.41833995042188,39.09809270340707,0], [-94.41833914581258,39.09685498484459,0], [-94.41833868550501,39.09614783429327,0],
16
+ [-94.41856596055173,39.09526436667128,0], [-94.41879330708404,39.09455778643111,0], [-94.41879294130862,39.09349676249897,0],
17
+ [-94.4190213815574,39.09208003735193,0], [-94.4190214987381,39.09137186343526,0], [-94.41924984149705,39.09066311496973,0],
18
+ [-94.41925000206294,39.08977770809364,0], [-94.41947707750435,39.08889511385615,0], [-94.41947847780006,39.08800654142989,0],
19
+ [-94.41947830262873,39.08676798021873,0], [-94.41970702758691,39.0858809008084,0], [-94.41970763912319,39.08499396901736,0],
20
+ [-94.41970812657428,39.08428432547477,0], [-94.41993704614397,39.08321934800448,0], [-94.42016599709601,39.08215415111723,0],
21
+ [-94.42039455094164,39.08091301176559,0], [-94.42062305997497,39.08002616545222,0], [-94.42085156294762,39.07896217756394,0],
22
+ [-94.42108010728658,39.07807514339386,0], [-94.42130869558483,39.07736508614754,0], [-94.42153721992865,39.0761237289552,0],
23
+ [-94.42199457540961,39.07523446366959,0], [-94.42222324018749,39.07452410842033,0], [-94.42222312065556,39.07381571452603,0],
24
+ [-94.42245179995524,39.0731052532856,0], [-94.42313818704129,39.0722133575057,0], [-94.4238248227777,39.07149833642482,0],
25
+ [-94.42428256398664,39.07043092330115,0], [-94.42496955065126,39.06971539366868,0], [-94.42565669442229,39.06882240276021,0],
26
+ [-94.42611488001234,39.06810872907799,0], [-94.42680246567886,39.06756979185517,0], [-94.43906619777358,39.04142972526056,0],
27
+ [-94.43906265917977,39.02614652913991,0], [-94.44692566565311,39.01391846395993,0], [-94.46265453849664,39.00474334919518,0],
28
+ [-94.47444662169701,38.99556796312245,0], [-94.4822975193924,38.98027978133522,0], [-94.49014857879763,38.96804739314368,0],
29
+ [-94.50587454517184,38.96803687892652,0], [-94.52159570400319,38.96496744867095,0], [-94.54124604053521,38.96189194015415,0],
30
+ [-94.55696941164857,38.96187473173824,0], [-94.57661751187803,38.95879250229633,0], [-94.59625965950816,38.95264803420768,0],
31
+ [-94.60803780166336,38.94651373839447,0], [-94.62374539941526,38.94037060143672,0], [-94.63552055915565,38.9342328573115,0],
32
+ [-94.65516499465414,38.9311343677652,0], [-94.67086799853699,38.92498388153763,0], [-94.68657998787484,38.92188881840381,0],
33
+ [-94.70230261020174,38.92184912933072,0], [-94.71408333911258,38.91876009808039,0], [-94.73373739889388,38.91870571846134,0],
34
+ [-94.74946136210234,38.91865984417512,0], [-94.76518601385372,38.91861167448434,0], [-94.78484266626018,38.91854863684799,0],
35
+ [-94.80059878165062,38.92461220794067,0], [-94.82025864352744,38.92454341779841,0], [-94.83600367123866,38.92754418074792,0],
36
+ [-94.85961585248613,38.93051252013769,0], [-94.87929813720787,38.93349229010197,0], [-94.89898282168775,38.93646893930057,0],
37
+ [-94.91866996455546,38.93944235426828,0], [-94.93443298938212,38.94242902327998,0], [-94.95017980670015,38.94235498103127,0],
38
+ [-94.96594910694515,38.94533749082733,0], [-94.98169900689184,38.94525923759385,0], [-94.9974501900553,38.94517874829324,0],
39
+ [-95.01320879298498,38.94509548805762,0], [-95.02899590754589,38.94806878164797,0], [-95.0447603379783,38.94798099107413,0],
40
+ [-95.06052638240017,38.9478911565774,0], [-95.0722980455114,38.94170305981611,0], [-95.09198025290308,38.93852552137847,0],
41
+ [-95.10772114877656,38.93536872511756,0], [-95.12343341091572,38.92914916703014,0], [-95.1392044218826,38.929047546545,0],
42
+ [-95.16286404704503,38.92889124207191,0], [-95.18258341099396,38.92875732893216,0], [-95.19839301603977,38.93170876120576,0],
43
+ [-95.21423855349782,38.93771962848243,0], [-95.23005484054028,38.94066763576204,0], [-95.24978665990587,38.94052304183802,0],
44
+ [-95.2695211148277,38.94037529320657,0], [-95.28539761117516,38.94637679999097,0], [-95.30124773246696,38.94931445225143,0],
45
+ [-95.31713875360143,38.95531286619091,0], [-95.33299726701193,38.95824743463918,0], [-95.34885137680369,38.96118098963993,0],
46
+ [-95.36470507249398,38.96411301772083,0], [-95.38052438846125,38.9639800121877,0], [-95.39638435716003,38.96690828328128,0],
47
+ [-95.41228624101008,38.9728985952347,0], [-95.42819297072363,38.97888740529064,0], [-95.44410436674526,38.98487483938739,0],
48
+ [-95.46393866581795,38.98776078924614,0], [-95.47977634265652,38.98761597050624,0], [-95.49966113376955,38.99356118911751,0],
49
+ [-95.51158654608969,38.99651411543535,0], [-95.52751931882949,39.0024932978482,0], [-95.54345671473433,39.00847106911025,0],
50
+ [-95.55939868106037,39.01444720771116,0], [-95.57534516383004,39.02042213183258,0], [-95.59516985727383,39.02022458895321,0],
51
+ [-95.61499809677191,39.02002373586146,0], [-95.62690106157525,39.01990187009752,0], [-95.64682967307506,39.02276172141747,0],
52
+ [-95.6627937950129,39.0256610263488,0], [-95.67496475844587,39.0378020944565,0], [-95.6910022569221,39.04376709774479,0],
53
+ [-95.69914451604333,39.05288445574433,0], [-95.71133309094287,39.06502741382582,0], [-95.71549955392067,39.07418880312635,0],
54
+ [-95.72371315560362,39.08637645451625,0], [-95.72794539134112,39.0986074958136,0], [-95.72819325460654,39.11088164110078,0],
55
+ [-95.72825541596112,39.11395018875914,0], [-95.73215079897984,39.12146210684624,0], [-95.73431157897201,39.12389354771273,0],
56
+ [-95.73752911346286,39.12631274536548,0], [-95.74183517432756,39.13035645243425,0], [-95.74401223133259,39.13360589621086,0],
57
+ [-95.75043208239826,39.13762431725367,0], [-95.75576333823648,39.14001769805829,0], [-95.76003800701415,39.14242308970579,0],
58
+ [-95.76429662763022,39.14400987369388,0], [-95.76642590203467,39.14480315807646,0], [-95.77170688434377,39.14474067384222,0],
59
+ [-95.77596309095642,39.1463272959247,0], [-95.78023536661166,39.14873215378042,0], [-95.78133945387489,39.15117463041562,0],
60
+ [-95.78463621321525,39.15768354631528,0], [-95.78782082258037,39.15846386376105,0], [-95.79313388746617,39.16003686482235,0],
61
+ [-95.80164749559887,39.16320786608316,0], [-95.8122700760791,39.16635335082438,0], [-95.81974243797897,39.17035479427776,0],
62
+ [-95.82825469821627,39.17352442365021,0], [-95.83571168243023,39.17670639657386,0], [-95.84315242947798,39.17906960378262,0],
63
+ [-95.85061035205933,39.18225046759846,0], [-95.86018044550347,39.18540421654997,0], [-95.86656648684917,39.18777900588783,0],
64
+ [-95.87295284379998,39.190153363509,0], [-95.87932231778653,39.19170913961498,0], [-95.88569114168213,39.19326526948105,0],
65
+ [-95.89204277734548,39.19400292262524,0], [-95.89947001338643,39.19554256675379,0], [-95.90902733939598,39.19787120647088,0],
66
+ [-95.91858410421452,39.20019940356614,0], [-95.92923160584981,39.20414951655436,0], [-95.93776784010029,39.20812678536991,0],
67
+ [-95.94628665818739,39.21128518627923,0], [-95.95693564695344,39.21523207833381,0], [-95.96439855867229,39.2184061537752,0],
68
+ [-95.97189826938329,39.22321814137389,0], [-95.97827040762621,39.22476914028385,0], [-95.98362376261515,39.2279683937014,0],
69
+ [-95.99320148184084,39.23110733400193,0], [-96.00172345435308,39.23426035999096,0], [-96.00383533905449,39.23423013115841,0],
70
+ [-96.00913357260725,39.23497272105885,0], [-96.01335705445325,39.23491233542224,0], [-96.01971118001076,39.23564122138876,0],
71
+ [-96.02923283698954,39.23632487836785,0], [-96.03982917426639,39.23781062691022,0], [-96.04936970448378,39.2393105539183,0],
72
+ [-96.05998539606054,39.24161237943985,0], [-96.07165800674592,39.24389942555632,0], [-96.08329245654207,39.24455037078024,0],
73
+ [-96.0928349764759,39.24604875916298,0], [-96.10341381717168,39.24671300952497,0], [-96.11084507104502,39.248240738664,0],
74
+ [-96.12039510338128,39.24974463301226,0], [-96.13425686611393,39.25446265954736,0], [-96.14279520831421,39.25761703103557,0],
75
+ [-96.15666854869222,39.26233836043138,0], [-96.16843881010199,39.26709596792121,0], [-96.179173521424,39.27268409570529,0],
76
+ [-96.18881306120477,39.27665137398648,0], [-96.19843636219629,39.27980153540209,0], [-96.20592123779559,39.2821608012551,0],
77
+ [-96.21236648990659,39.2853507374105,0], [-96.21771244714336,39.28691920996003,0], [-96.22417240368998,39.29011900091324,0],
78
+ [-96.23172049743093,39.29412689469802,0], [-96.23496512003716,39.29653895249971,0], [-96.24146564786818,39.30217307019062,0],
79
+ [-96.24470032209149,39.3045763039761,0], [-96.24901338795661,39.30778036859365,0], [-96.25651947039955,39.31174993853863,0],
80
+ [-96.26186903955069,39.31411722302899,0], [-96.26721864758535,39.3164841181386,0], [-96.27256843401922,39.31885066186907,0],
81
+ [-96.27789705659914,39.3203986311543,0], [-96.28005406989773,39.32199965162536,0], [-96.37445751035315,39.35436919460723,0],
82
+ [-96.43851102949529,39.35353887556461,0], [-96.48213850615056,39.37762575066939,0], [-96.51499422653353,39.40178621393409,0],
83
+ [-96.53718739654288,39.4260827680228,0], [-96.59141536479333,39.44989740038085,0], [-96.634688278561,39.46564477320495,0],
84
+ [-96.68863469572109,39.48120235523206,0], [-96.73221477873693,39.50509075428191,0], [-96.76513674857743,39.52913119162624,0],
85
+ [-96.79806988167032,39.55315417692029,0], [-96.84199798514975,39.58515647010739,0], [-96.8749547884501,39.6091371330974,0],
86
+ [-96.90792268888534,39.63309990022927,0], [-96.96191980698805,39.64846940884063,0], [-97.00557832140271,39.67218687250361,0],
87
+ [-97.04954606157392,39.70403662346639,0], [-97.10413809147813,39.73561280952716,0], [-97.13642819639371,39.74310414177793,0],
88
+ [-97.19105794978748,39.77462266880862,0], [-97.23576959009523,39.82267060976801,0], [-97.26951033715248,39.86276289334834,0],
89
+ [-97.3022003143259,39.87835165885096,0], [-97.34628355156039,39.90999545345893,0], [-97.40068408132876,39.93319915456825,0],
90
+ [-97.45510103935142,39.95636873190394,0], [-97.49887544578337,39.97977154652661,0], [-97.52095915809618,39.99553970689161,0],
91
+ [-97.58685950462566,40.03465361906864,0], [-97.60896667092754,40.05039491457791,0], [-97.68479360376644,40.07285768765514,0],
92
+ [-97.73965248911367,40.10397254146737,0], [-97.76173054093252,40.11965627838369,0], [-97.82762388696258,40.15854197663116,0],
93
+ [-97.88252059001364,40.18955891842174,0], [-97.91531713854246,40.20490077282719,0], [-97.94853989505883,40.2283692580322,0],
94
+ [-97.98178418753795,40.2518278339892,0], [-98.04791179646971,40.29057615362321,0], [-98.102998886387,40.32147855454798,0],
95
+ [-98.16837050305747,40.34388057857718,0], [-98.21197539088375,40.3587930259376,0], [-98.26627618167201,40.37334196529842,0],
96
+ [-98.33265907520082,40.41190981740127,0], [-98.40838347786556,40.42567844703125,0], [-98.46370696864234,40.45639569783981,0],
97
+ [-98.51810598567704,40.47082932895879,0], [-98.5628194132446,40.50187381547747,0], [-98.61727942939105,40.51626188399723,0],
98
+ [-98.67327690513935,40.55501839169801,0], [-98.7497284477377,40.57670979872515,0], [-98.80377365067842,40.5828806786622,0],
99
+ [-98.84659722737328,40.5812945458766,0], [-98.86853668092147,40.58862644197239,0], [-98.94455760187616,40.60205962244191,0],
100
+ [-98.99918925752431,40.61627033339154,0], [-99.04313227568613,40.63087270993534,0], [-99.0769342159648,40.65400882191548,0],
101
+ [-99.12092009506509,40.66858231532068,0], [-99.17510953338478,40.6745991192855,0], [-99.19656876215623,40.67375109196274,0],
102
+ [-99.25022076268408,40.67161236465778,0], [-99.32534270673609,40.66857654831298,0], [-99.3682742476808,40.66681942992756,0],
103
+ [-99.42194325676873,40.66460048727376,0], [-99.47561752391852,40.66235630864209,0], [-99.52990820063681,40.66822004554542,0],
104
+ [-99.58421707734092,40.6740591165336,0], [-99.62717870331413,40.67220589646893,0], [-99.67077232540123,40.67847040922116,0],
105
+ [-99.70300179202947,40.67705796668982,0], [-99.75800041083886,40.69095261168111,0], [-99.81237913479839,40.69668694273661,0],
106
+ [-99.86747382494326,40.71054599865657,0], [-99.92200093707162,40.71626162301776,0], [-99.97588156065082,40.71381509293109,0],
107
+ [-100.0203442363581,40.72811675976028,0], [-100.0763063116692,40.75004474356194,0], [-100.1316328463573,40.76381147834689,0],
108
+ [-100.1647085747214,40.77043278847671,0], [-100.2424457830213,40.79129012675292,0], [-100.29795446923,40.80500795540121,0],
109
+ [-100.355020305414,40.83501561346284,0], [-100.3998122464706,40.84922194315329,0], [-100.4353516720875,40.88026626671734,0],
110
+ [-100.4918303539594,40.90207913619896,0], [-100.5266871809751,40.92495315775204,0], [-100.5616216418171,40.94783693596147,0],
111
+ [-100.6176257787109,40.96149844183981,0], [-100.6535105775769,40.99256049706098,0], [-100.7096234402834,41.00619610601871,0],
112
+ [-100.7674370897827,41.03616073423937,0], [-100.8026659149461,41.05904058481401,0], [-100.8589491393688,41.07263186594001,0],
113
+ [-100.9051974448017,41.09494330739189,0], [-100.960729880933,41.10031694404831,0], [-101.0600742450046,41.10337798007009,0],
114
+ [-101.1384796927392,41.11570755248651,0], [-101.2279309891533,41.12740429427053,0], [-101.2828889794113,41.1244818532271,0],
115
+ [-101.3379585419302,41.1215560044307,0], [-101.4050024810917,41.12620516390979,0], [-101.4601392013995,41.1232194129994,0],
116
+ [-101.5153017353713,41.12020617661319,0], [-101.5604001329668,41.12597746863351,0], [-101.6184971116028,41.14753125485492,0],
117
+ [-101.6776558809505,41.17728368934737,0], [-101.7470216440719,41.19819577188123,0], [-101.806383202027,41.22792594265393,0],
118
+ [-101.8648495500434,41.24943060754224,0], [-101.9001678944119,41.26397032384683,0], [-101.9689397651485,41.2766087650142,0],
119
+ [-102.0166856323332,41.29876684208484,0], [-102.0746534686738,41.31205556680556,0], [-102.1338058352517,41.33357877614099,0],
120
+ [-102.1921100166359,41.34688376876733,0], [-102.2515781961472,41.36841874431864,0], [-102.2998793368996,41.39059040162034,0],
121
+ [-102.3595285226989,41.41210982850908,0], [-102.439619686618,41.41578701456153,0], [-102.5073811342784,41.41181537646298,0],
122
+ [-102.5876489497156,41.41539365055742,0], [-102.6238866389875,41.42990567629177,0], [-102.6727218733491,41.45202470147103,0],
123
+ [-102.7216733862742,41.47415573368572,0], [-102.7594046793903,41.49698505998175,0], [-102.7707840161182,41.49630585486219,0],
124
+ [-102.8181435995815,41.50635987695829,0], [-102.8350369668186,41.51411129789156,0], [-102.8723682068373,41.52641172930096,0],
125
+ [-102.9151639624563,41.55013127673082,0], [-102.961496437536,41.57062641152379,0], [-103.0164094617923,41.5963763437063,0],
126
+ [-103.0625122929466,41.616702236118,0], [-103.1082331709294,41.63408192705943,0], [-103.1703738779982,41.65614905131535,0],
127
+ [-103.2204399752443,41.67611729521726,0], [-103.2744334715097,41.69577601431859,0], [-103.3241207672045,41.7127689861649,0],
128
+ [-103.365986561516,41.73030266704446,0], [-103.407460883524,41.74490368045708,0], [-103.4411112385301,41.76005647027463,0],
129
+ [-103.4747206382588,41.77517393208147,0], [-103.5165443041076,41.79259881374058,0], [-103.550170427647,41.80768629051343,0],
130
+ [-103.5838043437112,41.82276047349066,0], [-103.6170433426665,41.83491624948272,0], [-103.6472019145169,41.85317100007688,0],
131
+ [-103.6938009069987,41.87602485982334,0], [-103.7188443607176,41.88583518456287,0], [-103.7481761857292,41.89822673665301,0],
132
+ [-103.7680794071116,41.89960734355827,0], [-103.8286377266506,41.90954365188369,0], [-103.8606670009705,41.91289532799443,0],
133
+ [-103.8818259077725,41.92296722261464,0], [-103.9025752616629,41.93013254893103,0], [-103.9436686807553,41.94154928987697,0],
134
+ [-103.9856125217563,41.95875425045551,0], [-104.0531011144734,41.98856866770243,0], [-104.1154539096139,42.00995427698185,0],
135
+ [-104.1657258621771,42.029356658259,0], [-104.2164654558782,42.0516400396378,0], [-104.2668114274289,42.07100301016992,0],
136
+ [-104.3124229780204,42.08486957604818,0], [-104.3506855403115,42.1022706770657,0], [-104.3924486703716,42.11643609788702,0],
137
+ [-104.4259670764409,42.12833992539069,0], [-104.4560322968371,42.14346438134182,0], [-104.4939498098899,42.15792736704103,0],
138
+ [-104.5231590209694,42.16723457766822,0], [-104.552830324927,42.17943789255127,0], [-104.5859651822332,42.18839607559794,0],
139
+ [-104.6112882529147,42.19801441174967,0], [-104.6375263589643,42.21343148447849,0], [-104.6628726023386,42.22304064506524,0],
140
+ [-104.6882291668726,42.23264522977329,0], [-104.7140530715362,42.24514744468816,0], [-104.731584677593,42.25541561072313,0],
141
+ [-104.7491235156213,42.2656819087025,0], [-104.7500410678106,42.27148645709702,0], [-104.7671338763325,42.27885037960233,0],
142
+ [-104.7852070723954,42.29203609465487,0], [-104.8023654568529,42.29941492552319,0], [-104.8239405820165,42.30936327422753,0],
143
+ [-104.8376360775353,42.31997818431059,0], [-104.8587670780171,42.32702044760862,0], [-104.8843249481173,42.33663035682616,0],
144
+ [-104.9108375980248,42.35204829478626,0], [-104.9413257545342,42.36712898030342,0], [-104.9806596215815,42.38733076112924,0],
145
+ [-105.0160791046899,42.40786694344358,0], [-105.0515349334542,42.42839981144491,0], [-105.0761407869501,42.45578287158826,0],
146
+ [-105.0943863294944,42.46895945331059,0], [-105.1131313234042,42.48504709509121,0], [-105.126887601334,42.49562944611428,0],
147
+ [-105.1440642064721,42.50293130268379,0], [-105.1618968468959,42.5132092393884,0], [-105.1793057863696,42.52060001079504,0],
148
+ [-105.1962035813836,42.52506618415199,0], [-105.2215631365796,42.53176303305601,0], [-105.2350337249284,42.53949785680576,0],
149
+ [-105.2635030553788,42.56375188454887,0], [-105.2732872119306,42.57461540980665,0], [-105.2983076325657,42.58116387749335,0],
150
+ [-105.3277463230342,42.59024304701977,0], [-105.3493341201601,42.60002937787179,0], [-105.3665115747057,42.60727692920658,0],
151
+ [-105.3876224825341,42.61416294098108,0], [-105.4259265864101,42.62828313590791,0], [-105.4465586315289,42.63226570554399,0],
152
+ [-105.4642466290831,42.64239019013134,0], [-105.4819132972776,42.65250879479894,0], [-105.4951574638278,42.6600935227149,0],
153
+ [-105.5084022190872,42.66767523403328,0], [-105.5216474546411,42.67525379412642,0], [-105.5383192625065,42.67957336952244,0],
154
+ [-105.5648105159561,42.69471475440086,0], [-105.5829693425643,42.70769129351117,0], [-105.5962172042316,42.71525299426394,0],
155
+ [-105.6099635901237,42.72569993720398,0], [-105.6291838381446,42.74445332097685,0], [-105.6647819159429,42.7646618306759,0],
156
+ [-105.6820790212558,42.77187176846743,0], [-105.7161751704994,42.78339347832755,0], [-105.7418943316232,42.79275454326569,0],
157
+ [-105.771042902872,42.79884500425648,0], [-105.7883823327856,42.80604645747914,0], [-105.8052008418541,42.81034985680503,0],
158
+ [-105.830455854934,42.81680742376317,0], [-105.848384461611,42.82691229115603,0], [-105.8618391641371,42.83449169200249,0],
159
+ [-105.891112347223,42.84057927876466,0], [-105.9193235040526,42.84086171756685,0], [-105.9317250891479,42.84263792151663,0],
160
+ [-105.948083745598,42.84403748676031,0], [-105.963902693161,42.84253469152232,0], [-105.9887231613163,42.84607718982444,0],
161
+ [-106.0135538200744,42.84961543836022,0], [-106.0299301339859,42.85100456975752,0], [-106.062693303691,42.85377654627133,0],
162
+ [-106.090957133457,42.85401895902155,0], [-106.1028344995148,42.85287670000612,0], [-106.1316650421271,42.85601140151869,0],
163
+ [-106.152014583094,42.85699978067348,0], [-106.1763671919832,42.85761023805136,0], [-106.1969365774875,42.85864053765706,0],
164
+ [-106.2168490346705,42.85673937079351,0], [-106.2327314999793,42.85520408237729,0], [-106.2525868436916,42.85328141184123,0],
165
+ [-106.2684730522792,42.85174074132623,0], [-106.2962777682727,42.84903859163055,0], [-106.3042229859784,42.84826510737872,0],
166
+ [-106.3360077425385,42.84516530198501,0], [-106.3558764765349,42.84322312111598,0], [-106.3876720728202,42.84010735618452,0],
167
+ [-106.4194741257945,42.83698207734172,0], [-106.4592358492798,42.83306155026954,0], [-106.471166359681,42.83188246552087,0],
168
+ [-106.5054815784899,42.82433505943455,0], [-106.521245289131,42.82272857945415,0], [-106.5409463267,42.82071828409237,0],
169
+ [-106.5567045535074,42.81910749423458,0], [-106.5842757825016,42.81628393670678,0], [-106.6039650988143,42.81426328668901,0],
170
+ [-106.6197138088361,42.81264464041005,0], [-106.6349151390171,42.8081331476962,0], [-106.6692400474884,42.79869978860409,0],
171
+ [-106.6956798701665,42.79007320032771,0], [-106.7069288231002,42.78596208051665,0], [-106.7305191562668,42.78351517836064,0],
172
+ [-106.7456919656331,42.77899289359227,0], [-106.7647901489703,42.77406190927827,0], [-106.7962219952419,42.7707939282958,0],
173
+ [-106.8237186913699,42.76792775105086,0], [-106.8377601869791,42.75762774827114,0], [-106.8557204888421,42.74691663331567,0],
174
+ [-106.8697478658083,42.73661543422801,0], [-106.8843280701099,42.72920155759094,0], [-106.9028270060564,42.72137688138105,0],
175
+ [-106.9213195936879,42.71354975126461,0], [-106.9398059215844,42.70572063419958,0], [-106.9588482372528,42.70077327300599,0],
176
+ [-106.9812424185666,42.69252563014179,0], [-107.0069821441575,42.68097656435452,0], [-107.0338543209112,42.67520004734542,0],
177
+ [-107.0528881334643,42.67024961325772,0], [-107.0680001217005,42.66571029753243,0], [-107.0942998339868,42.65704106060513,0],
178
+ [-107.106056604017,42.65579412641905,0], [-107.1329185133066,42.64999760776121,0], [-107.1597768044632,42.64419441630849,0],
179
+ [-107.1793679807212,42.64210375066418,0], [-107.1944674820538,42.63754691682727,0], [-107.221318065405,42.63172884466884,0],
180
+ [-107.2358401042684,42.62428535819436,0], [-107.2458668660898,42.61437939930092,0], [-107.2553142817509,42.60159112106834,0],
181
+ [-107.2687948115596,42.60897194305108,0], [-107.2711030018619,42.6204981464103,0], [-107.2734121654798,42.63202488966708,0],
182
+ [-107.2751446508214,42.64067022279713,0], [-107.2780334361698,42.65507995935071,0], [-107.2815019025458,42.67237258724537,0],
183
+ [-107.2883167723837,42.68636243967276,0], [-107.3006646492568,42.68797926325399,0], [-107.3220214394177,42.6945143755346,0],
184
+ [-107.3366994409699,42.70765813333758,0], [-107.3502203158079,42.71503592408314,0], [-107.3592365039883,42.71995377744419,0],
185
+ [-107.3733481472857,42.73021261982152,0], [-107.3835464030686,42.74089894370115,0], [-107.3937665926282,42.7515934692625,0],
186
+ [-107.411268748258,42.7585563481617,0], [-107.4436428226794,42.76511986395496,0], [-107.4634044451925,42.76298800658504,0],
187
+ [-107.4713076627911,42.76213451516281,0], [-107.5029124620103,42.75871556456124,0], [-107.5187100067003,42.75700320032002,0],
188
+ [-107.5384521628616,42.75486008134506,0], [-107.5542422908947,42.75314355238577,0], [-107.558189349947,42.75271397586557,0],
189
+ [-107.590334002536,42.75215481980511,0], [-107.5976176246195,42.7484069520017,0], [-107.6109911669125,42.73514162568912,0],
190
+ [-107.620421551036,42.72230832362819,0], [-107.6298477608646,42.70947474973796,0], [-107.6449921084335,42.70486000375097,0],
191
+ [-107.6646633057003,42.70269385028796,0], [-107.6921967864501,42.69965612584242,0], [-107.7230550226347,42.69329417073779,0],
192
+ [-107.76116009338,42.68317013676756,0], [-107.7796029447958,42.67522220725686,0], [-107.7907859184573,42.67102892506184,0],
193
+ [-107.8176608738946,42.66507859339254,0], [-107.8451207857327,42.66199989950196,0], [-107.8568873510194,42.66067858226741,0],
194
+ [-107.8725747426143,42.65891502976596,0], [-107.9117849525106,42.65449728777546,0], [-107.9521837086456,42.65581985983815,0],
195
+ [-107.9958814966664,42.65379951777761,0], [-108.0311306207704,42.6497793523812,0], [-108.0664103637243,42.64577146431009,0],
196
+ [-108.0977682004988,42.64220668031117,0], [-108.117360964443,42.63997477571932,0], [-108.1291142467393,42.63863421824328,0],
197
+ [-108.1565323993042,42.63550215179078,0], [-108.1781863775046,42.62419165554884,0], [-108.2187736695262,42.60776147169336,0],
198
+ [-108.2416242678581,42.60219089794243,0], [-108.2644658398708,42.5966170385806,0], [-108.2945003593309,42.58727352395244,0],
199
+ [-108.3499961845191,42.5661740789895,0], [-108.38777996963,42.55592701426082,0], [-108.4138355081154,42.54702872014251,0],
200
+ [-108.4437703514256,42.53767044339988,0], [-108.4743096939418,42.53115852942418,0], [-108.5054636206042,42.52751582990246,0],
201
+ [-108.5677311514045,42.52020835623374,0], [-108.5988447882653,42.5165439283891,0], [-108.6266984357632,42.51616995215509,0],
202
+ [-108.6597059310506,42.52105783771263,0], [-108.6849345529859,42.52687942029657,0], [-108.7218274465218,42.53128426118663,0],
203
+ [-108.7296034373505,42.53034356646653,0], [-108.745154623444,42.5284604551316,0], [-108.7684794610045,42.52563193336879,0],
204
+ [-108.7840279289127,42.52374361110579,0], [-108.8163911432114,42.52571359201464,0], [-108.8409794771404,42.52862307405601,0],
205
+ [-108.8694529326041,42.53105177753727,0], [-108.8849962706848,42.52915014669611,0], [-108.9134668146645,42.53156776865237,0],
206
+ [-108.9412991155685,42.53110332312338,0], [-108.973650640349,42.53302809211023,0], [-109.0060935390927,42.53486478337371,0],
207
+ [-109.047697899164,42.54140112272665,0], [-109.0847933213457,42.5455432924341,0], [-109.1219146030817,42.54967597760236,0],
208
+ [-109.1382014504663,42.55055469789895,0], [-109.1590617534005,42.55379875913894,0], [-109.1968971520694,42.56077734289083,0],
209
+ [-109.2654920868269,42.57857708728061,0], [-109.3050828506089,42.59428088296864,0], [-109.3477730413102,42.60666105818154,0],
210
+ [-109.3912944896852,42.61871137504554,0], [-109.4400387507223,42.63603498911409,0], [-109.5062186250866,42.6600509071183,0],
211
+ [-109.5239258551801,42.66664236674086,0], [-109.5600308804921,42.68269040473598,0], [-109.5876331000818,42.6968748549131,0],
212
+ [-109.6277190956508,42.71240236270666,0], [-109.6454703930759,42.71898151490219,0], [-109.6632279478146,42.72555888474024,0],
213
+ [-109.7047900669866,42.74680112961542,0], [-109.7233136607217,42.75623460307586,0], [-109.7418470361253,42.7656671467107,0],
214
+ [-109.7518006525844,42.77325410836177,0], [-109.7696656590599,42.77981443646775,0], [-109.7882236556894,42.78924481213576,0],
215
+ [-109.8035610825278,42.80205577279124,0], [-109.8282242862342,42.8195802520879,0], [-109.8496367201007,42.84049224990817,0],
216
+ [-109.8603504471935,42.85094873713627,0], [-109.8731553019437,42.87002083200093,0], [-109.8948326266763,42.90868122559375,0],
217
+ [-109.9076788745049,42.92775578584942,0], [-109.9205348466743,42.94683154159375,0], [-109.9273171809408,42.95780585462057,0],
218
+ [-109.9542401716482,42.9839612429974,0], [-109.9697059210057,42.99678372398513,0], [-109.9743939900914,42.99914301477383,0],
219
+ [-110.0116262265788,43.02588026697524,0], [-110.3202691283122,43.0873250704592,0], [-110.5711191156619,43.05406221154962,0],
220
+ [-110.7570983601939,43.05599219016827,0], [-111.0289964876497,43.09990517923504,0], [-111.2441143500985,43.20541409967721,0],
221
+ [-111.3304377302924,43.24753725002008,0], [-111.4889334264822,43.27947396823049,0], [-111.8863609265265,43.35844721778994,0],
222
+ [-112.0382115260022,43.36360495982728,0], [-112.31386489748,43.40474914543584,0], [-112.3938550245297,43.42011538419191,0],
223
+ [-112.6229331641025,43.54990041335959,0], [-112.7407357862478,43.55991906786264,0], [-112.8220451396309,43.57524050675887,0],
224
+ [-112.9564282056267,43.63731785201576,0], [-113.2015191629787,43.68278669998649,0], [-113.4190259646859,43.75955619885404,0],
225
+ [-113.6829728826888,43.85653340688022,0], [-113.8196794080113,43.91791813380476,0], [-114.1314690578344,44.03458308360466,0],
226
+ [-114.223444320055,44.07528578727185,0], [-114.454205298087,44.176839402078,0], [-114.5377683081099,44.1911888530077,0],
227
+ [-114.7981873975795,44.26010995351954,0], [-115.0409521184844,44.38704797967105,0], [-115.2286369653594,44.46741449544282,0],
228
+ [-115.2851859580543,44.5136826966357,0], [-115.3905249665152,44.4915439208687,0], [-115.4221346356526,44.48607009570687,0],
229
+ [-115.4892998682174,44.48631579982042,0], [-115.6117739368522,44.50066020732822,0], [-115.7960294165589,44.56953929048093,0],
230
+ [-115.9359992158075,44.65224601170364,0], [-116.0462855295407,44.74576104760423,0], [-116.1446374340717,44.85290496185366,0],
231
+ [-116.1829700243552,44.91129292634743,0], [-116.2482540206478,44.92909609449266,0], [-116.3036416906274,44.94273451514243,0],
232
+ [-116.3768264245675,44.95901982497067,0], [-116.6025658081236,45.02420816428307,0], [-116.7080162458492,45.08173411359885,0],
233
+ [-116.7802228247509,45.13949794675084,0], [-116.852564743527,45.19720800695883,0], [-116.9034360203595,45.26485099865408,0],
234
+ [-116.9523261939333,45.32692727180061,0], [-117.0150391247838,45.38045658508221,0], [-117.0736267639002,45.4228623868228,0],
235
+ [-117.1502511847398,45.46776719071698,0], [-117.1745965130765,45.48691538687996,0], [-117.2068747114532,45.50455034316485,0],
236
+ [-117.3074104946781,45.54482095472738,0], [-117.3800022243085,45.57848609129383,0], [-117.4706399894837,45.61459812875776,0],
237
+ [-117.6376645269244,45.67168433418168,0], [-117.8050289373655,45.72862761411471,0], [-117.9389071621765,45.78612520400829,0],
238
+ [-118.050585722927,45.82999174458843,0], [-118.2203244269091,45.86847882770864,0], [-118.4338700006849,45.92848075244726,0],
239
+ [-118.5833080784324,45.97712371993177,0], [-118.6244866931694,45.99304002850229,0], [-118.7374771437323,45.99467926372802,0],
240
+ [-118.782049792326,45.99784598157466,0], [-118.8346196798541,45.99939891434774,0], [-118.9214771865179,46.00006218666392,0],
241
+ [-119.0060067441068,45.99510242606735,0], [-119.0746107070191,45.99331051581182,0], [-119.1384356899567,45.9803625004123,0],
242
+ [-119.1783219858251,45.97224996304873,0], [-119.2182045207472,45.96412176675689,0], [-119.2923952532865,45.95499948469934,0],
243
+ [-119.3426213301406,45.95071327396453,0], [-119.398391147288,45.9392110352597,0], [-119.4541492202925,45.92767930330068,0],
244
+ [-119.5178581292883,45.91446420748284,0], [-119.5577591699527,45.90622721115593,0], [-119.6081580651822,45.90189656229478,0],
245
+ [-119.6610418302913,45.9030908736845,0], [-119.7034825232582,45.90036824373553,0], [-119.7619255990008,45.89430866087267,0],
246
+ [-119.8228785403877,45.89376575651502,0], [-119.8813625683404,45.88764044446993,0], [-119.9583752550112,45.88368054425785,0],
247
+ [-120.0383839451679,45.8668846027953,0], [-120.0863891253761,45.85677496950456,0], [-120.1263889270439,45.84833048843597,0],
248
+ [-120.1878460978743,45.82923802002494,0], [-120.2412918473958,45.81180642606314,0], [-120.3376251858291,45.77302404970449,0],
249
+ [-120.4336090617967,45.75248444474622,0], [-120.4816017045181,45.74217852840895,0], [-120.5455923606365,45.7284000614235,0],
250
+ [-120.5775875333827,45.72149487405979,0], [-120.6521815372488,45.71146214081375,0], [-120.6707880597479,45.71353598909323,0],
251
+ [-120.7134060564081,45.71039504404683,0], [-120.7800531580696,45.70200989316843,0], [-120.8547721972673,45.69184029712672,0],
252
+ [-120.9028597621382,45.68133867217189,0], [-120.9375299503119,45.67986078269332,0], [-120.9727298348738,45.67845766236451,0],
253
+ [-121.0377132393235,45.68290676515316,0], [-121.0648280635005,45.68321879126151,0], [-121.1218995570257,45.67097670460677,0],
254
+ [-121.1626852437876,45.66220698183155,0], [-121.2034882373642,45.65341634874653,0], [-121.2415356795541,45.65747009220581,0],
255
+ [-121.2823200737267,45.66706634807401,0], [-121.2986134353893,45.68195928259586,0], [-121.3578943116689,45.6802578641668,0],
256
+ [-121.4233949242211,45.67162926335638,0], [-121.4889015071866,45.66295976226748,0], [-121.546551872778,45.65602979918501,0],
257
+ [-121.6041602860131,45.64902438258104,0], [-121.6381388436292,45.64731125385006,0], [-121.6905155012062,45.64755563750132,0],
258
+ [-121.7533308597101,45.65142628296195,0], [-121.7716585796782,45.65331184447609,0], [-121.8449963931841,45.66082693512131,0],
259
+ [-121.8921885274479,45.66825849135478,0], [-121.9392189689725,45.65730186226464,0], [-121.9627275817219,45.65181631200772,0],
260
+ [-122.0175644006471,45.6389973418288,0], [-122.0802065951407,45.62431458686266,0], [-122.1009950475397,45.61329117611588,0],
261
+ [-122.171408629602,45.59671933924368,0], [-122.2261473901623,45.58379957286657,0], [-122.2730474001769,45.57270477551437,0],
262
+ [-122.3172095136476,45.55608897923035,0], [-122.3564493760745,45.5469063563981,0], [-122.390551777644,45.52686211582594,0],
263
+ [-122.4222675717858,45.51964456385387,0], [-122.4857226676357,45.50517281703313,0], [-122.5230484179856,45.5089608749246,0],
264
+ [-122.5681339459179,45.51082979610937,0], [-122.6079738253994,45.51996961684905,0], [-122.6426949487332,45.53644162775804,0],
265
+ [-122.674693498207,45.5474112205939,0], [-122.7118673141142,45.55102912532022,0]]
266
+ end
@@ -0,0 +1,56 @@
1
+ require 'minitest/autorun'
2
+ require_relative '../lib/kmlbo/pointlist.rb'
3
+ require_relative 'data.rb'
4
+ class PointlistTest < MiniTest::Unit::TestCase
5
+ describe "simplify module" do
6
+ it "must do nothing when asked to simplify a one point path" do
7
+ pointlist = PointList.new([[-122.674693498207,45.5474112205939,0]])
8
+ pointlist.simplify.must_equal pointlist
9
+ end
10
+
11
+ it "must do nothing to simplify a two point path" do
12
+ pointlist = PointList.new([[-122.674693498207,45.5474112205939,0], [-122.7118673141142,45.55102912532022,0]])
13
+ pointlist.simplify.must_equal pointlist
14
+ end
15
+
16
+ it "must simplify a three point path" do
17
+ expected_pointlist = PointList.new([[-122.56,45.51,0], [-122.64,45.53,0]])
18
+ pointlist = PointList.new([[-122.56,45.51,0], [-122.60,45.51,0], [-122.64,45.53,0]])
19
+ pointlist.simplify.must_equal expected_pointlist
20
+ end
21
+
22
+ it "will not simplify a three point path when epsilon is larger than distance to outlier" do
23
+ expected_pointlist = PointList.new([[1,1,0], [2,2,0], [3,1,0]])
24
+ distance_to_outlier = Math.sqrt(2)
25
+ epsilon = distance_to_outlier + 0.0001
26
+ pointlist = PointList.new([[1,1,0], [2,2,0], [3,1,0]], epsilon, 1)
27
+ pointlist.simplify.must_equal expected_pointlist
28
+ end
29
+
30
+ it "will simplify a three point path when epsilon is exactly the distance to outlier" do
31
+ expected_pointlist = PointList.new([[1,1,0], [3,1,0]])
32
+ distance_to_outlier = Math.sqrt(2)
33
+ pointlist = PointList.new([[1,1,0], [2,2,0], [3,1,0]], distance_to_outlier, 1)
34
+ pointlist.simplify.must_equal expected_pointlist
35
+ end
36
+
37
+ it "must leave the start, end and furthest outlier on a five point path" do
38
+ expected_pointlist = PointList.new([[0,0,0], [2,2,0], [4,0,0]])
39
+ pointlist = PointList.new([[0,0,0], [1,1,0], [2,2,0], [3,1,0], [4,0,0]])
40
+ pointlist.simplify.must_equal expected_pointlist
41
+ end
42
+
43
+ it "2 passes of d-p will simplify 5 point path to 2 points" do
44
+ expected_pointlist = PointList.new([[0,0,0], [4,0,0]])
45
+ pointlist = PointList.new([[0,0,0], [1,1,0], [2,2,0], [3,1,0], [4,0,0]], nil, 2)
46
+ pointlist.simplify.must_equal expected_pointlist
47
+ end
48
+
49
+ it "must behave in a reasonable manner on a real dataset" do
50
+ pointlist = PointList.new(Data::PATH)
51
+ simplified = pointlist.simplify
52
+ assert(simplified.tuple_array.length > 0)
53
+ assert(simplified.tuple_array.length < Data::PATH.length)
54
+ end
55
+ end
56
+ end