First of all, we should upload our random houses in our spatial database. In order to do this, let's open QGIS's database manager through Database
| DB Manager
| DB Manager
. Connect to the PostGIS database with the role we have--write privileges--and import the houses layer with Import layer/file
. Of course, we have to open our raw houses layer, as it is not opened in QGIS. The options should be the same as before, which are as follows:
- Use the spatial schema.
- The table name should be
houses
. - Check the
Create spatial index
box at least, but checking theCreate single-part geometries instead of multi-part
box as well will do no harm either. - We do not have to define SRID information, as the data is already present in our local projection.
When we are done, let's visualize the uploaded houses
layer in QGIS, and remove the one saved to the disk. If everything is fine, we should keep the DB manager window open, as we will execute our SQL queries there: