@tmcw/togeojson 5.2.2 → 5.3.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,392 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ## [5.3.0](https://github.com/placemark/togeojson/compare/v5.2.1...v5.3.0) (2022-10-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * Import visibility ([#94](https://github.com/placemark/togeojson/issues/94)) ([920c869](https://github.com/placemark/togeojson/commit/920c869f4233d5f0dba04e6ba7cbc5739d8cca86))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * properly support KMLs with sibling MultiGeometries ([#96](https://github.com/placemark/togeojson/issues/96)) ([f0e978a](https://github.com/placemark/togeojson/commit/f0e978a2932268cc5b1f9e023882a32d16fe6abd))
16
+
17
+ ### [5.2.2](https://github.com/placemark/togeojson/compare/v5.2.1...v5.2.2) (2022-08-09)
18
+
19
+ ### [5.2.1](https://github.com/placemarkio/togeojson/compare/v5.2.0...v5.2.1) (2022-06-15)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * Limit extracted coordinates to 3 ([#91](https://github.com/placemarkio/togeojson/issues/91)) ([b35d5a2](https://github.com/placemarkio/togeojson/commit/b35d5a2b21dfd392dee816f22caf4dd000aa6b91))
25
+
26
+ ## [5.2.0](https://github.com/placemarkio/togeojson/compare/v5.1.3...v5.2.0) (2022-06-12)
27
+
28
+
29
+ ### Features
30
+
31
+ * Handle HTML in description tags ([#90](https://github.com/placemarkio/togeojson/issues/90)) ([1d2dbfe](https://github.com/placemarkio/togeojson/commit/1d2dbfe160d6b998fd945d2c6194451a7928ed02))
32
+
33
+ ## [5.2.0-1](https://github.com/placemarkio/togeojson/compare/v5.2.0-0...v5.2.0-1) (2022-06-12)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * Fix typo ([4a9a57a](https://github.com/placemarkio/togeojson/commit/4a9a57a9cc6f9ec63a2df1cc2944dbb763a19b1c))
39
+
40
+ ## [5.2.0-0](https://github.com/placemarkio/togeojson/compare/v5.1.3...v5.2.0-0) (2022-06-12)
41
+
42
+
43
+ ### Features
44
+
45
+ * Handle HTML in description tags ([e156191](https://github.com/placemarkio/togeojson/commit/e156191780ba5618a63d6787ae481fd50bc0c075))
46
+
47
+ ### [5.1.3](https://github.com/placemarkio/togeojson/compare/v5.1.2...v5.1.3) (2022-05-22)
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * Switch ESM entry point to use .mjs ending to fix Node.js native ESM support ([cd366b8](https://github.com/placemarkio/togeojson/commit/cd366b8b497a53803451221ebd8704d72e4c6e4a))
53
+
54
+ ### [5.1.3-0](https://github.com/placemarkio/togeojson/compare/v5.1.2...v5.1.3-0) (2022-05-22)
55
+
56
+ ### [5.1.2](https://github.com/placemarkio/togeojson/compare/v5.1.0...v5.1.2) (2022-04-24)
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * Add fixtures, block invalid GPX inputs ([#80](https://github.com/placemarkio/togeojson/issues/80)) ([d57cd80](https://github.com/placemarkio/togeojson/commit/d57cd80757deb34e5442973f4ab44acb1d4660c8))
62
+
63
+ ### [5.1.1](https://github.com/placemarkio/togeojson/compare/v5.1.0...v5.1.1) (2022-04-24)
64
+
65
+
66
+ ### Bug Fixes
67
+
68
+ * Add fixtures, block invalid GPX inputs ([#80](https://github.com/placemarkio/togeojson/issues/80)) ([d57cd80](https://github.com/placemarkio/togeojson/commit/d57cd80757deb34e5442973f4ab44acb1d4660c8))
69
+
70
+ ## [5.1.0](https://github.com/placemarkio/togeojson/compare/v5.0.0...v5.1.0) (2022-04-23)
71
+
72
+
73
+ ### Features
74
+
75
+ * Translate hotspot units ([#79](https://github.com/placemarkio/togeojson/issues/79)) ([114dcea](https://github.com/placemarkio/togeojson/commit/114dceac3844e430d6d38ad24e77d85b0ecfc99b))
76
+
77
+ ## [5.0.0](https://github.com/placemarkio/togeojson/compare/v5.0.0-5...v5.0.0) (2022-04-22)
78
+
79
+
80
+ ### Bug Fixes
81
+
82
+ * Fix color extraction ([#77](https://github.com/placemarkio/togeojson/issues/77)) ([5712bc3](https://github.com/placemarkio/togeojson/commit/5712bc3f40a49e31a279643c102f832d4216797a))
83
+
84
+ ## [5.0.0-5](https://github.com/placemarkio/togeojson/compare/v5.0.0-4...v5.0.0-5) (2022-03-19)
85
+
86
+
87
+ ### Bug Fixes
88
+
89
+ * Folder structure fixes ([#72](https://github.com/placemarkio/togeojson/issues/72)) ([ef0e3fe](https://github.com/placemarkio/togeojson/commit/ef0e3fe4109e4d2b08ea9517f5866a760d806613))
90
+
91
+ ## [5.0.0-4](https://github.com/placemarkio/togeojson/compare/v5.0.0-3...v5.0.0-4) (2022-03-15)
92
+
93
+
94
+ ### Bug Fixes
95
+
96
+ * Allow meta object to contain new values ([6dd282e](https://github.com/placemarkio/togeojson/commit/6dd282e33755699dbc95b4455fe06fdfbe8692cb))
97
+
98
+ ## [5.0.0-3](https://github.com/placemarkio/togeojson/compare/v5.0.0-2...v5.0.0-3) (2022-03-15)
99
+
100
+
101
+ ### Bug Fixes
102
+
103
+ * Export Folder and Root types ([b9fa7f0](https://github.com/placemarkio/togeojson/commit/b9fa7f0827d8417addbaca76dc9f440495cc5336))
104
+
105
+ ## [5.0.0-2](https://github.com/placemarkio/togeojson/compare/v5.0.0-1...v5.0.0-2) (2022-03-14)
106
+
107
+ ## [5.0.0-1](https://github.com/placemarkio/togeojson/compare/v5.0.0-0...v5.0.0-1) (2022-03-14)
108
+
109
+ ## [5.0.0-0](https://github.com/tmcw/togeojson/compare/v4.8.0-0...v5.0.0-0) (2022-03-14)
110
+
111
+ ## [4.8.0-0](https://github.com/tmcw/togeojson/compare/v4.7.0...v4.8.0-0) (2022-03-14)
112
+
113
+
114
+ ### Features
115
+
116
+ * Folders and TypeScript ([6f36fd3](https://github.com/tmcw/togeojson/commit/6f36fd381798377909632eae11efef9e8b9be596))
117
+
118
+ ### [4.7.1-0](https://github.com/tmcw/togeojson/compare/v4.7.0...v4.7.1-0) (2022-03-09)
119
+
120
+ ## [4.7.0](https://github.com/tmcw/togeojson/compare/v4.6.1...v4.7.0) (2022-03-08)
121
+
122
+
123
+ ### Features
124
+
125
+ * Support gx:CascadingStyle ([600c542](https://github.com/tmcw/togeojson/commit/600c542b016684066fb31107c5896bedad0b5329))
126
+
127
+ ### [4.6.1](https://github.com/tmcw/togeojson/compare/v4.6.1-1...v4.6.1) (2022-03-07)
128
+
129
+ ### [4.6.1-1](https://github.com/tmcw/togeojson/compare/v4.6.1-0...v4.6.1-1) (2022-03-07)
130
+
131
+
132
+ ### Bug Fixes
133
+
134
+ * Typo ([9cb1ed0](https://github.com/tmcw/togeojson/commit/9cb1ed06ffcd60954c629838d0cc5ba8df3aa953))
135
+
136
+ ### [4.6.1-0](https://github.com/tmcw/togeojson/compare/v4.6.0...v4.6.1-0) (2022-03-07)
137
+
138
+
139
+ ### Bug Fixes
140
+
141
+ * Make module system more convoluted ([845ff7a](https://github.com/tmcw/togeojson/commit/845ff7a2c08220d8b87860231b262709d8db070a))
142
+
143
+ ## [4.6.0](https://github.com/tmcw/togeojson/compare/v4.5.0...v4.6.0) (2022-03-07)
144
+
145
+
146
+ ### Features
147
+
148
+ * Support additional GPX extensions ([ae2f00f](https://github.com/tmcw/togeojson/commit/ae2f00f685f5fd1e74b19864b0bba8211310d31a))
149
+
150
+ ## [4.5.0](https://github.com/tmcw/togeojson/compare/v4.4.1...v4.5.0) (2021-08-03)
151
+
152
+
153
+ ### Features
154
+
155
+ * Load TCX Courses ([#53](https://github.com/tmcw/togeojson/issues/53)) ([8924925](https://github.com/tmcw/togeojson/commit/89249255bd86d8c38e855f14b62fffad3f556abf))
156
+
157
+ ### [4.4.1](https://github.com/tmcw/togeojson/compare/v4.4.0...v4.4.1) (2021-04-27)
158
+
159
+
160
+ ### Bug Fixes
161
+
162
+ * Rename heartRates coordinate property to heart ([#48](https://github.com/tmcw/togeojson/issues/48)) ([8fc03f2](https://github.com/tmcw/togeojson/commit/8fc03f2a65ab01a53b81564f7ed6fac2a66452ad))
163
+
164
+ ## [4.4.0](https://github.com/tmcw/togeojson/compare/v4.3.0...v4.4.0) (2021-03-31)
165
+
166
+
167
+ ### Features
168
+
169
+ * Add coordinate properties for times and heartRates ([#47](https://github.com/tmcw/togeojson/issues/47)) ([5e3958b](https://github.com/tmcw/togeojson/commit/5e3958b18509a85eba4b9b78ef5095b01d7dc213))
170
+
171
+ ## [4.3.0](https://github.com/tmcw/togeojson/compare/v4.2.0...v4.3.0) (2020-12-28)
172
+
173
+
174
+ ### Features
175
+
176
+ * Add heartRates to geojson properties for tcx files ([#42](https://github.com/tmcw/togeojson/issues/42)) ([ecde092](https://github.com/tmcw/togeojson/commit/ecde09219abdb507527f70358a400c799b01c2d1))
177
+
178
+ ## [4.2.0](https://github.com/tmcw/togeojson/compare/v4.1.0...v4.2.0) (2020-09-05)
179
+
180
+
181
+ ### Features
182
+
183
+ * Preserve GPX linestring type in a _gpxType property that is either rte or trk ([54fa558](https://github.com/tmcw/togeojson/commit/54fa5581a99095f87ccfe937c6da539f6b7d9995))
184
+ * TCX Support ([6df0878](https://github.com/tmcw/togeojson/commit/6df087891dffa06474479b17fc0595110ff76b3e))
185
+
186
+ ## [4.1.0](https://github.com/tmcw/togeojson/compare/v4.0.0...v4.1.0) (2020-06-13)
187
+
188
+
189
+ ### Features
190
+
191
+ * Add LabelStyle support and complete IconStyle support for KML ([f920b16](https://github.com/tmcw/togeojson/commit/f920b16493a79b7d5370a940387ae77386a00771))
192
+
193
+ ## [4.0.0](https://github.com/tmcw/togeojson/compare/v3.2.0...v4.0.0) (2020-04-05)
194
+
195
+
196
+ ### ⚠ BREAKING CHANGES
197
+
198
+ * Previously, togeojson would ignore Placemarks that did not have
199
+ associated geometry. [Per the GeoJSON
200
+ specification](https://tools.ietf.org/html/rfc7946#section-3.2),
201
+ Feature objects can have null geometries. After this change, togeojson
202
+ will output features with null geometries as the translation of KML
203
+ Placemarks with no geometry, instead of ommitting those items entirely.
204
+
205
+ ## [3.2.0](https://github.com/tmcw/togeojson/compare/v3.1.0...v3.2.0) (2019-12-29)
206
+
207
+
208
+ ### Features
209
+
210
+ * add garmin extension handling ([2e95798](https://github.com/tmcw/togeojson/commit/2e9579839bc294ad08cf83127e498bc27749eb81))
211
+
212
+ <a name="3.1.0"></a>
213
+ # [3.1.0](https://github.com/tmcw/togeojson/compare/v3.0.1...v3.1.0) (2019-12-25)
214
+
215
+
216
+ ### Features
217
+
218
+ * Add parsing of GPX extensions speed, course, hAcc, vAcc ([#18](https://github.com/tmcw/togeojson/issues/18)) ([99301bd](https://github.com/tmcw/togeojson/commit/99301bd))
219
+
220
+
221
+
222
+ <a name="3.0.1"></a>
223
+ ## [3.0.1](https://github.com/tmcw/togeojson/compare/v3.0.0...v3.0.1) (2019-06-17)
224
+
225
+
226
+ ### Bug Fixes
227
+
228
+ * Typo in rollup configuration ([1af08f6](https://github.com/tmcw/togeojson/commit/1af08f6))
229
+
230
+
231
+
232
+ <a name="3.0.0"></a>
233
+ # [3.0.0](https://github.com/tmcw/togeojson/compare/v2.0.0...v3.0.0) (2019-03-28)
234
+
235
+
236
+ ### Code Refactoring
237
+
238
+ * switch from initializeArray to Array.fill ([#11](https://github.com/tmcw/togeojson/issues/11)) ([dac617a](https://github.com/tmcw/togeojson/commit/dac617a)), closes [#10](https://github.com/tmcw/togeojson/issues/10)
239
+
240
+
241
+ ### BREAKING CHANGES
242
+
243
+ * this may modify browser support if you’re using
244
+ an old browser. See the MDN page for full details:
245
+
246
+ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill
247
+
248
+
249
+
250
+ <a name="2.0.0"></a>
251
+ # [2.0.0](https://github.com/tmcw/togeojson/compare/v1.0.0...v2.0.0) (2019-03-08)
252
+
253
+
254
+ ### Features
255
+
256
+ * Generator methods, removed CLI ([f37a30b](https://github.com/tmcw/togeojson/commit/f37a30b))
257
+
258
+
259
+ ### BREAKING CHANGES
260
+
261
+ * the cli that was previously installed along with togeojson has been removed, and will be installable as @tmcw/togeojson-cli
262
+
263
+ Other changes in this pass:
264
+
265
+ - Switch from microbundle to rollup to build
266
+ - Remove dependencies
267
+ - Remove reliance on XMLSerializer. This will make togeojson work in worker contexts.
268
+
269
+
270
+
271
+ <a name="1.0.0"></a>
272
+ # [1.0.0](https://github.com/tmcw/togeojson/compare/v1.0.0-alpha.1...v1.0.0) (2019-01-18)
273
+
274
+
275
+
276
+ <a name="1.0.0-alpha.1"></a>
277
+ # [1.0.0-alpha.1](https://github.com/tmcw/togeojson/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2019-01-18)
278
+
279
+
280
+
281
+ <a name="1.0.0-alpha.0"></a>
282
+ # [1.0.0-alpha.0](https://github.com/tmcw/togeojson/compare/v0.16.0...v1.0.0-alpha.0) (2019-01-18)
283
+
284
+
285
+
286
+ ## 0.16.0
287
+
288
+ * Supports the `link` tag in GPX data.
289
+ * Supports the `type` tag for waypoints in GPX data.
290
+
291
+ ## 0.15.0
292
+
293
+ * Supports the `cmt` (comment) tag in GPX data.
294
+
295
+ ## 0.14.2
296
+
297
+ * Fixes a potential crash with QGIS-generated GPX files.
298
+
299
+ ## 0.14.0
300
+
301
+ * Now includes TimeStamp property from Placemarks, if it exists.
302
+
303
+ ## 0.13.0
304
+
305
+ * Added support for StyleMap elements in Google-flavored KML
306
+ * Improved test coverage
307
+ * Made `#` prefix for internal style references optional
308
+ * Uses `eslint` for code style uniformity
309
+
310
+ ## 0.12.2
311
+
312
+ * Fix `#` prefix on exported hex colors
313
+
314
+ ## 0.12.1
315
+
316
+ * Fix trackpoints with elevation=0 having their elevation skipped
317
+
318
+ ## 0.12.0
319
+
320
+ * Fix rte based GPX based tracks
321
+ * Add CDATA support to KML
322
+
323
+ ## 0.11.0
324
+
325
+ * Add heartrate support for GPX tracks
326
+ * Fix elevation support
327
+ * Fix test runner
328
+
329
+ ## 0.10.1
330
+
331
+ * Fix an IE9 error: IE9 'supports' `XMLSerializer` inasmuch as it will create
332
+ an instance that fails always and hard.
333
+
334
+ ## 0.10.0
335
+
336
+ * Encode timestamps along lines in GPX and KML as a `coordTimes` property.
337
+
338
+ ## 0.9.0
339
+
340
+ * Encode KML id attributes on Placemarks as GeoJSON Feature id properties.
341
+
342
+ ## 0.8.0
343
+
344
+ * Support for the `gx:Track` and `gx:MultiTrack` extensions to GPX
345
+
346
+ ## 0.7.0
347
+
348
+ * GPX conversion creates MultiLineString geometries when given multiple track segments.
349
+
350
+ ## 0.6.0
351
+
352
+ * Support for [simplestyle spec](https://github.com/mapbox/simplestyle-spec) 1.1.0
353
+ * Tests in [tape](https://github.com/substack/tape) rather than mocha/expect.js
354
+
355
+ ## 0.5.0
356
+
357
+ * Elevation values along linestrings and in points for GPX are now parsed
358
+ correctly into `Z` coordinate values in GeoJSON.
359
+
360
+ ## 0.4.2
361
+
362
+ * No longer bundles xmldom for browsers
363
+
364
+ ## 0.3.1
365
+
366
+ * Stricter check for browser versus browserify when requiring `xmldom`
367
+
368
+ ## 0.3.0
369
+
370
+ * Support for pipes and streams
371
+
372
+ ```sh
373
+ echo "LineString(0 0, 10 10)" | wellknown | tokml | togeojson > map.geojson
374
+ ```
375
+
376
+ ## 0.2.0
377
+
378
+ * Improve documentation
379
+ * Make style hashing on by default, remove options object
380
+
381
+ ## 0.1.1
382
+
383
+ * Fix global leak.
384
+
385
+ ## 0.1.0
386
+
387
+ * Comments
388
+ * GPX Support
389
+
390
+ ## 0.0.1
391
+
392
+ * Support GeometryCollections as themselves.
package/README.md CHANGED
@@ -40,6 +40,18 @@ also encodes parts of KML, GPX, and TCX files that otherwise would be lost.
40
40
  This also emits the [geojson-coordinate-properties](https://github.com/mapbox/geojson-coordinate-properties) format
41
41
  to include time and other attributes that apply to each coordinate of a LineString.
42
42
 
43
+ ## Ground overlays
44
+
45
+ KML GroundOverlays are now supported, and transformed into Features
46
+ with Polygon geometries. They have two defined properties:
47
+
48
+ ```json
49
+ {
50
+ "@geometry-type": "groundoverlay",
51
+ "icon": "https://url.to.image…"
52
+ }
53
+ ```
54
+
43
55
  ## CLI
44
56
 
45
57
  Use [@tmcw/togeojson-cli](https://github.com/tmcw/togeojson-cli) to use this
@@ -100,8 +112,8 @@ import { kml } from "@tmcw/togeojson";
100
112
  - [x] [TimeSpan](https://developers.google.com/kml/documentation/kmlreference#timespan)
101
113
  - [x] [TimeStamp](https://developers.google.com/kml/documentation/kmlreference#timestamp)
102
114
  - [x] Folders (with kmlWithFolders)
115
+ - [x] GroundOverlays
103
116
  - [ ] NetworkLinks
104
- - [ ] GroundOverlays
105
117
 
106
118
  ### GPX Feature Support
107
119
 
@@ -146,15 +158,6 @@ step if desired.
146
158
  This module should support converting all KML and GPX features that have commonplace
147
159
  equivalents in GeoJSON.
148
160
 
149
- KML is a very complex format with many features. Some of these features, like NetworkLinks,
150
- folders, and GroundOverlays, don't have a GeoJSON equivalent. In these cases,
151
- toGeoJSON doesn't convert the features. It also doesn't crash on these constructs:
152
- toGeoJSON should be able to run on all valid KML and GPX files without crashing:
153
- but for some files it may have no output.
154
-
155
- We encourage other libraries to look into supporting these features, but
156
- support for them is out of scope for toGeoJSON.
157
-
158
161
  ## Protips:
159
162
 
160
163
  Have a string of XML and need an XML DOM? There are two main options:
package/dist/index.d.ts CHANGED
@@ -86,6 +86,23 @@ interface Root {
86
86
  * ]
87
87
  * }
88
88
  * ```
89
+ *
90
+ * ### GroundOverlay
91
+ *
92
+ * GroundOverlay elements are converted into
93
+ * `Feature` objects with `Polygon` geometries,
94
+ * a property like:
95
+ *
96
+ * ```json
97
+ * {
98
+ * "@geometry-type": "groundoverlay"
99
+ * }
100
+ * ```
101
+ *
102
+ * And the ground overlay's image URL in the `href`
103
+ * property. Ground overlays will need to be displayed
104
+ * with a separate method to other features, depending
105
+ * on which map framework you're using.
89
106
  */
90
107
  declare function kmlWithFolders(node: Document): Root;
91
108
  /**