Chapter 3. Moving Spatial Data from One Format to Another

In this chapter, we will cover the following topics:

  • Converting a Shapefile to a PostGIS table using ogr2ogr
  • Batch importing a folder of Shapefiles into PostGIS using ogr2ogr
  • Batch exporting a list of tables from PostGIS to Shapefiles
  • Converting an OpenStreetMap (OSM) XML to a Shapefile
  • Converting a Shapefile (vector) to a GeoTiff (raster)
  • Converting a raster (GeoTiff) to a vector (Shapefile) using GDAL
  • Creating a Shapefile from point data stored in Microsoft Excel
  • Converting an ESRI ASCII DEM to an image height map

Introduction

Geospatial data comes in hundreds of formats and massaging this data from one format to another is a simple task. The ability to convert between data types, such as rasters ...

Get Python Geospatial Analysis Cookbook 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.