mapshaper 0.6.105 → 0.6.107
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/README.md +8 -0
- package/mapshaper.js +9 -6
- package/package.json +4 -1
- package/www/elements.css +2 -1
- package/www/index.html +20 -14
- package/www/mapshaper-gui.js +510 -510
- package/www/mapshaper.js +9 -6
- package/www/page.css +15 -11
package/README.md
CHANGED
|
@@ -80,6 +80,14 @@ npm run build # bundle source code files
|
|
|
80
80
|
npm link # (optional) add global symlinks so scripts are available systemwide
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
## Using mapshaper with Bun
|
|
84
|
+
|
|
85
|
+
Mapshaper's command line tools can be run with [Bun](https://bun.sh/) as an alternative to Node.js. The simplest option is to use `bunx`, like this:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
bunx mapshaper [commands]
|
|
89
|
+
```
|
|
90
|
+
|
|
83
91
|
## Building and testing
|
|
84
92
|
|
|
85
93
|
From the project directory, run `npm run build` to build both the cli and web UI modules.
|
package/mapshaper.js
CHANGED
|
@@ -3927,7 +3927,10 @@
|
|
|
3927
3927
|
|
|
3928
3928
|
function getValueType(val) {
|
|
3929
3929
|
var type = null;
|
|
3930
|
-
if (
|
|
3930
|
+
if (val === null || val === undefined) {
|
|
3931
|
+
// optimization, when scanning columns containing mostly null values
|
|
3932
|
+
type = null;
|
|
3933
|
+
} else if (utils.isString(val)) {
|
|
3931
3934
|
type = 'string';
|
|
3932
3935
|
} else if (utils.isNumber(val)) {
|
|
3933
3936
|
type = 'number';
|
|
@@ -19290,7 +19293,7 @@
|
|
|
19290
19293
|
|
|
19291
19294
|
// symType: point, polygon, polyline, label
|
|
19292
19295
|
function applyStyleAttributes(svgObj, symType, rec, filter) {
|
|
19293
|
-
var fields =
|
|
19296
|
+
var fields = findStylePropertiesBySymbolGeom(Object.keys(rec || {}), symType);
|
|
19294
19297
|
for (var i=0, n=fields.length; i<n; i++) {
|
|
19295
19298
|
if (filter && !filter(fields[i])) continue;
|
|
19296
19299
|
setAttribute(svgObj, fields[i], rec[fields[i]]);
|
|
@@ -19318,7 +19321,7 @@
|
|
|
19318
19321
|
return name in symbolPropertyTypes;
|
|
19319
19322
|
}
|
|
19320
19323
|
|
|
19321
|
-
function
|
|
19324
|
+
function findStylePropertiesBySymbolGeom(fields, type) {
|
|
19322
19325
|
var index = propertiesBySymbolType[type] || {};
|
|
19323
19326
|
return fields.filter(function(name) {
|
|
19324
19327
|
return name in index;
|
|
@@ -19467,7 +19470,7 @@
|
|
|
19467
19470
|
var SvgProperties = /*#__PURE__*/Object.freeze({
|
|
19468
19471
|
__proto__: null,
|
|
19469
19472
|
applyStyleAttributes: applyStyleAttributes,
|
|
19470
|
-
|
|
19473
|
+
findStylePropertiesBySymbolGeom: findStylePropertiesBySymbolGeom,
|
|
19471
19474
|
getSymbolDataAccessor: getSymbolDataAccessor,
|
|
19472
19475
|
getSymbolPropertyAccessor: getSymbolPropertyAccessor,
|
|
19473
19476
|
isSupportedSvgStyleProperty: isSupportedSvgStyleProperty,
|
|
@@ -46041,7 +46044,7 @@ ${svg}
|
|
|
46041
46044
|
});
|
|
46042
46045
|
}
|
|
46043
46046
|
|
|
46044
|
-
var version = "0.6.
|
|
46047
|
+
var version = "0.6.107";
|
|
46045
46048
|
|
|
46046
46049
|
// Parse command line args into commands and run them
|
|
46047
46050
|
// Function takes an optional Node-style callback. A Promise is returned if no callback is given.
|
|
@@ -46095,7 +46098,7 @@ ${svg}
|
|
|
46095
46098
|
}
|
|
46096
46099
|
if (!loggingEnabled()) argv += ' -quiet'; // kludge to pass logging setting to subprocess
|
|
46097
46100
|
var mb = Math.round(gb * 1000);
|
|
46098
|
-
var command = [process.execPath
|
|
46101
|
+
var command = [`"${process.execPath}"`, '--max-old-space-size=' + mb, `"${mapshaperScript}"`, argv].join(' ');
|
|
46099
46102
|
var child = require$1('child_process').exec(command, {}, function(err, stdout, stderr) {
|
|
46100
46103
|
opts.callback(err);
|
|
46101
46104
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mapshaper",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.107",
|
|
4
4
|
"description": "A tool for editing vector datasets for mapping and GIS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shapefile",
|
|
@@ -94,5 +94,8 @@
|
|
|
94
94
|
"homepage": "https://github.com/mbloch/mapshaper#readme",
|
|
95
95
|
"directories": {
|
|
96
96
|
"test": "test"
|
|
97
|
+
},
|
|
98
|
+
"optionalDependencies": {
|
|
99
|
+
"@rollup/rollup-linux-x64-gnu": "^4.44.1"
|
|
97
100
|
}
|
|
98
101
|
}
|
package/www/elements.css
CHANGED
package/www/index.html
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<input type="text" value="label" class="clicktext" />
|
|
77
77
|
</div></div>
|
|
78
78
|
<div id="mode-buttons" class="page-header-buttons">
|
|
79
|
-
<span class="console-btn header-btn btn">Console</span><span class="
|
|
79
|
+
<span class="console-btn header-btn btn">Console</span><span class="display-btn header-btn btn">Display</span><span class="separator"></span><span class="separator"></span><span class="simplify-btn header-btn btn">Simplify</span><span class="separator"></span><span class="export-btn header-btn btn">Export</span>
|
|
80
80
|
</div>
|
|
81
81
|
<div id="splash-buttons" class="page-header-buttons">
|
|
82
82
|
<a href="https://github.com/mbloch/mapshaper/wiki"><span id="wiki-btn" class="header-btn btn">Wiki</span></a><span class="separator"></span><a href="https://github.com/mbloch/mapshaper"><span id="github-btn" class="header-btn btn">GitHub</span></a>
|
|
@@ -174,23 +174,30 @@ precision=0.001. Click to see all options.</div></div></div></a>
|
|
|
174
174
|
<div><span id="save-preference" style="display: none;"><input type="checkbox"/>choose output directory</span></div>
|
|
175
175
|
<div><span id="save-to-clipboard" style="display: inline-block;"><input type="checkbox"/>save to clipboard</span></div>
|
|
176
176
|
</div>
|
|
177
|
-
<div id="export-btn" class="btn dialog-btn" style="margin-top:
|
|
177
|
+
<div id="export-btn" class="btn dialog-btn" style="margin-top: 5px;">Export</div>
|
|
178
178
|
|
|
179
179
|
</div>
|
|
180
180
|
</div>
|
|
181
181
|
|
|
182
|
-
<div class="
|
|
182
|
+
<div class="display-options main-area popup-dialog">
|
|
183
183
|
<div class="info-box">
|
|
184
184
|
<div class="close2-btn"></div>
|
|
185
|
-
<h3>
|
|
186
|
-
|
|
187
|
-
<
|
|
188
|
-
<div class="
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
<
|
|
192
|
-
<
|
|
193
|
-
|
|
185
|
+
<h3>Display options</h3>
|
|
186
|
+
|
|
187
|
+
<div class=""><label for="intersections-opt"><input type="checkbox" id="intersections-opt" class="checkbox intersections-opt"/>detect line intersections</label></div>
|
|
188
|
+
<div class=""><label for="ghost-opt"><input type="checkbox" id="ghost-opt" class="checkbox ghost-opt"/>show reference lines</label></div>
|
|
189
|
+
|
|
190
|
+
<div class="basemap-opts">
|
|
191
|
+
<h4>Basemaps</h4>
|
|
192
|
+
<p class="basemap-warning"></p>
|
|
193
|
+
<div class="basemap-styles basemap-buttons"></div>
|
|
194
|
+
<p class="basemap-note"></p>
|
|
195
|
+
<div>
|
|
196
|
+
<!-- <div class="close-btn btn dialog-btn">Close</div> -->
|
|
197
|
+
<div class="clear-btn btn dialog-btn disabled">Clear</div>
|
|
198
|
+
<div class="fade-btn btn dialog-btn disabled">Fade</div>
|
|
199
|
+
<!-- <div class="hide-btn btn dialog-btn disabled">Hide</div> -->
|
|
200
|
+
</div>
|
|
194
201
|
</div>
|
|
195
202
|
</div>
|
|
196
203
|
</div>
|
|
@@ -295,8 +302,7 @@ encoding=big5</span>. Click to see all options.</div></div></div></div>
|
|
|
295
302
|
</div>
|
|
296
303
|
<div class="mshp-main-map main-area map-area">
|
|
297
304
|
<div class="intersection-display">
|
|
298
|
-
<span class="intersection-
|
|
299
|
-
<img class="close-btn" draggable="false" src="images/close.png">
|
|
305
|
+
<span class="intersection-count">0 line intersections</span>
|
|
300
306
|
<div class="repair-btn text-btn colored-text">Repair</div>
|
|
301
307
|
</div>
|
|
302
308
|
<div class="basemap-overlay-buttons basemap-buttons"></div>
|