# Defining extent of SAGA proximity algorithm output

I try to calculate raster distance to restaurants using proximity in QGIS. I have the following data:

• Binary Int Raster with restaurant location
• Perimeter Shapefile

Using QGIS GDAL Proximity, I got this error message, which I don't understand:

Using SAGA GIS, I was able to create the Distance Raster, but only in a square defined by the uttermost 1-value pixels. I'd like to calculate in my whole perimeter. In the following image you see the cells (shown as point vectors for better visibility), distance raster and perimeter.

So, how can increase the area of the raster calculation?

It seems the underlying question is how to set up a grid system which covers the extent of the perimeter polygon, because it defines the workflow.

An approach using SAGA GUI can be summarized as below.

1. Create a grid system which covers whole your area of interest. In this case you can choose the extent of the perimeter polygon.
2. Rasterize the point layer (your restaurant shapefile) onto the blank grid made in the step 1 above.
3. Create proximity raster from the rasterized points.
4. Clip the proximity raster by the AOI polygon (perimeter).

Details:

Step 1: Create Grid --- `SAGA Tool Libraries | Grid | Tools | Create Grid System`

• Extent Definition: `one or more shapes layers` ...This enables us to select shapefile layers.
• Data Objects Shapes >> Shapes Layers ... Select your perimeter polygon.

Step 2: Rasterize --- `SAGA Tool Libraries | Grid | Gridding | Shapes to Grid`

• Shapes ...Select your restaurant point layer.
• Target Grid System... Select the grid system generated in the Step 1.

Step 3: Proximity raster --- `SAGA Tool Libraries | Grid | Tools | Proximity Grid`

Step 4: Clipping --- `SAGA Tool Libraries | Shapes | Grid Tools | Clip Grid with Polygon`

• Polygons ... Select your perimeter polygon shapefile, which cutouts the raster.

• Thank you! I will create a "template" grid system as I will need this more than once! Jan 24, 2018 at 18:37
• I don't have SAGA standalone installed and would prefer to use QGIS UI. Where do I find the `Create Grid System`tool within QGIS? Jan 25, 2018 at 15:47
• @Kevkev770 Unfortunately the tool (or its equivalent) is not available in the QGIS. If you are using QGIS standalone, SAGA GUI comes along with it. Jan 25, 2018 at 17:27
• @Kevkev770 You said you used SAGA GIS in your original question. Can I understand that you have access SAGA algorithms through the Processing Toolbox, but not SAGA GUI? If so, please try `Constant grid` which is in SAGA - Raster tools. Jan 26, 2018 at 15:27
• sorry I wasn't clear! yes I used saga proximity through processing toolbox! pretty cool now, it worked! Maybe there is even a more straight approach, as I realized it is possible to define an output extent on map canvas! Jan 26, 2018 at 16:32