private Query getVectorQueryFromShape(QueryShardContext context, Object queryShape) { Query geoQuery; if (queryShape instanceof Line[]) { geoQuery = XLatLonShape.newLineQuery(fieldName(), relation.getLuceneRelation(), (Line[]) queryShape); } else if (queryShape instanceof Polygon[]) { geoQuery = XLatLonShape.newPolygonQuery(fieldName(), relation.getLuceneRelation(), (Polygon[]) queryShape); } else if (queryShape instanceof Line) { geoQuery = XLatLonShape.newLineQuery(fieldName(), relation.getLuceneRelation(), (Line) queryShape); } else if (queryShape instanceof Polygon) { geoQuery = XLatLonShape.newPolygonQuery(fieldName(), relation.getLuceneRelation(), (Polygon) queryShape); } else if (queryShape instanceof Rectangle) { Rectangle r = (Rectangle) queryShape; geoQuery = XLatLonShape.newBoxQuery(fieldName(), relation.getLuceneRelation(), r.minLat, r.maxLat, r.minLon, r.maxLon); } else if (queryShape instanceof double[][]) { return XLatLonShape.newBoxQuery(fieldName, relation.getLuceneRelation(), pt[1], pt[1], pt[0], pt[0]); } else if (queryShape instanceof Object[]) { geoQuery = createGeometryCollectionQuery(context, (Object[]) queryShape);