mapshaper 0.5.103 → 0.5.104

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 CHANGED
@@ -1,3 +1,6 @@
1
+ v0.5.104
2
+ * Improvements to the basemap feature.
3
+
1
4
  v0.5.103
2
5
  * Bug fixes
3
6
 
package/mapshaper.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function () {
2
2
 
3
- var VERSION = "0.5.103";
3
+ var VERSION = "0.5.104";
4
4
 
5
5
 
6
6
  var utils = /*#__PURE__*/Object.freeze({
@@ -1191,24 +1191,37 @@
1191
1191
 
1192
1192
  var LOGGING = false;
1193
1193
  var STDOUT = false; // use stdout for status messages
1194
-
1195
- // These three functions can be reset by GUI using setLoggingFunctions();
1196
- var _error = function() {
1197
- var msg = utils.toArray(arguments).join(' ');
1198
- throw new Error(msg);
1199
- };
1200
-
1201
- var _stop = function() {
1202
- throw new UserError(formatLogArgs(arguments));
1203
- };
1194
+ var _error, _stop, _message;
1204
1195
 
1205
1196
  var _interrupt = function() {
1206
1197
  throw new NonFatalError(formatLogArgs(arguments));
1207
1198
  };
1208
1199
 
1209
- var _message = function() {
1210
- logArgs(arguments);
1211
- };
1200
+ setLoggingForCLI();
1201
+
1202
+ function getLoggingSetter() {
1203
+ var e = _error, s = _stop, m = _message;
1204
+ return function() {
1205
+ setLoggingFunctions(m, e, s);
1206
+ };
1207
+ }
1208
+
1209
+ function setLoggingForCLI() {
1210
+ function stop() {
1211
+ throw new UserError(formatLogArgs(arguments));
1212
+ }
1213
+
1214
+ function error() {
1215
+ var msg = utils.toArray(arguments).join(' ');
1216
+ throw new Error(msg);
1217
+ }
1218
+
1219
+ function message() {
1220
+ logArgs(arguments);
1221
+ }
1222
+
1223
+ setLoggingFunctions(message, error, stop);
1224
+ }
1212
1225
 
1213
1226
  function enableLogging() {
1214
1227
  LOGGING = true;
@@ -1357,6 +1370,8 @@
1357
1370
 
1358
1371
  var Logging = /*#__PURE__*/Object.freeze({
1359
1372
  __proto__: null,
1373
+ getLoggingSetter: getLoggingSetter,
1374
+ setLoggingForCLI: setLoggingForCLI,
1360
1375
  enableLogging: enableLogging,
1361
1376
  loggingEnabled: loggingEnabled,
1362
1377
  error: error,
@@ -4782,7 +4797,7 @@
4782
4797
  var info = dataset.info || {},
4783
4798
  P = info.crs;
4784
4799
  if (!P && info.prj) {
4785
- P = parsePrj(info.prj);
4800
+ P = getCRS(translatePrj(info.prj));
4786
4801
  }
4787
4802
  if (!P && probablyDecimalDegreeBounds(getDatasetBounds(dataset))) {
4788
4803
  // use wgs84 for probable latlong datasets with unknown datums
@@ -34882,8 +34897,6 @@ ${svg}
34882
34897
  return table + sepLine;
34883
34898
  }
34884
34899
 
34885
-
34886
-
34887
34900
  function maxChars(arr) {
34888
34901
  return arr.reduce(function(memo, str) {
34889
34902
  var w = stringDisplayWidth(str);
@@ -34924,6 +34937,12 @@ ${svg}
34924
34937
  } else {
34925
34938
  str = String(val);
34926
34939
  }
34940
+
34941
+ if (typeof str != 'string') {
34942
+ // e.g. JSON.stringify converts functions to undefined
34943
+ str = '[' + (typeof val) + ']';
34944
+ }
34945
+
34927
34946
  return str;
34928
34947
  }
34929
34948
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapshaper",
3
- "version": "0.5.103",
3
+ "version": "0.5.104",
4
4
  "description": "A tool for editing vector datasets for mapping and GIS.",
5
5
  "keywords": [
6
6
  "shapefile",