Summarizing Information Using Other Tools

While ogrinfo and other ogr utilities are powerful tools, basic text-processing tools such as sort, uniq, wc, and sed can give them an extra bit of flexibility. The tools here are readily available for Unix-type operating systems (like Linux) by default. They are also available for other operating systems but you may need to download a package (e.g., from http://gnu.org) to get them for your system.

Each command can receive text streams. In this case, the text stream will be the lines of information coming from ogrinfo and listed on the screen. These commands take in those lines and allow you to, for example, show only certain portions of them, to throw away certain lines, reformat them, do a search/replace function or count items. Many types of functions can be done using the ogrinfo -sql parameter, but the ultimate formatting of the results isn't always what is desired. These examples show some common patterns for extracting specific information and generating more custom stats.

Setting Up Processing Tools for Non-GNU Platforms

These text-processing tools are sometimes packaged together, but are usually separate projects in and of themselves. Most of them were formed as part of the GNU/Free Software Foundation and are registered with the GNU free software directory at http://www.gnu.org/directory/. The targets of GNU software are free operating systems, which can cause some problems if you are dependent on an operating system such as Microsoft ...

Get Web Mapping Illustrated 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.