mapknitter-exporter 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mapknitterExporter.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4aced1644928166b800a8737efbd50bd6ea6755b
|
|
4
|
+
data.tar.gz: 3b3457aced0790610353ef23903a2d2b6d0b9d59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2bb616d39a2de22a96aaf126ea1f7dac2b17eac4d1845bbcb60d559384bc3deffd66b4c3257ef40b813078e0f4f17445180f0739ad143bf67d9b0656d54559f2
|
|
7
|
+
data.tar.gz: 270d7a8d01f7de38821fcfdf0abca84da0e2ea991b393721fa361fc4b3dc7ec2894a4940775e8406421f1f903811d448a7e283ebdcc98e137f23ff591d59fbe9
|
data/lib/mapknitterExporter.rb
CHANGED
|
@@ -246,7 +246,7 @@ class MapKnitterExporter
|
|
|
246
246
|
end
|
|
247
247
|
|
|
248
248
|
# generate a tiff from all warpable images in this set
|
|
249
|
-
def self.generate_composite_tiff(coords, origin,
|
|
249
|
+
def self.generate_composite_tiff(coords, origin, warpables, id, ordered)
|
|
250
250
|
directory = "public/warps/#{id}/"
|
|
251
251
|
composite_location = directory + id.to_s + '-geo.tif'
|
|
252
252
|
geotiffs = ''
|
|
@@ -254,7 +254,7 @@ class MapKnitterExporter
|
|
|
254
254
|
minlon = nil
|
|
255
255
|
maxlat = nil
|
|
256
256
|
maxlon = nil
|
|
257
|
-
|
|
257
|
+
warpables.each do |warpable|
|
|
258
258
|
warpable['nodes'].each do |n|
|
|
259
259
|
minlat = n['lat'] if minlat == nil || n['lat'] < minlat
|
|
260
260
|
minlon = n['lon'] if minlon == nil || n['lon'] < minlon
|
|
@@ -265,7 +265,7 @@ class MapKnitterExporter
|
|
|
265
265
|
first = true
|
|
266
266
|
if ordered != true && placed_warpables.first.keys.include?('poly_area')
|
|
267
267
|
# sort by area; this would be overridden by a provided order
|
|
268
|
-
warpables =
|
|
268
|
+
warpables = warpables.sort{ |a,b| b['poly_area'] <=> a['poly_area'] }
|
|
269
269
|
end
|
|
270
270
|
warpables.each do |warpable|
|
|
271
271
|
wid = warpable['id'].to_s
|