4 ms·
I helped some hotshot developer (who is clearly better Python programmer) debug an app which serves vector tiles. He insisted he wants to use MongoDB, because "
by RicoElectrico 3y ago
I helped some hotshot developer (who is clearly better Python programmer) debug an app which serves vector tiles. He insisted he wants to use MongoDB, because "he doesn't need to learn SQL". The app worked mostly fine except for low zoom levels in which some country outlines got chopped. The issue was that MongoDB only has spherical geometry as a first-class citizen. If you make a query against a 4-vertex bounding box, then on low zoom there's a discrepancy between querying on a sphere vs querying on WGS84 or Mercator. The solution was to densify vertices of the square against which objects to be served were intersected.
- yetihehe 3y ago> The solution was to densify vertices of the square against which objects to be served were intersected. I remembered the easiest solution to query which lines with some width cross some bounding box (for putting them in quadtree). Just increase BB size by half a line width on each side and you have a very good approximation of a much harder and slower problem. A small percentage of lines will be returned and not drawn, but it's a good trade-off.