/*! \page sdts_al_main
SDTS Abstraction Library

Introduction

SDTS_AL, the SDTS Abstraction Library, is intended to be an relatively easy to use library for reading vector from SDTS TVP (Topological Vector Profile) files, primary DLG data from the USGS. It also include support for reading raster data such as USGS DEMs in SDTS format. It consists of open source, easy to compile and integrate C++ code.

SDTS Background

The USGS SDTS Page at http://mcmcweb.er.usgs.gov/sdts is the definative source of information on the SDTS format. The SDTS format is based on the ISO 8211 encoding scheme for the underlying files, and the SDTS Abstraction Library uses ISO8211Lib library to decode them. All references to DDF* classes are from ISO8211Lib.

An SDTS Transfer is a grouping of ISO8211 encoded files (ending in the .DDF extension), normally with part of the basename in common. For instance a USGS DLG SDTS transfer might consists of many files matching the SC01????.DDF pattern. The key file in an SDTS transfer is the catalog file, such as SC01CATD.DDF.

Development Information

The sdts_al.h include file contains the definitions for all public SDTS classes, enumerations and other services.

The SDTSTransfer class is used to access a transfer as a whole. The SDTSTransfer::Open() method is passed the name of the catalog file, such as SC01CATD.DDF, to open.

The SDTSTransfer analyses the catalog, and some other aspects of the transfer, and builds a list of feature layers. This list can be accessed using the SDTSTransfer::GetLayerCount(), SDTSTransfer::GetLayerType(), and SDTSTransfer::GetLayerIndexedReader() methods. A typical TVP (Topological Vector Profile) transfer might include three point layers (of type SLTPoint), a line layer (of type SLTLine), a polygon layer (of type SLTPoly) as well as some additional attribute layers (of type SLTAttr). the SDTSTransfer::GetLayerIndexedReader() method can be used to instantiate a reader object for reading a particular layer. (NOTE: raster layers are handled differently).

Each type of SDTSIndexedReader (SDTSPointReader, SDTSLineReader, SDTSPolygonReader, and SDTSAttrReader) returns specific subclasses of SDTSIndexedFeature from the SDTSIndexedReader::GetNextFeature() method. These classes are SDTSRawPoint, SDTSRawLine, SDTSRawPolygon and SDTSAttrRecord. These classes can be investigated for details on the data available for each.

See the SDTS_AL Tutorial for more information on how to use this library.

Building the Source on Unix

  1. First, fetch the source. The most recent source should be accessable at an url such as ftp://gdal.velocet.ca/pub/outgoing/sdts_1_3.tar.gz.

  2. Unpack the source.

    % gzip -d sdts_1_3.tar.gz
    % tar xzvf sdts_1_3.tar.gz
    
  3. Type ``configure'' to establish configuration options.

  4. Type make to build sdts_al.a, and the sample mainline sdts2shp.

See the SDTS_AL Tutorial for more information on how to use this library.

Building the Source on Windows

  1. First, fetch the source. The most recent source should be accessable at an url such as ftp://gdal.velocet.ca/pub/outgoing/sdts_1_3.zip.

  2. Unpack the source.

    C:\SDTS> unzip sdts_1_3.zip
    
  3. Build using makefile.vc with VC++. You will need the VC++ runtime environment variables (LIB/INCLUDE) set properly. This will build the library (sdts_al.lib), and the executables sdts2shp.exe, 8211view.exe and 8211dump.exe.

    C:\SDTS> nmake /f makefile.vc
    
See the SDTS_AL Tutorial for more information on how to use this library.

The sdts2shp Sample Program

The sdts2shp program distributed with this toolkit is primary intended to serve as an example of how to use the SDTS access library. However, it can be useful to translate SDTS datasets into ESRI Shapefile format.
Usage: sdts2shp CATD_filename [-o shapefile_name]
                [-m module_name] [-v]

Modules include `LE01', `PC01', `NP01' and `ARDF'
A typical session in which we inspect the contents of a transfer, and then extract polygon and line layers might look like this:

warmerda[134]% sdts2shp data/SC01CATD.DDF -v
Layers:
  ASCF: `Attribute Primary         '
  AHDR: `Attribute Primary         '
  NP01: `Point-Node                '
  NA01: `Point-Node                '
  NO01: `Point-Node                '
  LE01: `Line                      '
  PC01: `Polygon                   '

warmerda[135]% sdts2shp data/SC01CATD.DDF -m PC01 -o pc01.shp
warmerda[136]% sdts2shp data/SC01CATD.DDF -m LE01 -o le01.shp
A prebuilt executable is available for Windows.

Licensing

This library is offered as Open Source. In particular, it is offered under the X Consortium license which doesn't attempt to impose any copyleft, or credit requirements on users of the code.

The precise license text is:

Copyright (c) 1999, Frank Warmerdam

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author and Acknowledgements

The primary author of SDTS_AL is Frank Warmerdam, and I can be reached at warmerdam@pobox.com. I am eager to receive bug reports, and also open to praise or suggestions.

I would like to thank:

I would also like to dedicate this library to the memory of Sol Katz. Sol released a variety of SDTS translators, at substantial personal effort, to the GIS community along with the many other generous contributions he made to the community. His example has been an inspiration to me, and I hope similar efforts on my part will contribute to his memory.

*/