-
Notifications
You must be signed in to change notification settings - Fork 105
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
Refactor into two packages #40
Comments
This sounds like a good idea, and Before we begin, it would be good to have an understanding of how we want to split Splitting out However, I'm unclear on how you would want what is now in At a high level, we have:
|
Thank your being open to this, @brendan-ward, that means a lot! 👍 I agree that the type Another idea would be some convenience methods that wrap // WriteTileTo reads a tile with coordinates z, x, and y from tileset and writes it to w.
// The first error encountered is returned. If no error occurs, the returned error will be nil.
func (tileset * Mbtiles) WriteTileTo(w io.Writer, z uint8, x uint64, y uint64) In the same vein I'd remove the calls As for I'd refactor the HTTP operations into an own package that only uses I have no good idea for the caching, yet. Maybe it can be implemented as a middleware as well? The caching part of What do you think? |
I started to work on this here: Would you prefer me to submit atomic PRs after each step or just one PR in the end? Personally, I'd prefer the first, but it's your call. |
Thanks for starting on this @fawick ! I'd like atomic PRs; that will help us refine as we go. Don't feel like you have to do it all - I'm happy to jump in and do this too. I wonder if we shouldn't upframe this a little bit. Let me know your thoughts on this:
This seems like it would give us better separation of concerns between a repo intended to be an I/O library for mbtiles, a library for formatting HTTP responses for tile / ArcGIS endpoints, and an executable that runs a server. |
Re: caching. Our use of I like the idea of a handling this in the application rather than the library (cache the response data rather than the tile data), perhaps as middleware. |
Great, it looks like we have pretty much the same understanding on how to proceed. Only one comment: For the moment I'd rather keep development in this repo until things are fleshed out. That would mean to keep the I already have a commit that refactors |
Thanks for your reviews on the PRs #41 and #42. I've included the requested changes. Further on, I am currenty adding a type I understand that the GZIP compression is currently done with |
Okay, scratch that question, I read the code more closely and saw that the GZIP middleware is not applied to the GET of the tile itself. |
@brendan-ward Thank you very much for your reviews and your many great suggestions to make the code better. I do not have access to an ArcGIS installation (and I have never worked with ArcGIS), so I am unsure how to do an manual integration test for these endpoints. Can you recommend some tool for that? Would they work with, say, QuantumGIS? Finally, I have some additional exported methods for Another thing probably would be to start (re)implementing a caching middleware in the |
@fawick Thank YOU for doing all the work to make this better!! The arcgis endpoints can go into The arcgis endpoints cold also go into a dedicated package under handlers For testing them, I always just hit the endpoints directly (manually) to make sure they respond as expected. There is no need to try and consume them from another application. This is where I really need to learn how to write tests in Go that exercise HTTP endpoints, just haven't had the time. Do you want me to run with updating those? They seem orthogonal to your needs for integration with I think next up should be your conditional installation of endpoints. Is the caching middleware of the tiles something that would be at all useful for If we are open to swapping out one 3rd party dependency for another, these look promising but would need investigation: |
I'd be grateful and glad if you like to take a shot at the ArcGIS handlers, as I relly know next to nothing about ArcGIS and am only guessing the meaning and use cases of these endpoint from the current implementation. I can start on the smaller endpoint set. I will implement this as a function very similar to For the caching middleware: I am inclined to put the caching middleware into the What do you think? |
@brendan-ward Thank you very much again for being so open and for all the collaboration on this! |
This is with regard to maplibre/maputnik#184:
/cc @lukasmartinelli
I'd like to propose to refactor this repository so that it consists of main package and a non-mainpackage so that the tile server can be vendored and used in other Go projects.
I'd be happy to contribute to the necessary effort if @consbio and @brendan-ward are interested.
The text was updated successfully, but these errors were encountered: