-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add a remote geojson datasource #39
Comments
Are you planning to cache the results, or have it fetched dynamically on every map rendering call? If caching, you could probably just replace this section of code with your http request: https://github.com/codeforamerica/nodetiles-core/blob/master/datasources/GeoJson.js#L64-L77 |
I think we'd ideally use HTTP caching headers to avoid excessive data transfer while still supporting dynamic sources. |
Here's what I did for my simple remote geojson datasource a week or two ago (basically what @bensheldon suggested). This is more a request that something similar be included in core, since it's built for a relatively common use-case. |
Made a quick comment on the gist as to how it could be slightly simpler. If we brought it into core, we could probably make some tweaks to GeoJsonSource so it's easier to extend, though I still quite like the idea of composing a transport method (HTTP) with something for interpreting and storing the data (GeoJSON). That aside, though, it sounds like there's a separate issue here: the existing data sources (and @hampelm's) are designed to load some data and then hold on to it as if the underlying storage isn't going to change. What @prashtx is talking about sounds more like he'd want to [potentially] request data from the remote source every time, effectively assuming that it is in constant flux. That's neat, but definitely invites some complicated scenarios. For example, what happens when you have a shape that overlaps two tiles, but we render the first tile before that shape exists and the second one after? |
We'd like to fetch data from a remote location as GeoJSON. Or maybe even TopoJSON?? (cc @prashtx)
(hopefully will have cleaner code for this to share soon)
The text was updated successfully, but these errors were encountered: