Flagging dwelling units falling outside of a polygon/Enumeration Area

Hi Support:
Can you direct me to an example of how I may be able to flag/highlight interviews where GPS was recorded for dwelling unit points falling outside of a specified polygon or enumeration area.

I want to see where the enumerator interviewed dwelling units outside of a specified/designated area.

Best Regards

The answer depends on the software tools you’re using to analyze your data.

For example, look at this question (and answer) on Stack Exchange showing the answer using R:

If you are using PostgreSQL, there is PostGIS extension that allows working with geospatial data with ‘regular’ SQL, so the query to show all superheroes located in Goham city would look like this:
SELECT superhero.name
FROM city, superhero
WHERE ST_Contains(city.geom, superhero.geom)
AND city.name = ‘Gotham’;
(example from PostGIS homepage https://postgis.net/)

Few options using Python (again Stack Exchange):