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

Use d3.geoBounds() instead of turf.extent()? #35

Open
jtrim-ons opened this issue Jan 13, 2022 · 2 comments
Open

Use d3.geoBounds() instead of turf.extent()? #35

jtrim-ons opened this issue Jan 13, 2022 · 2 comments

Comments

@jtrim-ons
Copy link
Contributor

turf.extent(areas)
// [-8.607227544131755,49.91001820137803,1.7629159475701766,60.84535348677859]
d3.geoBounds(areas)
// [[-8.607227544131755,49.91001820137803],[1.7629159475701766,60.84535348677859]]

It looks like we could avoid the 546 kB Turf JavaScript file by using d3.geoBounds.

@jtrim-ons
Copy link
Contributor Author

Hmmmm... I think the Turf function might run a lot faster than the D3 function. The D3 one does lots of fancy maths: https://www.jasondavies.com/maps/bounds/

@jtrim-ons
Copy link
Contributor Author

Possibly faster than D3: https://stackoverflow.com/a/35692917

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

1 participant