-
Notifications
You must be signed in to change notification settings - Fork 48
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 command line utils: mvt_decode and mvt_encode #99
base: master
Are you sure you want to change the base?
Conversation
Sure, if you'd like to add that we'd accept a pr for it. I'd suggest making a single module to house both commands, maybe call it command.py? Then, just add entry points to it from setup.py, something like:
I'd expect the decoder to take either stdin or the path of the file to read as an argument. The other variable here is whether the input is gzipped or not. Maybe try to gunzip and default to assuming pbf binary if it's not gzip? What would the encode command take as input? Would it assume a geojson file just to be symmetric with decode? Where keys are layer names, and values are individual geojson for that key? |
The commands are just used for debugging purpose, so I'd keep them simple. Here is my proposal: The decoder will accept mvt binary stream from stdin and print out what the function The encoder will take geojson stream from stdin, a layer name, and a tile coordinate, and print out the mvt binary.
The geometries in the geojson could be in any coordinate system. By default it's WGS84. Maybe we can add an option
|
All sounds fine to me. And given that it's intended to be more of a debugging tool, I can see it being reasonable to skip having the encoder have the flexibility to accept input in multiple formats. But if you're keen on adding that, great! :) |
This is done. Two slight changes:
|
This PR adds two executables
mvt_encode
andmvt_decode
.Still WIP. Would nice to have your options on adding these utils.