forked from bjornharrtell/jsts
/
jsts.js
152 lines (130 loc) · 2.82 KB
/
jsts.js
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/* Copyright (c) 2011 by The Authors.
* Published under the LGPL 2.1 license.
* See /license-notice.txt for the full text of the license notice.
* See /license.txt for the full text of the license.
*/
/** @namespace */
jsts = {
version: '0.11.0',
/** @namespace */
algorithm: {
/** @namespace */
locate: {}
},
/** @namespace */
error: {},
/** @namespace */
geom: {
/** @namespace */
util: {}
},
/** @namespace */
geomgraph: {
/** @namespace */
index: {}
},
/** @namespace */
index: {
/** @namespace */
bintree: {},
/** @namespace */
chain: {},
/** @namespace */
kdtree: {},
/** @namespace */
quadtree: {},
/** @namespace */
strtree: {}
},
/** @namespace */
io: {},
/** @namespace */
noding: {
/** @namespace */
snapround: {}
},
/** @namespace */
operation: {
/** @namespace */
buffer: {},
/** @namespace */
distance: {},
/** @namespace */
overlay: {
/** @namespace */
snap: {}
},
/** @namespace */
relate: {},
/** @namespace */
union: {},
/** @namespace */
valid: {}
},
/** @namespace */
planargraph: {},
/** @namespace */
simplify: {},
/** @namespace */
triangulate: {
/** @namespace */
quadedge: {}
},
/** @namespace */
util: {}
};
/**
* Global function intended for use as a generic abstract method.
*/
jsts.abstractFunc = function() {
throw new jsts.error.AbstractMethodInvocationError();
};
jsts.error = {};
/**
* @constructor
*/
jsts.error.IllegalArgumentError = function(message) {
this.name = 'IllegalArgumentError';
this.message = message;
};
jsts.error.IllegalArgumentError.prototype = new Error();
/**
* @constructor
*/
jsts.error.TopologyError = function(message, pt) {
this.name = 'TopologyError';
this.message = pt ? message + ' [ ' + pt + ' ]' : message;
};
jsts.error.TopologyError.prototype = new Error();
/**
* @constructor
*/
jsts.error.AbstractMethodInvocationError = function() {
this.name = 'AbstractMethodInvocationError';
this.message = 'Abstract method called, should be implemented in subclass.';
};
jsts.error.AbstractMethodInvocationError.prototype = new Error();
/**
* @constructor
*/
jsts.error.NotImplementedError = function() {
this.name = 'NotImplementedError';
this.message = 'This method has not yet been implemented.';
};
jsts.error.NotImplementedError.prototype = new Error();
/**
* @constructor
*/
jsts.error.NotRepresentableError = function(message) {
this.name = 'NotRepresentableError';
this.message = message;
};
jsts.error.NotRepresentableError.prototype = new Error();
/**
* @constructor message
*/
jsts.error.LocateFailureError = function(message) {
this.name = 'LocateFailureError';
this.message = message;
};
jsts.error.LocateFailureError.prototype = new Error();