Lots and lots of low-level geospatial indexing questions
Implement a static spatial index for latitude-longitude points using quantization, Morton/Z-order codes, recursive cell decomposition, and binary search over sorted code ranges. Return matching point IDs in their original input order after exact coordinate filtering.
Function signature: def range_query(points, south, west, north, east, bits):. points is a list of [id, latitude, longitude]; return IDs inside the inclusive rectangle. Coordinates satisfy -90 <= latitude <= 90 and -180 <= longitude <= 180, with south <= north and west <= east.
def range_query(points, south, west, north, east, bits):