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

Should we enforce a single "z"? #12

Closed
mapsam opened this issue Oct 13, 2017 · 3 comments
Closed

Should we enforce a single "z"? #12

mapsam opened this issue Oct 13, 2017 · 3 comments

Comments

@mapsam
Copy link
Contributor

mapsam commented Oct 13, 2017

Once we go into the worker, we have the following information:

  • lng/lat
  • buffers with z/x/y

If we are looping through each buffer, we'll have to calculate the tile coordinates of the query lng/lat based on each buffer's z level. If we made the assumption that every buffer was at the same zoom level (defined outside of the tiles array) we could calculate the query tile coordinates once and essentially update their origin point according to each buffer's x/y values in the loop.

So the API would change to:

const tiles = [ { buffer: new Buffer(), x: 1, y: 2} ];
vtquery(tiles, lnglat, zoom, options, callback);

cc @springmeyer

@springmeyer
Copy link
Contributor

👍 I think that all the tiles passed to vtquery should be at the same zoom level. We could either accept a z arg (like currently) and throw if any don't match, or accept the z as an arg like you've done.

As context, I think the logic to figure out which tiles to pass should live outside vtquery's async c++ function. That logic could potentially work like:

@mapsam
Copy link
Contributor Author

mapsam commented Oct 13, 2017

Okay great! I agree @springmeyer that separating "which" buffers you query should be something implemented downstream. I like the idea of keeping z/x/y in the tiles array still and just verifying they are all equal.

@mapsam mapsam mentioned this issue Oct 19, 2017
7 tasks
@mapsam
Copy link
Contributor Author

mapsam commented Oct 23, 2017

We are enforcing a single z level in the library now 👍 thanks @springmeyer!

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