Editing shapefiles

Shapefiles are a fundamental data format in GIS used both for exchanging data as well as performing GIS analysis. In this section, we'll learn how to work with these files extensively. In Chapter 2, Geospatial Data, we discussed shapefiles as a format which can have many different file types associated with it. For editing shapefiles and most other operations, we are only concerned with two types: the .shp file and the .dbf file.

The .shp file contains the geometry while the .dbf file contains the attributes of the corresponding geometry. For each geometry record in a shapefile, there is one dbf record. The records aren't numbered or identified in any way. This means while adding and deleting information from a shapefile, you ...

Get Learning Geospatial Analysis with Python - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.