Reading and writing geospatial data
While you could, in theory, write your own parser to read a particular geospatial data format, it is much easier to use an existing Python library to do this. We will look at two popular libraries for reading and writing geospatial data: GDAL and OGR.
GDAL/OGR
Unfortunately, the naming of these two libraries is rather confusing. GDAL (short for Geospatial Data Abstraction Library), was originally just a library for working with raster-format geospatial data, while the separate OGR library was intended to work with vector-format data. However, the two libraries are now partially merged and generally downloaded and installed together under the combined name of GDAL. To avoid confusion, we will call this combined library GDAL/OGR and use GDAL to refer to just the raster translation library.
A default installation of GDAL allows you to read data in 100 different raster file formats, and write data in 71 different formats. OGR, by default, supports reading data...