
Python Geospatial Analysis Cookbook
By :

A point inside a polygon analysis query is a very common spatial operation. This query can identify objects located within an area such as a polygon. The area of interest in this example is a 100 m buffer polygon around bike paths and we would like to locate all schools that are inside this polygon.
In the previous section, we used the schools
table to create a buffer. This time around, we will use this table as our input points table. The bikeways
table that we imported in Chapter 3, Moving Spatial Data from One Format to Another, will be used as our input lines to generate a new 100 m buffer polygon. Be sure, however, that you have the two datasets in your local PostgreSQL database.
Now, let's dive into some more code to find schools located within 100 m of the bikeways in order to find points inside a polygon:
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import psycopg2 from geojson import loads, Feature...
Change the font size
Change margin width
Change background colour