@hebcal/geo-sqlite 4.0.0 → 4.0.1
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/bin/download-and-make-dbs +6 -1
- package/dist/index.js +10 -3
- package/dist/index.mjs +10 -3
- package/package.json +1 -1
|
@@ -9,9 +9,13 @@ curl -o $TMPDIR/countryInfo.txt http://download.geonames.org/export/dump/country
|
|
|
9
9
|
curl -o $TMPDIR/admin1CodesASCII.txt http://download.geonames.org/export/dump/admin1CodesASCII.txt
|
|
10
10
|
curl -o $TMPDIR/cities5000.zip http://download.geonames.org/export/dump/cities5000.zip
|
|
11
11
|
curl -o $TMPDIR/IL.zip http://download.geonames.org/export/dump/IL.zip
|
|
12
|
+
curl -o $TMPDIR/alt-IL.zip http://download.geonames.org/export/dump/alternatenames/IL.zip
|
|
12
13
|
|
|
13
14
|
cd $TMPDIR
|
|
14
15
|
unzip cities5000.zip
|
|
16
|
+
unzip alt-IL.zip
|
|
17
|
+
mv IL.txt alt-IL.txt
|
|
18
|
+
rm readme.txt
|
|
15
19
|
unzip IL.zip
|
|
16
20
|
|
|
17
21
|
cd $CURDIR
|
|
@@ -23,7 +27,8 @@ $CURDIR/node_modules/.bin/build-geonames-sqlite \
|
|
|
23
27
|
$TMPDIR/cities5000.txt \
|
|
24
28
|
"$CURDIR/node_modules/@hebcal/geo-sqlite/cities-patch.txt" \
|
|
25
29
|
$TMPDIR/admin1CodesASCII.txt \
|
|
26
|
-
$TMPDIR/IL.txt
|
|
30
|
+
$TMPDIR/IL.txt \
|
|
31
|
+
$TMPDIR/alt-IL.txt
|
|
27
32
|
|
|
28
33
|
rm -rf $TMPDIR
|
|
29
34
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/geo-sqlite v4.0.
|
|
1
|
+
/*! @hebcal/geo-sqlite v4.0.1 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -511,9 +511,16 @@ async function buildGeonamesSqlite(opts) {
|
|
|
511
511
|
gtopo30 int,
|
|
512
512
|
timezone nvarchar(40),
|
|
513
513
|
moddate date);`);
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
|
|
515
|
+
const truncateAlternateNames = a => {
|
|
516
|
+
a[3] = '';
|
|
517
|
+
return true;
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
await doFile(logger, db, cities5000txt, 'geoname', 19, truncateAlternateNames);
|
|
521
|
+
await doFile(logger, db, citiesPatch, 'geoname', 19, truncateAlternateNames);
|
|
516
522
|
await doFile(logger, db, ILtxt, 'geoname', 19, a => {
|
|
523
|
+
a[3] = '';
|
|
517
524
|
return a[6] == 'P' && (a[7] == 'PPL' || a[7] == 'STLMT');
|
|
518
525
|
});
|
|
519
526
|
doSql(logger, db, `DROP TABLE IF EXISTS admin1`, `CREATE TABLE admin1 (
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/geo-sqlite v4.0.
|
|
1
|
+
/*! @hebcal/geo-sqlite v4.0.1 */
|
|
2
2
|
import Database from 'better-sqlite3';
|
|
3
3
|
import { Location, Locale } from '@hebcal/core';
|
|
4
4
|
import '@hebcal/cities';
|
|
@@ -499,9 +499,16 @@ async function buildGeonamesSqlite(opts) {
|
|
|
499
499
|
gtopo30 int,
|
|
500
500
|
timezone nvarchar(40),
|
|
501
501
|
moddate date);`);
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
|
|
503
|
+
const truncateAlternateNames = a => {
|
|
504
|
+
a[3] = '';
|
|
505
|
+
return true;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
await doFile(logger, db, cities5000txt, 'geoname', 19, truncateAlternateNames);
|
|
509
|
+
await doFile(logger, db, citiesPatch, 'geoname', 19, truncateAlternateNames);
|
|
504
510
|
await doFile(logger, db, ILtxt, 'geoname', 19, a => {
|
|
511
|
+
a[3] = '';
|
|
505
512
|
return a[6] == 'P' && (a[7] == 'PPL' || a[7] == 'STLMT');
|
|
506
513
|
});
|
|
507
514
|
doSql(logger, db, `DROP TABLE IF EXISTS admin1`, `CREATE TABLE admin1 (
|