wkx.d.ts
3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/// <reference types="node" />
declare module "wkx" {
export class Geometry {
srid: number;
hasZ: boolean;
hasM: boolean;
static parse(value: string | Buffer): Geometry;
static parseTwkb(value: Buffer): Geometry;
static parseGeoJSON(value: {}): Geometry;
toWkt(): string;
toEwkt(): string;
toWkb(): Buffer;
toEwkb(): Buffer;
toTwkb(): Buffer;
toGeoJSON(options?: GeoJSONOptions): {};
}
export interface GeoJSONOptions {
shortCrs?: boolean;
longCrs?: boolean;
}
export class Point extends Geometry {
x: number;
y: number;
z: number;
m: number;
constructor(x?: number, y?: number, z?: number, m?: number, srid?: number);
static Z(x: number, y: number, z: number, srid?: number): Point;
static M(x: number, y: number, m: number, srid?: number): Point;
static ZM(x: number, y: number, z: number, m: number, srid?: number): Point;
}
export class LineString extends Geometry {
points: Point[];
constructor(points?: Point[], srid?: number);
static Z(points?: Point[], srid?: number): LineString;
static M(points?: Point[], srid?: number): LineString;
static ZM(points?: Point[], srid?: number): LineString;
}
export class Polygon extends Geometry {
exteriorRing: Point[];
interiorRings: Point[][];
constructor(exteriorRing?: Point[], interiorRings?: Point[][], srid?: number);
static Z(exteriorRing?: Point[], interiorRings?: Point[][], srid?: number): Polygon;
static M(exteriorRing?: Point[], interiorRings?: Point[][], srid?: number): Polygon;
static ZM(exteriorRing?: Point[], interiorRings?: Point[][], srid?: number): Polygon;
}
export class MultiPoint extends Geometry {
points: Point[];
constructor(points?: Point[], srid?: number);
static Z(points?: Point[], srid?: number): MultiPoint;
static M(points?: Point[], srid?: number): MultiPoint;
static ZM(points?: Point[], srid?: number): MultiPoint;
}
export class MultiLineString extends Geometry {
lineStrings: LineString[];
constructor(lineStrings?: LineString[], srid?: number);
static Z(lineStrings?: LineString[], srid?: number): MultiLineString;
static M(lineStrings?: LineString[], srid?: number): MultiLineString;
static ZM(lineStrings?: LineString[], srid?: number): MultiLineString;
}
export class MultiPolygon extends Geometry {
polygons: Polygon[];
constructor(polygons?: Polygon[], srid?: number);
static Z(polygons?: Polygon[], srid?: number): MultiPolygon;
static M(polygons?: Polygon[], srid?: number): MultiPolygon;
static ZM(polygons?: Polygon[], srid?: number): MultiPolygon;
}
export class GeometryCollection extends Geometry {
geometries: Geometry[];
constructor(geometries?: Geometry[], srid?: number);
static Z(geometries?: Geometry[], srid?: number): GeometryCollection;
static M(geometries?: Geometry[], srid?: number): GeometryCollection;
static ZM(geometries?: Geometry[], srid?: number): GeometryCollection;
}
}