Domanda

I am looking for a c or c++ library for a desktop application ( no server-client, only need to edit data stored in disk) with the following features

  • stores the spatial data in the virtual memory so spatial queries are fast
  • Can optionally maintain equivalent data in disk with smart ways to update. The updates does not have to be instantaneous but they can be buffered.

. libspatialindex seems to be meeting the requirements. But there is one thing that is not clear from the web page is that, let us say, I have loaded a large amount of data from the disk and just want to update only a tiny object. Does libspatialindex reserialize the whole data and writes it into disk or is it smart to update only the portions that require change?

The sqlite with RTree seems to be achieving this. However, I want to have a simple c++ library rather than the whole of sql things.

Is there any other ulternative. Does GEOS have any smart disk image update feature?

È stato utile?

Soluzione

libspatialindex's DiskStorageManager documentation says:

The disk storage manager uses two random access files for storing information. [...] The .idx file is loaded into main memory during initialization and is written to disk only after flushing the storage manager or during object destruction. In case of an unexpected failure changes to the storage manager will be lost due to a stale .idx file. Avoiding such disasters is future work.

... which implies that the corresponding page in the data file is updated whenever an index entry changes.

This is essentially similar to an SQLite database, except that SQLite files are not corrupted after crashes. (An SQLite storage manager seems to be an obvious extension for libspatialindex.)


I would recommend considering SQLite; if you don't like its C API, use a framework that wraps it, like for example Qt.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top