Configure a My House Polygon in Polygon Search
Overview
The Show My function in My House by default uses a Point in Polygon search to return results. What this guide aims to do is to show you how you can create a My House Polygon in Polygon search.
Scenario
Say you wish to show all Planning Applications which intersect the BLPU Polygons of a property rather than just the BLPU Seed point.
The following steps assume that you:
- have a BLPU Polygons table called demo_planning.blpu_polygons with a wkb_geometry field
- have a Planning Applications table called demo_planning.planning_applications with planref, name and wkb_geometry fields
- wish to return the fields planref and name from the Planning Applications table
- wish to return the wkb_geometry from the BLPU Polygons table
Step-by-step guide
This is possible when using a My House Classic Layer by using SQL to return a row per Planning Application which intersects each BLPU Polygons with the geometry being the BLPU Polygon not the Planning Application geometry. This can be achieved editing the DATA MapServer LAYER Object object in the .MAP file
Add a new LAYER to the .MAP file and in the DATA entry add the following:
DATA "wkb_geometry from (select row_number() over () as ogc_fid, b.wkb_geometry, p.planref, p.name from demo_planning.blpu_polygons b inner join demo_planning.planning_applications p on st_intersects(b.wkb_geometry, p.wkb_geometry)) as foo using unique ogc_fid using srid=27700"
- Click the Show My radio button in the Search and Show My section for the My House Classic Layer, pick the Fields you wish to display and configure the Field Settings e.g.
- The following is the an example of how the information may be displayed in My House.