Q:

How to identify a variable-sized zone by a point given by coordinate?

A map is partitioned into zones of variable sizes using longitude and latitude.
For simplicity, let us consider the map as the Cartesian plane and longitude and latitude as x,y-coordinate.
A zone is always a rectangle. For example, a zone can be represented like x∈(0,3],y∈(30,50]
The range in the Cartesian plane is finite but very large.
Then, when given an x,y-coordinate, how can we identify the zone that coordinate belongs to?
For example, when we have an x,y-coordinate (2, 36), how do we effectively find that this belongs to the zone x∈(0,3],y∈(30,50]?

A:

As noted in my comment, you could solve this problem using an R-tree. The linked wiki article gives a way better explanation than I can presume to give, but the basic concept is really simple:
Given a set of regions R0 (rectangles in your example), you construct a set R1 of fewer regions, by grouping the original regions and computing their bounding rectangles.
As an example, consider the following set of regions (I want to keep the notation simple, that's why I only consider squares on the diagonal: by (p, s) I mean a square whose lower left corner is at (p, p) and whose sides have length s):
R0 = {(0, 1), (1, 1), (3, 1), (4, 1)}

We can now group the first two and the last two regions and compute their bounding rectangles to get to R1:
R1 = {(0, 2), (3, 2)}

The trick is now that, given a query point (1.5, 1.5) we don't have to check all regions in R0. We first perform the query on R1, and find that the point lies within the region (0, 2). We thus only have to search on in the children of that bounding rectangle, which are the first two regions in R0.

Of course, this was a very simple example. In practise, you want to have only few (some low constant number, like, 4) regions of R0 in each bounding rectangle in R1. So when you have many input regions, there will still be many rectangles in R1. Fortunately, we can just apply the same trick again, and create a smaller set of bounding rectangles R2 out of R1. And so on, until you reach a set Rn, which only contains a few rectangles.
You have thus created a whole tree: the entire region is the root. Each rectangle in Rn is a top-level child, and so on.
Querying just works as I described for the simple example: you only need to recurse on rectangles that contain the query point, by which you would ideally exclude many other rectangles.

So why did I say ideally? Let's go back to the example and assume I grouped the first and the last rectangle, and the middle two. That would give me a different set of bounding rectangles:
R1 = {(0, 5), (1, 3)}

These rectangles are overlapping, so the same query point as above would be in both rectangles. That is, we would still need to inspect all regions of R0.
It is thus very important to divide your rectangles properly. The problem of finding an optimal division is NP-hard, so you'll have to use heuristics. A simple one would be to sort your rectangles by their left x-coordinate and divide them accordingly. In the next level you would do the same by y-coordinate. That method works pretty well when all rectangles are evenly spread and close to square.

