by tidwall on 9/22/23, 11:27 PM with 32 comments
by s2mcallis on 9/23/23, 4:04 PM
The indexing structure you've come up with seems very interesting. In spherical coordinates line sweep algorithms like that are a little less intuitive because there's not really a min and max y value to work with. Does your index support multiple polygons indexed together?
The lack of exact predicates worries me a little bit. It's tricky because it will work right until it doesn't for mysterious reasons, and it's very hard to test for if you haven't built it on a foundation of exact predicates. You'll periodically fall into the fractal foam around edges when testing if you cross them or not ([2] has some good pictures). We do this in S2 by relying on a set of predicates [3] that fall all the way back to symbolic perturbation if they have to. We simply don't have to think about colinear points in S2 for that reason.
[1] https://s2geometry.io/ [2] https://github.com/mourner/robust-predicates [3] https://github.com/google/s2geometry/blob/master/src/s2/s2pr...
by hgs3 on 9/23/23, 1:39 AM
[1] https://github.com/tidwall/tg/blob/main/docs/POLYGON_INDEXIN...
by ginko on 9/23/23, 10:37 AM
Then instead of
struct tg_geom *geom = tg_geom_new_point(-112, 33);
if (!geom) {
// System is out of memory.
}
you could do struct tg_geom geom;
tg_geom_init_point(&geom, -112, 33);
without need for error checking or cleanup. You can still allocate on the heap if you want but you wouldn't have to.by pasabagi on 9/23/23, 9:16 AM
by simonw on 9/23/23, 4:12 AM
by simonw on 9/23/23, 4:25 AM
This could make for a really neat SQLite extension, as a much lighter alternative to SpatiaLite.
by unnah on 9/23/23, 4:38 AM
by MoSarwatSpatial on 9/23/23, 1:10 PM
Although Sedona runs as a distributed system, but TG may speed local in-memory geometrical computation for each worker node. Let me know your thoughts!
by Waterluvian on 9/23/23, 2:34 AM
Does it assume a flat Cartesian world or does it handle ellipsoids or even map projections? (Or does it avoid the complexity altogether by not doing any work that cares about distances?)
by aquarin on 9/23/23, 6:28 AM
> return !((x < y) | (x > y));
Is it supposed to avoid x == y. If yes, why?
by sylware on 9/23/23, 9:26 AM