Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error handling for null tiles. #3

Open
reyemtm opened this issue May 22, 2019 · 8 comments
Open

No error handling for null tiles. #3

reyemtm opened this issue May 22, 2019 · 8 comments

Comments

@reyemtm
Copy link
Contributor

reyemtm commented May 22, 2019

Is this still in development? I am looking at using Koop to add layers into AGOL using the feature server output from static geojson files. This seems like the simplest method for accomplishing this outside of loading the data into AGOL. If so I will add more issues. If not disregard.

If geojsonVT(data).getTile(z, x, y) is null then the plugin crashes as it calls vtpbf using a null tile. A simple fix would be something like the following:

  if (!tile) {
    res.writeHead(204, { 'Access-Control-Allow-Origin': '*' })
    return res.end()
  }
@rgwozdz
Copy link
Member

rgwozdz commented May 22, 2019

hi @reyemtm - we would definitely like to keep moving forward on this plugin; just looking for contributors. You should submit your fix as PR and I will happily review.

BTW, Koop sets CORS wide-open internally, so I am not sure you need the { 'Access-Control-Allow-Origin': '*' }, but I haven't looked into it.

@reyemtm
Copy link
Contributor Author

reyemtm commented May 22, 2019 via email

@rgwozdz
Copy link
Member

rgwozdz commented May 22, 2019

What provider are you using?

@reyemtm
Copy link
Contributor Author

reyemtm commented May 22, 2019 via email

@rgwozdz
Copy link
Member

rgwozdz commented May 22, 2019

Yes, that provider has data cached for 10 seconds (geojson.ttl = 10). After 10 seconds, it will fire getData again and re-read the file.

@reyemtm
Copy link
Contributor Author

reyemtm commented May 23, 2019 via email

@reyemtm
Copy link
Contributor Author

reyemtm commented May 23, 2019 via email

@rgwozdz
Copy link
Member

rgwozdz commented May 23, 2019

There's no particular reason the ttl is to 10 seconds. I use this provider mainly for debugging and testing koop-core, FeatureServer, and Winnow, so I haven't really scrutinize performance details.

Ideally, the ttl should be set by a provider-namespaced config value, so that it's not hardcoded in the getData function. Feel free to submit a PR on that repo, or maybe I can squeeze in the change sometime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants