Skip to content Skip to sidebar Skip to footer

How Do I Search For Restaurants In A Region In A Country?

I have restaurants for which I have the following information in postgis: Last name longitude latitude address. The address is divided into several tables with the foreign key not

Solution 1:

You are building the point and the polygon - instead of having proper geometry column - which is inefficient.

You haven't talked about spatial index, so the intersect operation will be slow.

You haven't specified the complexity of the polygons: if they have many many vertices, an intersect operation will be slow. This can be improved by subdividing them first.

So technically speaking, using indexed and eventually subdivided polygons make such operation blazing fast.

BUT, addresses are typically not perfect. Some may be incomplete, other may be just wrong (ex: someone entered the neighboring town name). Selecting by geometry will give different results than selecting by attribute, so you may want to analyze your data quality before deciding, and to carefully compare the result discrepancies between both methods.

Post a Comment for "How Do I Search For Restaurants In A Region In A Country?"