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

Weaving functionality into the user interface


Next, let's make the analysis functionality created so far accessible in the user interface of our application.

Layer-specific right-click functions

In Chapter 5, Managing and Organizing Geographic Data, we instructed our application that right-clicking a layer in the LayersPane give us a menu of actions to choose from that is specific to that particular layer. In the current chapter, the only layer-specific functionality we made is the buffer operation. Therefore, we add the buffer menu option to the RightClickMenu_VectorLayer class in app/dialogues.py. Remember to find and save an app/icons/buffer.png icon so that it can be displayed next to the menu's buffer item:

        # Buffering
        def open_options_window():
            window = VectorBufferOptionWindow(self.layeritem, self.layerspane, self.layeritem, statusbar)
        self.imgs["buffer"] = icons.get("buffer.png", width=32, height=32)
        self.add_command(label="Buffer", command...