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

Generate exact single tile #92

Open
exe-dealer opened this issue Jan 11, 2018 · 2 comments
Open

Generate exact single tile #92

exe-dealer opened this issue Jan 11, 2018 · 2 comments

Comments

@exe-dealer
Copy link

exe-dealer commented Jan 11, 2018

I'm creating server endpoint wich serves vector tile from elasticsearch. I'm querying geojson features for tile from elasticsearch and want geojson-vt to generate exact tile, without its parents to be more cpu-efficient. Is it possible with geojson-vt?

@exe-dealer exe-dealer changed the title generate exact single tile Generate exact single tile Jan 11, 2018
@exe-dealer
Copy link
Author

exe-dealer commented Jan 11, 2018

const geojson = get_features_within_tile(z, x, y);
const tileIndex = geojsonvt(geojson, { /* some magic options */ });
const tile = tileIndex.getTile(z, x, y);

// this is what i want
const tiles_generated_count = Object.keys(tileIndex.tiles).length;
console.assert(tiles_generated_count == 1);

@mourner
Copy link
Member

mourner commented Jan 11, 2018

There's no way to do that currently, since geojson-vt generates tiles top-down recursively (more info) — first slicing out z0 tile, then doing 4 z1 tiles, etc.

But I think it'd make sense to add such a feature because a similar one was implemented for the C++ port mapbox/geojson-vt-cpp#65 cc @asheemmamoowala

montzkie18 added a commit to montzkie18/geojson-vt that referenced this issue May 12, 2021
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

2 participants