ABSTRACT

GIS is different from other software technologies due to its algorithms and analyses for spatial relationships in spatial data. This chapter introduces a similar category of algorithms for vector data processing, including the calculations of centroid, area, length, line intersection, and point in polygon, which are the fundamental algorithms based on geometry and the spatial relationship. Centroid can be considered as the gravity center of a feature. A rectangle's centroid is the intersection of the rectangle's two diagonals. Length calculation finds the length of a line feature and the perimeter of a polygon feature. A ray casting algorithm is used to check whether a point is inside a polygon. The chapter provides hands-on practices, aiming to demonstrate how to programmatically implement the vector data algorithms using Python.