I need to implement the following:
1) I have a database of ~100 mil records.
Each record is of type key/value.
The key is an internal ID of type: "123456789".
The value is a kml with geographic boundary in form of lat/lon coordinates:
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Placemark>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-117.587174583104,33.6437620515745
-117.587083176312,33.6437891755388
-117.587016626677,33.6438098355405
-117.586923617992,33.6435949397585
-117.587051757569,33.643539681552
-117.587079610599,33.6435348310862
-117.587174583104,33.6437620515745
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</kml>
2) Input values are of type lat/lon like -117.11111,33.2222
The usage is having an input lat/lon to find the boundary in which it is located and return the key (the internal ID).
The closest solution I found is using Google S2 geometry library:
and this library:
https://github.com/akhenakh/regionagogo
This implementation is using an in memory index with
Segment Tree datastructure:and BoltDB.
I need to create persistent key/value database on the disk (it would be big like ~100GB) using
RocksDB key/value store with key
Segment Tree datastructure.
It should get CellID from lat/lon and find the S2 interval where it resides.
How is the best way to implement it?