# Heat Map to find 10 restaurants, 10 retail, and 10 stores open after 6pm within 3 linear blocks

I would like to find where in the City there is a combination of 10 restaurants, 10 retail, and 10 stores open after 6pm within 3 linear blocks. What is the best way to do this? What data would I need and how would I analyze this? I would assume I need hours of operation, not sure how to get this (business license data, business associations, scraped from websites)? I will need land use classification, zoning data, block parcels, …

Any ideas would be helpful. I was also thinking of do the same analysis using zoning data to compare where this combo is possible vs where it exists. I would like to use QGIS or GeoMedia.

-
I'm having trouble seeing how zoning data, land use classification, or parcel information will be much help in letting you count actual numbers of restaurants, etc. It looks like you need the locations and types of businesses known to be open after 6 pm. Together with a streets dataset you will have all the data you need to do this calculation, but I hesitate to describe how it would be done because it seems so different from your implicit approach. – whuber Mar 27 '12 at 18:22
Thanks. Your right. Probably all I need is business data and streets to see what exists. I would also like to see what zones allow these types of uses to see where this combo is possible or where it is close or non existent. If you could share your approach it would be helpful. – Michael Brown Mar 27 '12 at 22:09
That's a smart idea to use data like zoning as a double-check on the other more precise (but perhaps occasionally inaccurate) data. – whuber Mar 27 '12 at 22:17
Does anyone know what kind of query will identify areas with at least 10 of the three sets of uses within 3 linear blocks? – Michael Brown Mar 27 '12 at 22:27

Conceptually, a good solution can be had by reversing the natural way of thinking about this problem. The question concerns finding all locations with at least 10 of each kind of establishment within a three-block distance. That makes it sound like each location has to be inspected separately, searching three blocks in all directions. Because there are infinitely many possible locations, this is usually done by adopting a raster (grid) representation using a fairly fine cell size, so that streets are rendered with reasonable precision. The work still sounds formidable: such grids often have millions to hundreds of millions of cells.

Instead, though, "spread" each establishment out onto all locations within three blocks of it. Each establishment contributes a count of one to each such nearby grid cell. Letting the counts accumulate separately at each cell produces a focal (neighborhood) sum of the establishments. Now you only need to select the points where the sum has reached (or exceeded) 10 for each of the three kinds of establishments.

Thus,

• The restaurant focal sum (which is a raster dataset) counts the number of restaurants (open later than 6 pm) within x distance of each point.

• The retail focal sum counts the number of retail establishments (open later than 6 pm) within x distance of each point.

• The store ... etc.

With these three raster datasets in hand, the query is an easy local logical combination (retain all points where each of the focal sums is 10 or greater).

The challenge lies in using the city street distance to compute focal sums. If that distance isn't critical in the application, just use a circular or a diamond-shaped neighborhood: this enables the software to exploit Fast Fourier Transform techniques, which are blazingly fast. (When most city streets are oriented up-down and left-right on the grid, a diamond-shaped neighborhood can be a pretty accurate representation of a distance-limited "circle.")

If accuracy is critical, you may need to work much harder. In the worst case of irregular streets and high accuracy needs, you would likely have to loop over each shop location and compute its contribution to the focal sum by means of a distance calculation (via CostDistance, PathDistance, or street network calculations) and separately add all these contributions. That would likely require some detailed coding.

-
Thanks. What GIS software would you use? Also is there an easy way to get yellow pages business directory data for a particular city? Anybody know of any sources? – Michael Brown Mar 30 '12 at 17:54
Michael, the question about business directory data is so different from the one we're discussing here that you should ask it as a new question. As far as GIS software goes, anything that supports a good variety of raster calculations and is programmable will work. This could include Spatial Analyst, GRASS, Idrisi, Manifold, and even R or Mathematica. – whuber Apr 3 '12 at 6:19