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

Introduction

This chapter focuses on ways to structure data using the functionality provided by the combination of PostgreSQL and PostGIS. These will be useful approaches for structuring and cleaning up imported data, converting tabular data into spatial data "on the fly" as it is entered, and maintaining relationships between tables and datasets using functionality endemic to the powerful combination of PostgreSQL and PostGIS. There are three categories of techniques by which we will leverage these functionalities: automatic population and modification of data using views and triggers, object orientation using PostgreSQL table inheritance, and using PostGIS functions (stored procedures) to reconstruct and normalize problematic data.

Automatic population of data is where this chapter begins. By leveraging PostgreSQL views and triggers, we can create ad hoc and flexible solutions to create connections between and within the tables. By extension, and for more formal or structured cases, PostgreSQL provides table inheritance and table partitioning that allow for explicit hierarchical relationships between tables. This can be useful in cases where an object inheritance model enforces data relationships that either represent the data better, thereby resulting in greater efficiencies, or reduce the administrative overhead of maintaining and accessing the datasets over time. With PostGIS extending that functionality, the inheritance can apply not just to the commonly used table attributes, but can also leverage spatial relationships between tables, resulting in greater query efficiency with very large datasets. Finally, we will explore PostGIS SQL patterns that provide table normalization of data inputs, so datasets that come from flat filesystems or are not normalized can be converted to a form we would expect in a database.

主站蜘蛛池模板: 云南省| 崇明县| 西藏| 威远县| 宜兴市| 庆城县| 东安县| 泾源县| 寿阳县| 永安市| 勐海县| 和龙市| 缙云县| 新源县| 泗水县| 曲松县| 昭觉县| 侯马市| 沂源县| 若尔盖县| 黎城县| 阳朔县| 涡阳县| 隆昌县| 宜君县| 航空| 桂阳县| 北流市| 滁州市| 嘉祥县| 宁化县| 临漳县| 宁河县| 东乌| 新平| 望都县| 西昌市| 驻马店市| 宁都县| 宁津县| 库伦旗|