koopjs/koop-provider-github

error when geojson file and folder in the same repo have the same name

Opened this issue · 3 comments

If a repo has both a folder and a geojson file with the same name, Koop fails with "No geojson found".

Example repo here: https://github.com/gregoiredavid/france-geojson. gregoiredavid/france-geojson/communes works (well, partially only, due to size/many features I guess), whereas gregoiredavid/france-geojson/regions fails.

Communes: http://koop.dc.esri.com/github/gregoiredavid/france-geojson/communes/preview

Regions: http://koop.dc.esri.com/github/gregoiredavid/france-geojson/regions/preview

I can see the problem -- both regions.geojson and regions/ exist, and koop-github is most likely finding the directory first. I will look into fixing this.

I'm new to koopjs - sorry if I sound like a noob with the following question. Wouldn't it be easier to just take a URL to the raw file/gist, like those generated via RawGit, as a parameter?

This could also solve the problem of geojson files in nested folders (I cannot manage to make these work).

Regarding the nested folder issue @manueltimita , does specifying the path with :: as a path separator work for you?

E.g. http://localhost:1337/github/username/reponame/dir1::dir2::file

I ask because I was about to file an issue about paths not working before I noticed the example in the README...