@@ -159,8 +159,12 @@ private void fillIDs(long keyPart, IntConsumer consumer) {
159
159
}
160
160
161
161
public void query (BBox queryShape , final LocationIndex .Visitor function ) {
162
+ query (LocationIndex .createBBoxTileFilter (queryShape ), function );
163
+ }
164
+
165
+ public void query (LocationIndex .TileFilter tileFilter , final LocationIndex .Visitor function ) {
162
166
final IntHashSet set = new IntHashSet ();
163
- query (START_POINTER , queryShape ,
167
+ query (START_POINTER , tileFilter ,
164
168
bounds .minLat , bounds .minLon , bounds .maxLat - bounds .minLat , bounds .maxLon - bounds .minLon ,
165
169
new LocationIndex .Visitor () {
166
170
@ Override
@@ -181,7 +185,7 @@ public void onEdge(int edgeId) {
181
185
}, 0 );
182
186
}
183
187
184
- private void query (int intPointer , BBox queryBBox ,
188
+ private void query (int intPointer , LocationIndex . TileFilter tileFilter ,
185
189
double minLat , double minLon ,
186
190
double deltaLatPerDepth , double deltaLonPerDepth ,
187
191
LocationIndex .Visitor function , int depth ) {
@@ -213,14 +217,14 @@ private void query(int intPointer, BBox queryBBox,
213
217
double tmpMinLon = minLon + deltaLonPerDepth * pixelXY [0 ];
214
218
double tmpMinLat = minLat + deltaLatPerDepth * pixelXY [1 ];
215
219
216
- BBox bbox = (queryBBox != null || function .isTileInfo ()) ? new BBox (tmpMinLon , tmpMinLon + deltaLonPerDepth , tmpMinLat , tmpMinLat + deltaLatPerDepth ) : null ;
220
+ BBox bbox = (tileFilter != null || function .isTileInfo ()) ? new BBox (tmpMinLon , tmpMinLon + deltaLonPerDepth , tmpMinLat , tmpMinLat + deltaLatPerDepth ) : null ;
217
221
if (function .isTileInfo ())
218
222
function .onTile (bbox , depth );
219
- if (queryBBox == null || queryBBox . contains (bbox )) {
223
+ if (tileFilter == null || tileFilter . acceptAll (bbox )) {
220
224
// fill without a restriction!
221
225
query (nextIntPointer , null , tmpMinLat , tmpMinLon , deltaLatPerDepth , deltaLonPerDepth , function , depth + 1 );
222
- } else if (queryBBox . intersects (bbox )) {
223
- query (nextIntPointer , queryBBox , tmpMinLat , tmpMinLon , deltaLatPerDepth , deltaLonPerDepth , function , depth + 1 );
226
+ } else if (tileFilter . acceptPartially (bbox )) {
227
+ query (nextIntPointer , tileFilter , tmpMinLat , tmpMinLon , deltaLatPerDepth , deltaLonPerDepth , function , depth + 1 );
224
228
}
225
229
}
226
230
}
0 commit comments