Mapping queries

In Chapter 3Introduction to Geospatial Databases, you queried the database and got text back. The geometry came back as well-known text (WKT). These are the results we asked for, but I cannot visualize geographic data by reading a list of coordinates. I need to see it on a map. In this section, you will use ipyleaflet and Jupyter to map the results of your queries.

To map the queries in Jupyter, you need to install ipyleaflet. You can do this using pip at your OS's command prompt:

pip install ipyleaflet

Then you may need to enable the extension, depending on your environment. At the command prompt, type:

jupyter nbextension enable --py --sys-prefix ipyleaflet
For the code, and examples of using ipyleaflet, you can view the ...

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.