double ymin = (double) Math.min(ll1.lat, ll2.lat);
double ymax = (double) Math.max(ll1.lat, ll2.lat);
try {
ESRIRecord records1[] = spatialIndex.locateRecords(ll1.lon,
ymin,
180.0d,
ymax);
ESRIRecord records2[] = spatialIndex.locateRecords(-180.0d,
ymin,
ll2.lon,
ymax);
int nRecords1 = records1.length;
int nRecords2 = records2.length;
list = new Vector(nRecords1 + nRecords2);
for (int i = 0; i < nRecords1; i++) {
((ESRISpecialistRecord) records1[i]).writeGraphics(list,
lineColor,
fillColor);
}
for (int i = 0; i < nRecords2; i++) {
((ESRISpecialistRecord) records2[i]).writeGraphics(list,
lineColor,
fillColor);
}
} catch (java.io.IOException ex) {
ex.printStackTrace();
} catch (com.bbn.openmap.io.FormatException fe) {
fe.printStackTrace();
}
} else {
double xmin = (double) Math.min(ll1.lon, ll2.lon);
double xmax = (double) Math.max(ll1.lon, ll2.lon);
double ymin = (double) Math.min(ll1.lat, ll2.lat);
double ymax = (double) Math.max(ll1.lat, ll2.lat);
try {
ESRIRecord records[] = spatialIndex.locateRecords(xmin,
ymin,
xmax,
ymax);
int nRecords = records.length;
list = new Vector(nRecords);