publiclab / mapknitter-exporter

The GDAL/ImageMagick-based exporter system from MapKnitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ensure compatiblity with /lib/exporter.rb in MapKnitter

jywarren opened this issue · comments

There've been minimal changes to the library itself, but 2 to watch out for are:

  1. changes of object.lat to object[:lat] everywhere, similar for [:nodes_array]
  2. change of image.url to string image_url in run_export

Here's a diff of the file from the original copy in from MapKnitter:

e140646...bf375b6#diff-174ec2997e5f3c6e51179e598ab47217R314

We should be able to get MapKnitter to install this gem and still pass it's test at /tests/unit/exporter_test.rb if we respect these changes.

This should use usable as in the tests, after including the gem, and then:

require "./lib/mapknitterExporter"

Although I think it'll be require 'mapknitterExporter' -- probably!

Also we need to pass in this nice MockExport object:

class MockExport
attr_accessor :status, :tms, :geotiff, :zip, :jpg
def save
puts "saved"
end
end

MockExport is what will write the status.json files, whenever we save!

And we'll have to refactor from the simplified version here: #6 !!

After refactoring "root" we should be ok to do this.

OK, #530 brings mapknitter up to date with the latest of this gem!