Book Image

Python Geospatial Development Essentials

By : Karim Bahgat
Book Image

Python Geospatial Development Essentials

By: Karim Bahgat

Overview of this book

Table of Contents (15 chapters)
Python Geospatial Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Rendering


Typical usage in a GIS is to add one or more geographic data sources or layers to the application, which then gets immediately rendered in a map window. In Chapter 3, Designing the Visual Look of Our Application, we set this up as a MapView widget. Although the MapView widget is responsible to show the map in the interactive GUI, we want to separate the actual rendering logic in a module of its own. This way the user can also batch generate map renderings strictly through coding if they want.

Usually, graphics rendering is done most efficiently using the graphic capabilities of the user's hardware to draw on the screen. However, Tkinter's screen drawing capabilities (the Tkinter Canvas widget) can be slow, quickly runs out of memory if too many items are drawn, and produces only rough jagged graphics with no anti-aliased smoothing. We instead use the approach of drawing the graphics onto a virtual image, and then sending that image for display in Tkinter. This gives us a slight...