mapshaper 0.7.18 → 0.7.20
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/mapshaper.js +415 -51
- package/package.json +2 -2
- package/www/index.html +2 -2
- package/www/mapshaper-gui.js +146 -52
- package/www/mapshaper.js +415 -51
- package/www/modules.js +71 -0
- package/www/page.css +15 -8
- package/www/sponsor.html +3 -5
package/www/modules.js
CHANGED
|
@@ -19359,6 +19359,76 @@
|
|
|
19359
19359
|
return defn.trim();
|
|
19360
19360
|
}
|
|
19361
19361
|
|
|
19362
|
+
// Convert an initialized proj object to a stable Proj.4 string for comparing
|
|
19363
|
+
// coordinate transforms. This omits no-op/default params and canonicalizes
|
|
19364
|
+
// equivalent WGS84 ellipsoid definitions to +datum=WGS84.
|
|
19365
|
+
function get_normalized_proj_defn(P) {
|
|
19366
|
+
var parts = get_normalized_param_names(P).map(function(name) {
|
|
19367
|
+
return {name: name, param: get_param(P, name).trim()};
|
|
19368
|
+
});
|
|
19369
|
+
var geodParts = get_normalized_geod_params(P);
|
|
19370
|
+
var defn = '';
|
|
19371
|
+
var names;
|
|
19372
|
+
parts = parts.filter(function(part) { return part.param; });
|
|
19373
|
+
names = parts.map(function(part) { return part.name; });
|
|
19374
|
+
if (names.indexOf('proj') > -1) {
|
|
19375
|
+
defn += ' ' + parts.filter(function(part) { return part.name == 'proj'; })[0].param;
|
|
19376
|
+
parts = parts.filter(function(part) { return part.name != 'proj'; });
|
|
19377
|
+
}
|
|
19378
|
+
parts.sort(function(a, b) {
|
|
19379
|
+
return a.name < b.name ? -1 : a.name > b.name ? 1 : 0;
|
|
19380
|
+
}).forEach(function(part) {
|
|
19381
|
+
defn += ' ' + part.param;
|
|
19382
|
+
});
|
|
19383
|
+
geodParts.sort(function(a, b) {
|
|
19384
|
+
return a.name < b.name ? -1 : a.name > b.name ? 1 : 0;
|
|
19385
|
+
}).forEach(function(part) {
|
|
19386
|
+
defn += ' ' + part.param;
|
|
19387
|
+
});
|
|
19388
|
+
return defn.trim();
|
|
19389
|
+
}
|
|
19390
|
+
|
|
19391
|
+
function get_normalized_param_names(P) {
|
|
19392
|
+
var skip = 'datum,ellps,a,b,es,rf,f,towgs84,nadgrids,R,R_A,R_V,R_a,R_lat_a,R_lat_g,pm,init,no_defs'.split(',');
|
|
19393
|
+
return Object.keys(P.params).filter(function(name) {
|
|
19394
|
+
if (skip.indexOf(name) > -1) return false;
|
|
19395
|
+
if (P.params[name].used === false) return false;
|
|
19396
|
+
if (name == 'axis' && pj_param(P.params, 'saxis') == 'enu') return false;
|
|
19397
|
+
return true;
|
|
19398
|
+
});
|
|
19399
|
+
}
|
|
19400
|
+
|
|
19401
|
+
function get_normalized_geod_params(P) {
|
|
19402
|
+
if (uses_wgs84_datum(P)) {
|
|
19403
|
+
return [{name: 'datum', param: '+datum=WGS84'}];
|
|
19404
|
+
}
|
|
19405
|
+
return get_geod_defn(P).split(' ').filter(function(part) {
|
|
19406
|
+
return part && part != '+pm=0' && part != '+no_defs';
|
|
19407
|
+
}).map(function(part) {
|
|
19408
|
+
return {
|
|
19409
|
+
name: part.replace(/^\+([^=]+).*/, '$1'),
|
|
19410
|
+
param: part
|
|
19411
|
+
};
|
|
19412
|
+
});
|
|
19413
|
+
}
|
|
19414
|
+
|
|
19415
|
+
function uses_wgs84_datum(P) {
|
|
19416
|
+
if (pj_param(P.params, 'sdatum') == 'WGS84') return true;
|
|
19417
|
+
return has_no_datum_shift(P) && is_wgs84_ellipsoid(P);
|
|
19418
|
+
}
|
|
19419
|
+
|
|
19420
|
+
function has_no_datum_shift(P) {
|
|
19421
|
+
return (P.datum_params || []).every(function(val) { return val === 0; }) &&
|
|
19422
|
+
(P.gridlist_count || 0) === 0 &&
|
|
19423
|
+
(P.vgridlist_geoid_count || 0) === 0 &&
|
|
19424
|
+
!pj_param(P.params, 'snadgrids');
|
|
19425
|
+
}
|
|
19426
|
+
|
|
19427
|
+
function is_wgs84_ellipsoid(P) {
|
|
19428
|
+
return P.a_orig == 6378137 &&
|
|
19429
|
+
Math.abs(P.es_orig - 0.0066943799901413165) < 0.000000000050;
|
|
19430
|
+
}
|
|
19431
|
+
|
|
19362
19432
|
function get_param(P, name) {
|
|
19363
19433
|
var param = '';
|
|
19364
19434
|
if (name in P.params) {
|
|
@@ -33324,6 +33394,7 @@
|
|
|
33324
33394
|
get_rtodms: get_rtodms,
|
|
33325
33395
|
get_dtodms: get_dtodms,
|
|
33326
33396
|
get_proj_defn: get_proj_defn,
|
|
33397
|
+
get_normalized_proj_defn: get_normalized_proj_defn,
|
|
33327
33398
|
pj_latlong_from_proj: pj_latlong_from_proj,
|
|
33328
33399
|
pj_get_params: pj_get_params,
|
|
33329
33400
|
pj_datums: pj_datums,
|
package/www/page.css
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
--xlt-theme-col: #f4f8f9;
|
|
19
19
|
--accent-col: #ffa; /* yellow logo text */
|
|
20
20
|
--theme-col: #1385B7; /* blue header / btn col */
|
|
21
|
-
--dk-theme-col: #
|
|
21
|
+
--dk-theme-col: #196d8e; /* #1A6A96; btn hover col */
|
|
22
22
|
--lt-theme-col: #e6f7ff;
|
|
23
23
|
--colored-text: #10699b;
|
|
24
24
|
--normal-text: #333;
|
|
@@ -671,7 +671,7 @@ textarea:focus {
|
|
|
671
671
|
min-width: 230px;
|
|
672
672
|
word-wrap: break-word;
|
|
673
673
|
text-align: left;
|
|
674
|
-
margin-top:
|
|
674
|
+
margin-top: 16px;
|
|
675
675
|
padding: 14px 16px 13px 18px;
|
|
676
676
|
vertical-align: top;
|
|
677
677
|
display: inline-block;
|
|
@@ -874,7 +874,7 @@ body.sidebar-resizing .sidebar-resize-handle::before,
|
|
|
874
874
|
|
|
875
875
|
.sidebar-tabs {
|
|
876
876
|
position: absolute;
|
|
877
|
-
top:
|
|
877
|
+
top: 66px; /* below line intersection repair link */
|
|
878
878
|
left: 0;
|
|
879
879
|
z-index: 40;
|
|
880
880
|
pointer-events: auto;
|
|
@@ -882,6 +882,7 @@ body.sidebar-resizing .sidebar-resize-handle::before,
|
|
|
882
882
|
|
|
883
883
|
body.sidebar-open .sidebar-tabs {
|
|
884
884
|
left: var(--left-sidebar-width);
|
|
885
|
+
margin-left: -1.5px;
|
|
885
886
|
}
|
|
886
887
|
|
|
887
888
|
body.sidebar-tabs-over-popup .sidebar-tabs {
|
|
@@ -889,6 +890,8 @@ body.sidebar-tabs-over-popup .sidebar-tabs {
|
|
|
889
890
|
}
|
|
890
891
|
|
|
891
892
|
.sidebar-tab {
|
|
893
|
+
border: 1px solid rgba(255,255,255,0.8);
|
|
894
|
+
border-right: none; ;
|
|
892
895
|
writing-mode: vertical-rl;
|
|
893
896
|
transform: rotate(180deg);
|
|
894
897
|
background-color: var(--theme-col);
|
|
@@ -902,12 +905,17 @@ body.sidebar-tabs-over-popup .sidebar-tabs {
|
|
|
902
905
|
pointer-events: auto;
|
|
903
906
|
}
|
|
904
907
|
|
|
905
|
-
.sidebar-tab:hover
|
|
908
|
+
.sidebar-tab:hover {
|
|
909
|
+
background-color: var(--dk-theme-col);
|
|
910
|
+
}
|
|
911
|
+
|
|
906
912
|
body.layers-open .layer-tab,
|
|
907
913
|
body.console-open .console-tab {
|
|
908
|
-
background-color:
|
|
914
|
+
background-color: black;
|
|
909
915
|
}
|
|
910
916
|
|
|
917
|
+
|
|
918
|
+
|
|
911
919
|
.console-window {
|
|
912
920
|
pointer-events: auto;
|
|
913
921
|
background-color: black;
|
|
@@ -1109,7 +1117,6 @@ body.simplify .layer-control-btn {
|
|
|
1109
1117
|
.layer-control .info-box {
|
|
1110
1118
|
padding: 0;
|
|
1111
1119
|
pointer-events: none;
|
|
1112
|
-
background-color: transparent;
|
|
1113
1120
|
}
|
|
1114
1121
|
|
|
1115
1122
|
.layer-control div.info-box-scrolled {
|
|
@@ -2512,8 +2519,8 @@ body.dragging-color-picker * {
|
|
|
2512
2519
|
cursor: pointer;
|
|
2513
2520
|
}
|
|
2514
2521
|
|
|
2515
|
-
.label-style-selection-row .label-editing-clear:hover
|
|
2516
|
-
|
|
2522
|
+
.label-style-selection-row .label-editing-clear:hover,
|
|
2523
|
+
.repair-btn:hover {
|
|
2517
2524
|
text-decoration: underline;
|
|
2518
2525
|
}
|
|
2519
2526
|
|
package/www/sponsor.html
CHANGED
|
@@ -36,11 +36,9 @@
|
|
|
36
36
|
|
|
37
37
|
<h2>Recent work</h2>
|
|
38
38
|
<ul class="support-list">
|
|
39
|
-
<li><strong>
|
|
40
|
-
<li><strong>
|
|
41
|
-
<li><strong>
|
|
42
|
-
<li><strong>SVG import</strong> — for round-tripping maps originally exported from Mapshaper</li>
|
|
43
|
-
<li><strong>Performance improvements</strong> for large datasets</li>
|
|
39
|
+
<li><strong>Raster importing</strong> — GeoTIFF + georeferenced JPEG and PNG</li>
|
|
40
|
+
<li><strong>Undo/redo</strong> in the browser — the most requested feature</li>
|
|
41
|
+
<li><strong>New vector formats</strong> — GeoParquet, GeoPackage and FlatGeobuf</li>
|
|
44
42
|
<li><a href="docs/whats-new.html">Learn more</a></li>
|
|
45
43
|
</ul>
|
|
46
44
|
|