Where is Spatial query in QGIS3?

I found the answer myself.

In Processing toolbox> Vector Selection > Select by location. There is the Spatial query.


The Count points in polygon tool should work for you, though I'd be interested to see what output you're getting.

Input polygon and points layers in the count points... tool:

count points tool

Output from above:

countoutput

If you'd rather perform this via a spatial join, which I think is what you're referring to, note that QGIS 3.0 now offers a separate Join attributes by location (summary) tool in addition to Join attributes by location. Both are found under Vector general in the processing toolbox.

By running a spatial join summary, then clicking the ... by Summaries to calculate parameter, you can specify count:

spatial join summary dialog

Output from above:

spatial join output


In QGIS 3.0, the spatial queries operation can be performed with a tool called Select by Location. The tool can be found under the Vector Selection tool in the Processing Toolbox. See spatial query tutorial how to use Select by location with some examples