官术网_书友最值得收藏!

Summary

In this chapter, we explored the QGIS Python Console, and how to use it for a variety of programming tasks. We also used the console to delve more deeply into the QGIS Python programming environment.

As we worked through this chapter, we learned what the various toolbar buttons and controls do within the QGIS Console, and how to enter commands using the Python Shell. We looked at how we can use the Python Interpreter Log to view the previous output and re-enter commands you executed earlier. We saw the ways in which you can use autocompletion to enter your Python code more quickly, and also learned about the parameters that the various PyQGIS functions and methods accept.

We then looked at how to enter and execute Python scripts using the built-in source code editor. We discovered that the Python Console is itself written in Python, allowing you to explore the source code and manipulate the console itself using the Python code.

We learned how to create a startup script that is run automatically whenever QGIS starts up, and how you can use this to set up the console to open automatically and prevent it from acting as a dockable window.

Next, we examined the process of loading geospatial data directly using your Python scripts, without first having to load it into a QGIS map layer. We saw how to identify the attributes defined by a shapefile, how to scan through the features within a shapefile, and the ways in which the PyQGIS libraries allow you to perform common geospatial calculations.

We then looked at the various ways in which you can make use of QGIS user interface elements within your Python scripts, including the status bar, message bars, progress indicators, and the QGIS message log.

Finally, we saw how you can use standard PyQt classes to create your own windows and dialog boxes to provide a sophisticated user interface for your Python scripts.

In the following chapter, we will work more directly with the QGIS Python libraries, learning how these libraries are structured and how you can use them to perform various sorts of geospatial data manipulation and display the results on a map.

主站蜘蛛池模板: 五原县| 东阿县| 石家庄市| 志丹县| 乌鲁木齐市| 平凉市| 静海县| 荃湾区| 通榆县| 京山县| 西乌珠穆沁旗| 六枝特区| 卫辉市| 蒙城县| 建德市| 长泰县| 昌江| 东源县| 青田县| 察雅县| 乌拉特中旗| 香港| 平度市| 汉川市| 新蔡县| 师宗县| 迁安市| 枞阳县| 布尔津县| 乳山市| 辉县市| 洮南市| 镇安县| 天台县| 剑河县| 蓝山县| 延吉市| 谢通门县| 隆安县| 海原县| 建水县|