Modifier and Type | Field and Description |
---|---|
private org.mapdb.DB |
db |
(package private) byte[] |
empty |
private org.mapdb.HTreeMap<java.lang.String,byte[]> |
index |
private com.vividsolutions.jts.io.WKBReader |
reader |
(package private) static java.lang.ThreadLocal<com.vividsolutions.jts.io.WKBReader> |
wkbReader
Thread-safe WKB reader
|
(package private) static java.lang.ThreadLocal<com.vividsolutions.jts.io.WKBWriter> |
wkbWriter
Thread-safe WKB writer
|
private com.vividsolutions.jts.io.WKBWriter |
writer |
Constructor and Description |
---|
OSMDiskIndex(java.lang.String tmpDir,
java.lang.String dbName)
Constructor of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Erases all contents of the index and closes the respective file on disk.
|
boolean |
containsKey(java.lang.String k)
Checks whether the index contains an entry with the given key value.
|
com.vividsolutions.jts.geom.Geometry |
get(java.lang.String k)
Provides the geometry indexed under the given (unique) key value.
|
void |
print()
Print the contents of the index to standard output.
|
void |
put(java.lang.String k,
com.vividsolutions.jts.geom.Geometry g)
Inserts (or updates) an entry into the index with the given key value and geometry.
|
void |
putAll(java.util.Map<java.lang.String,com.vividsolutions.jts.geom.Geometry> m)
Inserts a collection of geometries into the index.
|
int |
size()
Provides the count of entries in the index.
|
static java.lang.ThreadLocal<com.vividsolutions.jts.io.WKBReader> wkbReader
static java.lang.ThreadLocal<com.vividsolutions.jts.io.WKBWriter> wkbWriter
private org.mapdb.DB db
private org.mapdb.HTreeMap<java.lang.String,byte[]> index
private com.vividsolutions.jts.io.WKBReader reader
private com.vividsolutions.jts.io.WKBWriter writer
byte[] empty
public OSMDiskIndex(java.lang.String tmpDir, java.lang.String dbName)
tmpDir
- Directory that will hold the disk-based indices to be created; once transformation is complete, these files will be erased.dbName
- Name of the file that will hold the created index.public void put(java.lang.String k, com.vividsolutions.jts.geom.Geometry g)
public com.vividsolutions.jts.geom.Geometry get(java.lang.String k)
public void clear()
public int size()
public boolean containsKey(java.lang.String k)
containsKey
in interface OSMIndex
k
- A key value to check with the index contents.public void putAll(java.util.Map<java.lang.String,com.vividsolutions.jts.geom.Geometry> m)