1. A method of at least one processor, comprising: receiving a query including signal values providing measures of signals between a first wireless device and corresponding access points; ranking the access points for the query based on sorting the signal values; computing, using the ranking, similarity values between the query and respective fingerprints of signal values collected at a plurality of locations in an area, each signal value of the signal values in the fingerprints providing a measure of a signal between at least one wireless device at a location of the plurality of locations and a respective access point of the access points; and determining a location of the first wireless device based on the computed similarity values.