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

Why zxy values extracted as int64_t and then casted to uint32_t ? #87

Closed
artemp opened this issue May 30, 2018 · 2 comments
Closed

Why zxy values extracted as int64_t and then casted to uint32_t ? #87

artemp opened this issue May 30, 2018 · 2 comments

Comments

@artemp
Copy link
Contributor

artemp commented May 30, 2018

vtquery/src/vtquery.cpp

Lines 505 to 514 in 80d6515

std::int64_t y = y_val->IntegerValue();
if (y < 0) {
return utils::CallbackError("'y' value must not be less than zero", callback);
}
// in-place construction
std::unique_ptr<TileObject> tile{new TileObject{static_cast<std::uint32_t>(z),
static_cast<std::uint32_t>(x),
static_cast<std::uint32_t>(y),
buffer}};

Looks untidy ^. Why not using int32Value() and store z,x,y as signed int ?
/cc @mapsam

@artemp artemp changed the title Why zxy values extracted as int64_t and then casted to int32_t ? Why zxy values extracted as int64_t and then casted to uint32_t ? May 30, 2018
@mapsam
Copy link
Member

mapsam commented Jun 6, 2018

Good question @artemp - I don't recall why we used int64 originally. I'll work on a PR to update and avoid needing to cast the values.

@springmeyer
Copy link
Contributor

I think this was partially addressed in #88, but there is more to discuss in a final review - let's do that at #98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants