Conversation
leplatrem
left a comment
There was a problem hiding this comment.
Thanks for the addition! It looks like a relevant format for Leaflet.FileLayer!
We need to add a few tests here to make sure it's working, and allow future contributors to have confidence when making changes there :)
You'll find examples in the code base, don't hesitate to ask for help...
src/leaflet.filelayer.js
Outdated
| } | ||
| }; | ||
| lines.splice(0, 1); | ||
| lines.splice(lines.length-1, 1); |
There was a problem hiding this comment.
What do those two lines? Please add a comment :)
src/leaflet.filelayer.js
Outdated
| current = []; | ||
| begin = true; | ||
| } | ||
| }); |
There was a problem hiding this comment.
I would suggest that you create a dedicated function poly2geojson() with some unit tests :)
There was a problem hiding this comment.
Well, it seems to be for me the most complex part... Do I really need to install nodejs and all thoses things called chai mocha simon happen ? I tryed npm, but I get various sorts of errors I don't understand : like "Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})"... I'm surprised that Debian Linux 9.6 on x64 is not supported by mocha... and I don't have time to search why all those tangled things don't work. Maybe you have a simple procedure?
There was a problem hiding this comment.
Also I'm using a virtualized file system and it doesn't seem compatible with npm. It says:
npm ERR! rofs EROFS: read-only file system, symlink '../acorn/bin/acorn' -> '/media/sf_www/kikiminou/Leaflet.FileLayer/node_modules/.bin/acorn'
npm ERR! rofs Often virtualized file systems, or other file systems
npm ERR! rofs that don't support symlinks, give this error.
There was a problem hiding this comment.
Maybe I can simply create the entry poly2geojson in test.filelayer.js and let someone else test it ?
There was a problem hiding this comment.
I don't have time to search why all those tangled things don't work
I know exactly what you mean. And me neither :)
Maybe you have a simple procedure?
Using nvm is usually helpful to get a recent version of npm working.
Maybe I can simply create the entry poly2geojson in test.filelayer.js and let someone else test it ?
You could write the test and let the Continous Integration run it for you when you push to your branch :) Look, that's the output of your last commit https://travis-ci.org/makinacorpus/Leaflet.FileLayer/builds/496427902
Merging without tests is possible too, if folks from @makinacorpus approve it :)
Hello,
I have added basic support for .poly files.
POLY files are supported by Osmosis, mapsplit, osmconvert, osmchange and pbftoosm as a way of defining extraction polygons. See https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format
I found useful to view this type of file into Leaflet thanks to Leaflet.FileLayer.
EDIT: jquery is required.