-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Use v3 as a library #20
Comments
Yes, at some point I was planning on making that separation like you suggested. Does your use case need deduplication and compression or not? We may need to expose multiple writer interfaces: the simplest one would be "dumb" which assumes the data you are passing in is already compressed. |
What about splitting into two folders, one called I'd like to rename from |
A common pattern I see a lot is something like this: https://github.com/golang-standards/project-layout
So in your case, that would be something like this:
Having the same name for both the lib and the cli is not a problem (in my opinion), both are valid entry points. An alternative might be dropping the orb can gzip the mvt tileData, it exposes both a |
seems like https://github.com/alecthomas/kong or https://github.com/spf13/cobra are the preferred way to structure CLI applications, any opinion on either? #26 |
Having go-pmtiles as a library could also be useful in the future for example for a MapLibre GL Native app which allows you to download a pmtiles extract and save the map data on your mobile device. The area downloads would require something like #31... |
@wipfli, very happy to see you helping out here! We, @TheOutbound, would very much like to see this happen. |
As of 1.14 there is now a more reasonable interface to package methods outlined here: https://pkg.go.dev/github.com/protomaps/go-pmtiles@v1.14.0 closing this as a duplicate of #46 - we should still evolve the internal cmd/package structure |
I was using the writer interface of v2 combined with github.com/paulmach/orb to create my pmtiles file.
Is something similar still possible using v3?
To create a better separation of concerns, it might be a good idea to split the pmtiles folder. The pmtiles folder can hold all the library code for reading and writing pmtiles. Next to a cmd folder that can hold the cli related commands and logic for handling flags, etc.
The text was updated successfully, but these errors were encountered: