publiclab / mapknitter-exporter

The GDAL/ImageMagick-based exporter system from MapKnitter
GNU General Public License v3.0
5 stars 4 forks source link

Ensure compatiblity with /lib/exporter.rb in MapKnitter #5

Open jywarren opened 5 years ago

jywarren commented 5 years ago

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:

https://github.com/publiclab/mapknitter-exporter/compare/e140646c4ab7e38e01fd7a2269e0b8e79dc03e63...bf375b6f2cb09070503f523d24ba803936144875#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.

jywarren commented 5 years ago

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

https://github.com/publiclab/mapknitter-exporter/blob/bf375b6f2cb09070503f523d24ba803936144875/test/exporter_test.rb#L2

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

jywarren commented 5 years ago

Also we need to pass in this nice MockExport object:

https://github.com/publiclab/mapknitter-exporter/blob/bf375b6f2cb09070503f523d24ba803936144875/test/exporter_test.rb#L125-L133

jywarren commented 5 years ago

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

jywarren commented 5 years ago

Following https://github.com/publiclab/mapknitter/issues/364#issuecomment-473447776

jywarren commented 5 years ago

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

jywarren commented 5 years ago

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

jywarren commented 5 years ago

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

jywarren commented 5 years ago

er, https://github.com/publiclab/mapknitter/pull/530