OGR batch commands

OGR offers a series of batch commands that can be used to describe and convert existing geospatial vector data. We've already mentioned two of them, ogrinfo and ogr2ogr, in Chapter 4, Data Types, Storage, and Conversion:

  • ogrinfo can be used for doing all sorts of reporting on vector data, such as listing supported vector formats, available layers, and summary details, and can be combined with SQL-query syntax to select features from a dataset.
  • ogr2ogr is for doing vector data translations, such as converting vector files between different formats, converting multiple layers into a new data source, and reproject vector data and filter features based on location. It can also be used with SQL-query syntax just like ogrinfo.

These are very powerful commands that let you do a lot of work. It is recommended you familiarize yourself with these commands when working with vector data. We'll get to some examples shortly.

Additionally, two other batch commands exist for creating vector tiles, ogrtindex and ogr2vrt. The difference between the two is that the second one is more broadly usable than the first. The second command needs to be imported from an online script as it is not distributed with recent GDAL versions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset