IShapeReader

Description

interface Tinman.Terrain.Shapes.IShapeReader

Base interface for classes that read vector shapes.

After creating a IShapeReader object, individual shapes may be read sequentially by calling the ReadShape method. Before actually reading a shape, the following methods may be used to peek at the data of the next shape:

The SkipShape method may be used to skip the next shape, instead of reading it. The decision whether to read or skip a shape is usually made after peeking at the shape data.

A shape reader will merge subsequent compatible shape data into IShape objects. Shape data compatibility is defined as follows:

When reading shape data, it is often the case that not all information is of interest. For example, only specific metadata information is required or some custom shape values are not needed. By specifying a modifier via Modifier, the shape reader can be told to modify the original shape data, before creating IShape objects. Merging of compatible shape data is performed on the modified shape data.

Public / Methods

Modifier


[OwnerReturn] [OwnerThis]
public method Modifier → (1)

modifier in : IShapeReaderModifier

The modifier to use or null.

returns → IShapeReader

this

Specifies a IShapeReader object to use for modifying the original shape data before building IShape objects.

Read​Shape


public method ReadShape → ()

returns → IShape

The shape or null iff the reader has finished.

Reads the next shape.

IOException

If an I/O error has occurred.

Skip​Shape


public method SkipShape → ()

returns → bool

true if the shape has been skipped,
false iff the reader has finished.

Skips the next shape without reading it.

IOException

If an I/O error has occurred.

Extensions

Read​All


[OwnerThis]
public static method ReadAll → (1)

filter opt : IShapeReaderFilter = null

Optional filter to use. If null, ShapeReaderFilter.Read will be used.

returns → IShape

The aggregated shape or null iff no shapes have been read or have passed the given filter opt.

Reads all remaining shapes and returns them in a single aggregated shape.

This method will use the geo-reference of the first shape to build a shape group if the reader returns two or more shapes.

IOException

If an I/O error has occurred.

Read​List


[OwnerThis]
public static method ReadList → (1)

filter opt : IShapeReaderFilter = null

Optional filter to use. If null, ShapeReaderFilter.Read will be used.

returns → IVector<IShape>

The list of shapes that have been read.

Reads all remaining shapes and returns them as a a list.

IOException

If an I/O error has occurred.