Skip to content

Interface: LayerInput ​

Defined in: layers.ts:37

One layer to write into a multi-layer archive.

Extends ​

Properties ​

dimensions? ​

ts
optional dimensions?: Dimensions;

Defined in: types.ts:147

Force the dimensionality.

By default a third ordinate is read as Z and a fourth as a measure; pass 'xym' to treat the third as a measure instead.

Inherited from ​

WriteOptions.dimensions


epsg? ​

ts
optional epsg?: number;

Defined in: types.ts:213

EPSG code for the .prj.

Resolved against the built-in codes, anything registered via registerProjections, and — loaded on demand — the bundled table of 116 definitions. An unresolvable code throws rather than silently omitting the .prj.

Inherited from ​

ProjectionOptions.epsg


geojson ​

ts
geojson: string | GeoJsonInput;

Defined in: layers.ts:47

The layer's geometry and attributes. Accepts everything writeShapefile does, including a JSON string.


maxFieldLength? ​

ts
optional maxFieldLength?: number;

Defined in: types.ts:154

Cap on .dbf character column width, 1–254. Defaults to 254.

Columns are otherwise sized to the longest value present. Lowering this shrinks the file at the cost of truncating long text.

Inherited from ​

WriteOptions.maxFieldLength


name ​

ts
name: string;

Defined in: layers.ts:42

Base name for this layer's files. Sanitised the same way as fileName elsewhere, and must stay unique across the batch once sanitised.


prj? ​

ts
optional prj?: string;

Defined in: layers.ts:53

Alias for ProjectionOptions.wkt, so a layer returned by readShapefileZip can be passed straight back in without renaming a field. wkt wins if both are set.


shapeType? ​

ts
optional shapeType?: ShapeFamily;

Defined in: types.ts:140

Force a geometry family instead of inferring it from the data.

Useful when a batch happens to contain only Point features but downstream consumers expect Multipoint.

Inherited from ​

WriteOptions.shapeType


wkt? ​

ts
optional wkt?: string;

Defined in: types.ts:215

Raw ESRI WKT for the .prj. Takes precedence over epsg.

Inherited from ​

ProjectionOptions.wkt

Released under the MIT License.