@hebcal/geo-sqlite 4.9.3 → 4.10.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/dist/index.js +16 -3
- package/dist/index.mjs +16 -3
- package/package.json +15 -15
- package/zips-dummy.sql +1 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/geo-sqlite v4.
|
|
1
|
+
/*! @hebcal/geo-sqlite v4.10.1 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var Database = require('better-sqlite3');
|
|
@@ -30,6 +30,7 @@ const GEONAME_SQL = `SELECT
|
|
|
30
30
|
g.latitude as latitude,
|
|
31
31
|
g.longitude as longitude,
|
|
32
32
|
g.population as population,
|
|
33
|
+
g.gtopo30 as elevation,
|
|
33
34
|
g.timezone as timezone
|
|
34
35
|
FROM geoname g
|
|
35
36
|
LEFT JOIN country c on g.country = c.iso
|
|
@@ -46,14 +47,17 @@ const GEONAME_ALL_SQL = `SELECT
|
|
|
46
47
|
g.latitude as latitude,
|
|
47
48
|
g.longitude as longitude,
|
|
48
49
|
g.population as population,
|
|
50
|
+
g.gtopo30 as elevation,
|
|
49
51
|
g.timezone as timezone
|
|
50
52
|
FROM geoname g
|
|
51
53
|
LEFT JOIN country c on g.country = c.iso
|
|
52
54
|
LEFT JOIN admin1 a on g.country||'.'||g.admin1 = a.key
|
|
53
55
|
`;
|
|
54
|
-
const ZIPCODE_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,
|
|
56
|
+
const ZIPCODE_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,Elevation,
|
|
57
|
+
TimeZone,DayLightSaving,Population
|
|
55
58
|
FROM ZIPCodes_Primary WHERE ZipCode = ?`;
|
|
56
|
-
const ZIPCODE_ALL_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,
|
|
59
|
+
const ZIPCODE_ALL_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,Elevation,
|
|
60
|
+
TimeZone,DayLightSaving,Population
|
|
57
61
|
FROM ZIPCodes_Primary`;
|
|
58
62
|
const ZIP_COMPLETE_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,TimeZone,DayLightSaving,Population
|
|
59
63
|
FROM ZIPCodes_Primary
|
|
@@ -216,6 +220,9 @@ class GeoDb {
|
|
|
216
220
|
location.geo = 'zip';
|
|
217
221
|
location.zip = zip;
|
|
218
222
|
location.population = result.Population;
|
|
223
|
+
if (result.Elevation && result.Elevation > 0) {
|
|
224
|
+
location.elevation = result.Elevation;
|
|
225
|
+
}
|
|
219
226
|
return location;
|
|
220
227
|
}
|
|
221
228
|
|
|
@@ -299,6 +306,9 @@ class GeoDb {
|
|
|
299
306
|
if (result.population) {
|
|
300
307
|
location.population = result.population;
|
|
301
308
|
}
|
|
309
|
+
if (result.elevation && result.elevation > 0) {
|
|
310
|
+
location.elevation = result.elevation;
|
|
311
|
+
}
|
|
302
312
|
return location;
|
|
303
313
|
}
|
|
304
314
|
|
|
@@ -340,6 +350,9 @@ class GeoDb {
|
|
|
340
350
|
population: res.Population,
|
|
341
351
|
geo: 'zip'
|
|
342
352
|
};
|
|
353
|
+
if (res.Elevation && res.Elevation > 0) {
|
|
354
|
+
obj.elevation = res.Elevation;
|
|
355
|
+
}
|
|
343
356
|
return obj;
|
|
344
357
|
}
|
|
345
358
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/geo-sqlite v4.
|
|
1
|
+
/*! @hebcal/geo-sqlite v4.10.1 */
|
|
2
2
|
import Database from 'better-sqlite3';
|
|
3
3
|
import { Location, Locale } from '@hebcal/core';
|
|
4
4
|
import '@hebcal/cities';
|
|
@@ -28,6 +28,7 @@ const GEONAME_SQL = `SELECT
|
|
|
28
28
|
g.latitude as latitude,
|
|
29
29
|
g.longitude as longitude,
|
|
30
30
|
g.population as population,
|
|
31
|
+
g.gtopo30 as elevation,
|
|
31
32
|
g.timezone as timezone
|
|
32
33
|
FROM geoname g
|
|
33
34
|
LEFT JOIN country c on g.country = c.iso
|
|
@@ -44,14 +45,17 @@ const GEONAME_ALL_SQL = `SELECT
|
|
|
44
45
|
g.latitude as latitude,
|
|
45
46
|
g.longitude as longitude,
|
|
46
47
|
g.population as population,
|
|
48
|
+
g.gtopo30 as elevation,
|
|
47
49
|
g.timezone as timezone
|
|
48
50
|
FROM geoname g
|
|
49
51
|
LEFT JOIN country c on g.country = c.iso
|
|
50
52
|
LEFT JOIN admin1 a on g.country||'.'||g.admin1 = a.key
|
|
51
53
|
`;
|
|
52
|
-
const ZIPCODE_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,
|
|
54
|
+
const ZIPCODE_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,Elevation,
|
|
55
|
+
TimeZone,DayLightSaving,Population
|
|
53
56
|
FROM ZIPCodes_Primary WHERE ZipCode = ?`;
|
|
54
|
-
const ZIPCODE_ALL_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,
|
|
57
|
+
const ZIPCODE_ALL_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,Elevation,
|
|
58
|
+
TimeZone,DayLightSaving,Population
|
|
55
59
|
FROM ZIPCodes_Primary`;
|
|
56
60
|
const ZIP_COMPLETE_SQL = `SELECT ZipCode,CityMixedCase,State,Latitude,Longitude,TimeZone,DayLightSaving,Population
|
|
57
61
|
FROM ZIPCodes_Primary
|
|
@@ -214,6 +218,9 @@ class GeoDb {
|
|
|
214
218
|
location.geo = 'zip';
|
|
215
219
|
location.zip = zip;
|
|
216
220
|
location.population = result.Population;
|
|
221
|
+
if (result.Elevation && result.Elevation > 0) {
|
|
222
|
+
location.elevation = result.Elevation;
|
|
223
|
+
}
|
|
217
224
|
return location;
|
|
218
225
|
}
|
|
219
226
|
|
|
@@ -297,6 +304,9 @@ class GeoDb {
|
|
|
297
304
|
if (result.population) {
|
|
298
305
|
location.population = result.population;
|
|
299
306
|
}
|
|
307
|
+
if (result.elevation && result.elevation > 0) {
|
|
308
|
+
location.elevation = result.elevation;
|
|
309
|
+
}
|
|
300
310
|
return location;
|
|
301
311
|
}
|
|
302
312
|
|
|
@@ -338,6 +348,9 @@ class GeoDb {
|
|
|
338
348
|
population: res.Population,
|
|
339
349
|
geo: 'zip'
|
|
340
350
|
};
|
|
351
|
+
if (res.Elevation && res.Elevation > 0) {
|
|
352
|
+
obj.elevation = res.Elevation;
|
|
353
|
+
}
|
|
341
354
|
return obj;
|
|
342
355
|
}
|
|
343
356
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/geo-sqlite",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.1",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hebcal"
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"geo-sqlite.d.ts"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@hebcal/cities": "^3.2.
|
|
32
|
-
"@hebcal/core": "^4.
|
|
33
|
-
"better-sqlite3": "^
|
|
34
|
-
"pino": "^8.
|
|
35
|
-
"pino-pretty": "^10.2.
|
|
31
|
+
"@hebcal/cities": "^3.2.2",
|
|
32
|
+
"@hebcal/core": "^4.5.1",
|
|
33
|
+
"better-sqlite3": "^9.1.1",
|
|
34
|
+
"pino": "^8.16.2",
|
|
35
|
+
"pino-pretty": "^10.2.3",
|
|
36
36
|
"transliteration": "^2.3.5"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
},
|
|
47
47
|
"license": "BSD-2-Clause",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "^7.
|
|
50
|
-
"@babel/preset-env": "^7.
|
|
51
|
-
"@babel/register": "^7.22.
|
|
52
|
-
"@rollup/plugin-babel": "^6.0.
|
|
53
|
-
"@rollup/plugin-commonjs": "^25.0.
|
|
54
|
-
"@rollup/plugin-json": "^6.0.
|
|
55
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
49
|
+
"@babel/core": "^7.23.3",
|
|
50
|
+
"@babel/preset-env": "^7.23.3",
|
|
51
|
+
"@babel/register": "^7.22.15",
|
|
52
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
53
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
54
|
+
"@rollup/plugin-json": "^6.0.1",
|
|
55
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
56
56
|
"ava": "^5.3.1",
|
|
57
|
-
"eslint": "^8.
|
|
57
|
+
"eslint": "^8.54.0",
|
|
58
58
|
"eslint-config-google": "^0.14.0",
|
|
59
59
|
"jsdoc": "^4.0.2",
|
|
60
60
|
"jsdoc-to-markdown": "^8.0.0",
|
|
61
|
-
"rollup": "^
|
|
61
|
+
"rollup": "^4.5.0"
|
|
62
62
|
}
|
|
63
63
|
}
|