We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'd be interested in that script if you want to publish it. Thanks
The text was updated successfully, but these errors were encountered:
I actually made that in QGIS, but here's the C++ program to export a WKT TSV file of S2 cell geometries:
#include <iostream> #include <vector> #include "s2/s2region_coverer.h" #include "s2/s2latlng.h" #include "s2/s2latlng_rect.h" #include "s2/s2polyline.h" #include "s2/s2loop.h" using namespace std; void print(int i, S2Cell &cell) { S2LatLng latlng{cell.GetVertex(i)}; cout << latlng.lng() << " " << latlng.lat(); } int main(int argc, char* argv[]) { ... define points ... auto c = std::make_unique<S2Polyline>(points); S2RegionCoverer::Options options; options.set_max_cells(1024); options.set_max_level(16); S2RegionCoverer coverer{options}; for (auto const &cell_id : coverer.GetCovering(*c)) { S2Cell cell{cell_id}; cout << cell.id().level() << "\t"; cout << "POLYGON (("; for (int i = 0; i <= 3; i++) { print(i, cell); cout << ", "; } print(0,cell); cout << "))" << endl; } }
Sorry, something went wrong.
No branches or pull requests
I'd be interested in that script if you want to publish it. Thanks
The text was updated successfully, but these errors were encountered: