// create one in memory.
entries = SpatialIndex.MemoryIndex.create(shpFileName);
return entries;
}
BinaryBufferedFile ssx = new BinaryBufferedFile(ssxFileName);
ssx.byteOrder(false);
ssx.seek(100); // skip the file header
LatLonPoint llp = null;
if (dataTransform != null) {
llp = new LatLonPoint();
}
while (true) {
int result = ssx.read(ixRecord, 0, SPATIAL_INDEX_RECORD_LENGTH);
if (result <= 0) {
break;// EOF
} else {
double xmin = readLEDouble(ixRecord, 8);
double ymin = readLEDouble(ixRecord, 16);
double xmax = readLEDouble(ixRecord, 24);
double ymax = readLEDouble(ixRecord, 32);
int byteOffset = readBEInt(ixRecord, 0) * 2;
if (dataTransform != null) {
dataTransform.inverse(xmin, ymin, llp);
xmin = llp.getLongitude();
ymin = llp.getLatitude();
dataTransform.inverse(xmax, ymax, llp);
xmax = llp.getLongitude();
ymax = llp.getLatitude();
}
if (Debug.debugging("spatialindexdetail")) {
Debug.output(" " + xmin + ", " + ymin + "\n " + xmax
+ ", " + ymax);
}
Entry entry = new Entry(xmin, ymin, xmax, ymax, byteOffset);
entries.add(entry);
if (bounds != null) {
bounds.addPoint(xmin, ymin);
bounds.addPoint(xmax, ymax);
}
}
}
ssx.close();
return entries;
}