Comments (4)
// Expands the cell union by adding a buffer of cells at "expand_level"
// around the union boundary.
//
// For each cell "c" in the union, we add all neighboring cells at level
// "expand_level" that are adjacent to "c". Note that there can be many
// such cells if "c" is large compared to "expand_level". If "c" is smaller
// than "expand_level", we first add the parent of "c" at "expand_level" and
// then add all the neighbors of that cell.
//
// Note that the size of the output is exponential in "expand_level". For
// example, if expand_level == 20 and the input has a cell at level 10,
// there will be on the order of 4000 adjacent cells in the output. For
// most applications the Expand(min_radius, max_level_diff) method below is
// easier to use.
void Expand(int expand_level);
// Expands the cell union such that it contains all points whose distance to
// the cell union is at most "min_radius", but do not use cells that are
// more than "max_level_diff" levels higher than the largest cell in the
// input. The second parameter controls the tradeoff between accuracy and
// output size when a large region is being expanded by a small amount
// (e.g. expanding Canada by 1km). For example, if max_level_diff == 4 the
// region will always be expanded by approximately 1/16 the width of its
// largest cell. Note that in the worst case, the number of cells in the
// output can be up to 4 * (1 + 2 ** max_level_diff) times larger than the
// number of cells in the input.
void Expand(S1Angle min_radius, int max_level_diff);
the 2nd Expand
makes more sense - expose min_radius to the user, which can be calculated cheaply by unprojecting your coords, the 2nd parameter needs some thought...
from osmexpress.
On second thought, this could result in cell unions with a max level > 16, which would break indexing...
from osmexpress.
Closing for now as this approach is difficult to reason about
from osmexpress.
Implemented this as the first variation of Expand
which lets the user specify a given cell level 0-16. This is good enough for my use and avoids the case where the expand cells are level >16.
from osmexpress.
Related Issues (20)
- Query for multiple nodes, ways, or relations at once by ID HOT 3
- Segfault running query command with no arguments HOT 2
- augmented diff example program HOT 7
- get the approximate cell covering for a relation HOT 1
- What's the preferred linux package name for OSM Express? HOT 3
- Document how to build with system libs instead of vendored libs HOT 4
- (windows) MDB_Transaction Error when trying to work with Windows Subsystem for Linux HOT 3
- Add polygon extract queries to the Python API HOT 12
- Publish 0.0.4 osmx python bindings HOT 2
- Converting full planet pbf file fail HOT 4
- Include all metadata for locations
- Script to render examples/screenshot.png HOT 1
- Possible to use this to serve tiles? HOT 3
- Cannot extract node tags HOT 8
- Continuous growths of the osmx file with nightly updates HOT 5
- Crashes during parsing of malformed OSMX files HOT 2
- Master build failing on Ubuntu 22.04.1 LTS HOT 1
- Investigate string pools HOT 5
- Transactions will fail when db exceeds 1 TB
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osmexpress.