Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

node conversion wip, remove python deps and README info

zachtricefd01444a662c
diff --git a/.nvmrc b/.nvmrc
index 94f5f26dc..e65243f2e 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-16.18.0
+16.19.0
diff --git a/Dockerfile b/Dockerfile
index a076d7997..311720b47 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,24 +17,10 @@ RUN dnf install -y epel-release && \
libffi-devel \
openssl-devel \
xz
-RUN cd /usr/src && \
- wget https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tgz && \
- tar xzf Python-3.9.16.tgz && \
- rm Python-3.9.16.tgz && \
- cd Python-3.9.16 && \
- ./configure --enable-optimizations && \
- make altinstall && \
- ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3 && \
- python3 -V && \
- curl -O https://bootstrap.pypa.io/get-pip.py && \
- python3 get-pip.py && \
- python3 -m ensurepip && \
- pip install --upgrade pip && \
- pip --version
RUN mkdir -p /usr/local/nvm
ENV NVM_DIR=/usr/local/nvm
-ENV NODE_VERSION=18.14.0
-RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash && \
+ENV NODE_VERSION=16.19.0
+RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash && \
. "$NVM_DIR/nvm.sh" && \
nvm install v${NODE_VERSION} && \
nvm use v${NODE_VERSION} && \
@@ -53,9 +39,6 @@ RUN mkdir -p /build/node_modules && \
nightwatch
VOLUME /build/node_modules
-VOLUME /build/.python
EXPOSE 80
CMD tail -f /dev/null
-
-
diff --git a/Pipfile b/Pipfile
deleted file mode 100644
index 39bee2928..000000000
--- a/Pipfile
+++ /dev/null
@@ -1,18 +0,0 @@
-[[source]]
-url = "https://pypi.org/simple"
-verify_ssl = true
-name = "pypi"
-
-[packages]
-six = "==1.11.0"
-xmltodict = "==0.11.0"
-urllib3 = {version = "==1.26.5", extras = ["secure"]}
-requests = "==2.26.0"
-jsonschema = "==3.2.0"
-isodate2 = "==0.7.0"
-httpx = {extras = ["http2"], version = "*"}
-
-[dev-packages]
-
-[requires]
-python_version = "3"
diff --git a/Pipfile.lock b/Pipfile.lock
deleted file mode 100644
index 01aea049a..000000000
--- a/Pipfile.lock
+++ /dev/null
@@ -1,332 +0,0 @@
-{
- "_meta": {
- "hash": {
- "sha256": "ab3961359262db4272e848cb92cfe5c38b60a54e33f86843aec092d02d440714"
- },
- "pipfile-spec": 6,
- "requires": {
- "python_version": "3"
- },
- "sources": [
- {
- "name": "pypi",
- "url": "https://pypi.org/simple",
- "verify_ssl": true
- }
- ]
- },
- "default": {
- "anyio": {
- "hashes": [
- "sha256:25ea0d673ae30af41a0c442f81cf3b38c7e79fdc7b60335a4c14e05eb0947421",
- "sha256:fbbe32bd270d2a2ef3ed1c5d45041250284e31fc0a4df4a5a6071842051a51e3"
- ],
- "markers": "python_full_version >= '3.6.2'",
- "version": "==3.6.2"
- },
- "attrs": {
- "hashes": [
- "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836",
- "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"
- ],
- "markers": "python_version >= '3.6'",
- "version": "==22.2.0"
- },
- "certifi": {
- "hashes": [
- "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3",
- "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"
- ],
- "markers": "python_version >= '3.6'",
- "version": "==2022.12.7"
- },
- "cffi": {
- "hashes": [
- "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5",
- "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef",
- "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104",
- "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426",
- "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405",
- "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375",
- "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a",
- "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e",
- "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc",
- "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf",
- "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185",
- "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497",
- "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3",
- "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35",
- "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c",
- "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83",
- "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21",
- "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca",
- "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984",
- "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac",
- "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd",
- "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee",
- "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a",
- "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2",
- "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192",
- "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7",
- "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585",
- "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f",
- "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e",
- "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27",
- "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b",
- "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e",
- "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e",
- "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d",
- "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c",
- "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415",
- "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82",
- "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02",
- "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314",
- "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325",
- "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c",
- "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3",
- "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914",
- "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045",
- "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d",
- "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9",
- "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5",
- "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2",
- "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c",
- "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3",
- "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2",
- "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8",
- "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d",
- "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d",
- "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9",
- "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162",
- "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76",
- "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4",
- "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e",
- "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9",
- "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6",
- "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b",
- "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01",
- "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"
- ],
- "version": "==1.15.1"
- },
- "charset-normalizer": {
- "hashes": [
- "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597",
- "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"
- ],
- "markers": "python_version >= '3'",
- "version": "==2.0.12"
- },
- "cryptography": {
- "hashes": [
- "sha256:1a6915075c6d3a5e1215eab5d99bcec0da26036ff2102a1038401d6ef5bef25b",
- "sha256:1ee1fd0de9851ff32dbbb9362a4d833b579b4a6cc96883e8e6d2ff2a6bc7104f",
- "sha256:407cec680e811b4fc829de966f88a7c62a596faa250fc1a4b520a0355b9bc190",
- "sha256:50386acb40fbabbceeb2986332f0287f50f29ccf1497bae31cf5c3e7b4f4b34f",
- "sha256:6f97109336df5c178ee7c9c711b264c502b905c2d2a29ace99ed761533a3460f",
- "sha256:754978da4d0457e7ca176f58c57b1f9de6556591c19b25b8bcce3c77d314f5eb",
- "sha256:76c24dd4fd196a80f9f2f5405a778a8ca132f16b10af113474005635fe7e066c",
- "sha256:7dacfdeee048814563eaaec7c4743c8aea529fe3dd53127313a792f0dadc1773",
- "sha256:80ee674c08aaef194bc4627b7f2956e5ba7ef29c3cc3ca488cf15854838a8f72",
- "sha256:844ad4d7c3850081dffba91cdd91950038ee4ac525c575509a42d3fc806b83c8",
- "sha256:875aea1039d78557c7c6b4db2fe0e9d2413439f4676310a5f269dd342ca7a717",
- "sha256:887cbc1ea60786e534b00ba8b04d1095f4272d380ebd5f7a7eb4cc274710fad9",
- "sha256:ad04f413436b0781f20c52a661660f1e23bcd89a0e9bb1d6d20822d048cf2856",
- "sha256:bae6c7f4a36a25291b619ad064a30a07110a805d08dc89984f4f441f6c1f3f96",
- "sha256:c52a1a6f81e738d07f43dab57831c29e57d21c81a942f4602fac7ee21b27f288",
- "sha256:e0a05aee6a82d944f9b4edd6a001178787d1546ec7c6223ee9a848a7ade92e39",
- "sha256:e324de6972b151f99dc078defe8fb1b0a82c6498e37bff335f5bc6b1e3ab5a1e",
- "sha256:e5d71c5d5bd5b5c3eebcf7c5c2bb332d62ec68921a8c593bea8c394911a005ce",
- "sha256:f3ed2d864a2fa1666e749fe52fb8e23d8e06b8012e8bd8147c73797c506e86f1",
- "sha256:f671c1bb0d6088e94d61d80c606d65baacc0d374e67bf895148883461cd848de",
- "sha256:f6c0db08d81ead9576c4d94bbb27aed8d7a430fa27890f39084c2d0e2ec6b0df",
- "sha256:f964c7dcf7802d133e8dbd1565914fa0194f9d683d82411989889ecd701e8adf",
- "sha256:fec8b932f51ae245121c4671b4bbc030880f363354b2f0e0bd1366017d891458"
- ],
- "version": "==39.0.0"
- },
- "h11": {
- "hashes": [
- "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d",
- "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==0.14.0"
- },
- "h2": {
- "hashes": [
- "sha256:03a46bcf682256c95b5fd9e9a99c1323584c3eec6440d379b9903d709476bc6d",
- "sha256:a83aca08fbe7aacb79fec788c9c0bac936343560ed9ec18b82a13a12c28d2abb"
- ],
- "version": "==4.1.0"
- },
- "hpack": {
- "hashes": [
- "sha256:84a076fad3dc9a9f8063ccb8041ef100867b1878b25ef0ee63847a5d53818a6c",
- "sha256:fc41de0c63e687ebffde81187a948221294896f6bdc0ae2312708df339430095"
- ],
- "markers": "python_full_version >= '3.6.1'",
- "version": "==4.0.0"
- },
- "httpcore": {
- "hashes": [
- "sha256:c5d6f04e2fc530f39e0c077e6a30caa53f1451096120f1f38b954afd0b17c0cb",
- "sha256:da1fb708784a938aa084bde4feb8317056c55037247c787bd7e19eb2c2949dc0"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==0.16.3"
- },
- "httpx": {
- "extras": [
- "http2"
- ],
- "hashes": [
- "sha256:9818458eb565bb54898ccb9b8b251a28785dd4a55afbc23d0eb410754fe7d0f9",
- "sha256:a211fcce9b1254ea24f0cd6af9869b3d29aba40154e947d2a07bb499b3e310d6"
- ],
- "index": "pypi",
- "version": "==0.23.3"
- },
- "hyperframe": {
- "hashes": [
- "sha256:0ec6bafd80d8ad2195c4f03aacba3a8265e57bc4cff261e802bf39970ed02a15",
- "sha256:ae510046231dc8e9ecb1a6586f63d2347bf4c8905914aa84ba585ae85f28a914"
- ],
- "markers": "python_full_version >= '3.6.1'",
- "version": "==6.0.1"
- },
- "idna": {
- "hashes": [
- "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4",
- "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"
- ],
- "markers": "python_version >= '3'",
- "version": "==3.4"
- },
- "isodate2": {
- "hashes": [
- "sha256:2b688ef9a41605d7d8b2d6f48aa3bc87694a1cda771f82012e7df55c66302317",
- "sha256:841e685bde6436585233ea435bfcbc5741cea349aa1ac3a85bd481a95571797d"
- ],
- "index": "pypi",
- "version": "==0.7.0"
- },
- "jsonschema": {
- "hashes": [
- "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163",
- "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"
- ],
- "index": "pypi",
- "version": "==3.2.0"
- },
- "pycparser": {
- "hashes": [
- "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9",
- "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"
- ],
- "version": "==2.21"
- },
- "pyopenssl": {
- "hashes": [
- "sha256:c1cc5f86bcacefc84dada7d31175cae1b1518d5f60d3d0bb595a67822a868a6f",
- "sha256:df5fc28af899e74e19fccb5510df423581047e10ab6f1f4ba1763ff5fde844c0"
- ],
- "version": "==23.0.0"
- },
- "pyrsistent": {
- "hashes": [
- "sha256:016ad1afadf318eb7911baa24b049909f7f3bb2c5b1ed7b6a8f21db21ea3faa8",
- "sha256:1a2994773706bbb4995c31a97bc94f1418314923bd1048c6d964837040376440",
- "sha256:20460ac0ea439a3e79caa1dbd560344b64ed75e85d8703943e0b66c2a6150e4a",
- "sha256:3311cb4237a341aa52ab8448c27e3a9931e2ee09561ad150ba94e4cfd3fc888c",
- "sha256:3a8cb235fa6d3fd7aae6a4f1429bbb1fec1577d978098da1252f0489937786f3",
- "sha256:3ab2204234c0ecd8b9368dbd6a53e83c3d4f3cab10ecaf6d0e772f456c442393",
- "sha256:42ac0b2f44607eb92ae88609eda931a4f0dfa03038c44c772e07f43e738bcac9",
- "sha256:49c32f216c17148695ca0e02a5c521e28a4ee6c5089f97e34fe24163113722da",
- "sha256:4b774f9288dda8d425adb6544e5903f1fb6c273ab3128a355c6b972b7df39dcf",
- "sha256:4c18264cb84b5e68e7085a43723f9e4c1fd1d935ab240ce02c0324a8e01ccb64",
- "sha256:5a474fb80f5e0d6c9394d8db0fc19e90fa540b82ee52dba7d246a7791712f74a",
- "sha256:64220c429e42a7150f4bfd280f6f4bb2850f95956bde93c6fda1b70507af6ef3",
- "sha256:878433581fc23e906d947a6814336eee031a00e6defba224234169ae3d3d6a98",
- "sha256:99abb85579e2165bd8522f0c0138864da97847875ecbd45f3e7e2af569bfc6f2",
- "sha256:a2471f3f8693101975b1ff85ffd19bb7ca7dd7c38f8a81701f67d6b4f97b87d8",
- "sha256:aeda827381f5e5d65cced3024126529ddc4289d944f75e090572c77ceb19adbf",
- "sha256:b735e538f74ec31378f5a1e3886a26d2ca6351106b4dfde376a26fc32a044edc",
- "sha256:c147257a92374fde8498491f53ffa8f4822cd70c0d85037e09028e478cababb7",
- "sha256:c4db1bd596fefd66b296a3d5d943c94f4fac5bcd13e99bffe2ba6a759d959a28",
- "sha256:c74bed51f9b41c48366a286395c67f4e894374306b197e62810e0fdaf2364da2",
- "sha256:c9bb60a40a0ab9aba40a59f68214eed5a29c6274c83b2cc206a359c4a89fa41b",
- "sha256:cc5d149f31706762c1f8bda2e8c4f8fead6e80312e3692619a75301d3dbb819a",
- "sha256:ccf0d6bd208f8111179f0c26fdf84ed7c3891982f2edaeae7422575f47e66b64",
- "sha256:e42296a09e83028b3476f7073fcb69ffebac0e66dbbfd1bd847d61f74db30f19",
- "sha256:e8f2b814a3dc6225964fa03d8582c6e0b6650d68a232df41e3cc1b66a5d2f8d1",
- "sha256:f0774bf48631f3a20471dd7c5989657b639fd2d285b861237ea9e82c36a415a9",
- "sha256:f0e7c4b2f77593871e918be000b96c8107da48444d57005b6a6bc61fb4331b2c"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==0.19.3"
- },
- "requests": {
- "hashes": [
- "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24",
- "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7"
- ],
- "index": "pypi",
- "version": "==2.26.0"
- },
- "rfc3986": {
- "extras": [
- "idna2008"
- ],
- "hashes": [
- "sha256:270aaf10d87d0d4e095063c65bf3ddbc6ee3d0b226328ce21e036f946e421835",
- "sha256:a86d6e1f5b1dc238b218b012df0aa79409667bb209e58da56d0b94704e712a97"
- ],
- "version": "==1.5.0"
- },
- "setuptools": {
- "hashes": [
- "sha256:57f6f22bde4e042978bcd50176fdb381d7c21a9efa4041202288d3737a0c6a54",
- "sha256:a7620757bf984b58deaf32fc8a4577a9bbc0850cf92c20e1ce41c38c19e5fb75"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==65.6.3"
- },
- "six": {
- "hashes": [
- "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
- "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
- ],
- "index": "pypi",
- "version": "==1.11.0"
- },
- "sniffio": {
- "hashes": [
- "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101",
- "sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==1.3.0"
- },
- "urllib3": {
- "extras": [
- "secure"
- ],
- "hashes": [
- "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c",
- "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098"
- ],
- "index": "pypi",
- "version": "==1.26.5"
- },
- "xmltodict": {
- "hashes": [
- "sha256:8f8d7d40aa28d83f4109a7e8aa86e67a4df202d9538be40c0cb1d70da527b0df",
- "sha256:add07d92089ff611badec526912747cf87afd4f9447af6661aca074eeaf32615"
- ],
- "index": "pypi",
- "version": "==0.11.0"
- }
- },
- "develop": {}
-}
diff --git a/README.md b/README.md
index 2d19c73a3..037ef0cb6 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ to find out the latest features and imagery available.
## Install
-This project uses Node and Python. See the [dependencies](#dependencies) section for more information.
+This project uses Node.JS. See the [dependencies](#dependencies) section for more information.
```bash
git clone https://github.com/nasa-gibs/worldview.git
@@ -47,17 +47,11 @@ The following are required to install and run Worldview:
- [Node LTS](https://nodejs.org/en/download/)
- **Note:** Ubuntu users may run into issues with the `node` command not being available. See [this question on StackOverflow](https://stackoverflow.com/q/18130164/417629) for possible solutions.
-- [Python v3.7.1 or Later](https://www.python.org/)
-
- - **Note:** It is recommended that Windows users install Python with [Windows Build Tools](https://www.npmjs.com/package/windows-build-tools).
- - macOS users should use homebrew to install **Python v3**
- - `brew install python`
Windows users will also need the following:
-- [Git Bash](https://git-scm.com/downloads), or [MinGW-w64](https://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/)
-- [.NET Framework](https://www.microsoft.com/net/download/dotnet-framework-runtime) or [Visual Studio Team Services](https://www.visualstudio.com/)
-- [Add `python` to the path](https://docs.python.org/3/using/windows.html#installation-steps)
+- [Git Bash](https://git-scm.com/downloads)
+
## Usage
diff --git a/doc/developing.md b/doc/developing.md
index c51c4d851..30606e838 100644
--- a/doc/developing.md
+++ b/doc/developing.md
@@ -3,7 +3,7 @@
## Building
-This project uses `npm` to run build scripts and other tasks. The scripts are a combination of JavaScript, Bash, and Python scripts. Webpack is used as a module bundler.
+This project uses `npm` to run build scripts and other tasks. The scripts are a combination of Node.JS and Bash scripts. Webpack is used as a module bundler.
**`npm run build`**: Main build script cleans previous build directory, gets available imagery metadata via the [GIBS `GetCapabilities` API](https://nasa-gibs.github.io/gibs-api-docs/), adds the build configuration (options), and builds the Webpack bundle in Development mode. Generates the build in `build/`. If you have a custom configuration subdirectory, pass it to the command with `npm run build -- subdirectory_name`.
diff --git a/package-lock.json b/package-lock.json
index e3b958326..c969603ec 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -142,6 +142,7 @@
"webpack-dev-middleware": "^5.3.3",
"webpack-dev-server": "^4.11.1",
"xml-js": "^1.6.11",
+ "xml2js": "^0.4.23",
"yargs": "^17.6.2"
},
"engines": {
@@ -23195,6 +23196,28 @@
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.3.0.tgz",
"integrity": "sha512-i4PIrX33Wd66dvwo4syicwlwmnr6wuvvn4f2ku9hA67C2Uk62Xubczuhct+Evnd12/DV71qKNeDdJwES8HX1RA=="
},
+ "node_modules/xml2js": {
+ "version": "0.4.23",
+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
+ "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
+ "dev": true,
+ "dependencies": {
+ "sax": ">=0.6.0",
+ "xmlbuilder": "~11.0.0"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/xmlbuilder": {
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
+ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
"node_modules/xmlchars": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
@@ -40908,6 +40931,22 @@
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.3.0.tgz",
"integrity": "sha512-i4PIrX33Wd66dvwo4syicwlwmnr6wuvvn4f2ku9hA67C2Uk62Xubczuhct+Evnd12/DV71qKNeDdJwES8HX1RA=="
},
+ "xml2js": {
+ "version": "0.4.23",
+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
+ "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
+ "dev": true,
+ "requires": {
+ "sax": ">=0.6.0",
+ "xmlbuilder": "~11.0.0"
+ }
+ },
+ "xmlbuilder": {
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
+ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
+ "dev": true
+ },
"xmlchars": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
diff --git a/package.json b/package.json
index ca068a47f..3117bbeeb 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"license": "NASA-1.3",
"repository": "nasa-gibs/worldview",
"engines": {
- "node": ">= 16.18.0"
+ "node": ">= 16"
},
"husky": {
"hooks": {
@@ -59,16 +59,13 @@
"e2e:headless:firefox": "npx nightwatch -e firefoxHeadless --skiptags skipLocalStorageEnabled --suiteRetries 2",
"e2e:headless:firefox:localStorageDisabled": "npx nightwatch -e firefoxLocalStorageDisabled --tag localStorageDisabled",
"getcapabilities": "bash -c 'FETCH_GC=1 npm run build:options'",
- "generatePreviews": "python3 tasks/python3/fetchPreviewSnapshots.py",
+ "generatePreviews": "node ./tasks/node/fetchPreviewSnapshots.py",
"linkcheck": "node ./tasks/link-check",
"lint": "run-s lint:js lint:scss",
"lint:scss": "npx stylelint ./web/scss/**/*.scss",
"lint:js": "npx eslint . --quiet",
"preinstall": "node tasks/util/checkNodeVersion.js",
- "postinstall": "patch-package && npm run python",
- "python": "run-script-os",
- "python:darwin:linux": "bash -c 'tasks/pythonInstall.sh linux'",
- "python:win32": "bash -c 'tasks/pythonInstall.sh'",
+ "postinstall": "patch-package",
"start": "node ./tasks/util/start.js",
"test": "run-script-os",
"test:coverage": "run-script-os",
@@ -156,6 +153,7 @@
"webpack-dev-middleware": "^5.3.3",
"webpack-dev-server": "^4.11.1",
"xml-js": "^1.6.11",
+ "xml2js": "^0.4.23",
"yargs": "^17.6.2"
},
"dependencies": {
diff --git a/tasks/node/extractConfigFromWMTS.js b/tasks/build/extractConfigFromWMTS.js
old mode 100755
new mode 100644
similarity index 81%
rename from tasks/node/extractConfigFromWMTS.js
rename to tasks/build/extractConfigFromWMTS.js
index 52f4001f8..0eb003fb5
--- a/tasks/node/extractConfigFromWMTS.js
+++ b/tasks/build/extractConfigFromWMTS.js
@@ -2,6 +2,7 @@ const fs = require('fs')
const path = require('path')
const yargs = require('yargs')
const console = require('console')
+const convert = require('xml-js')
const processTemporalLayer = require('./processTemporalLayer')
const prog = path.basename(__filename)
@@ -64,15 +65,16 @@ class SkipException extends Error {
async function main () {
for (entry of entries) {
// const { errorCount, warningCount, layerCount } = processEntry(entry)
- processEntry(entry)
+ await processEntry(entry)
}
console.warn(`
${prog}:
- ${totalErrorCount.length} errors,
- ${totalWarningCount.length} warnings,
- ${totalLayerCount.length} layers
+ ${totalErrorCount} errors,
+ ${totalWarningCount} warnings,
+ ${totalLayerCount} layers
`)
+
if (totalErrorCount > 0) {
throw new Error(`${prog}: Error: ${totalErrorCount.length} errors occured`)
}
@@ -146,15 +148,15 @@ function processLayer (gcLayer, wvLayers, entry) {
// Vector data links
if ((Object.prototype.hasOwnProperty.call(gcLayer, 'ows:Metadata') && gcLayer['ows:Metadata'] !== null)) {
for (const item of gcLayer['ows:Metadata']) {
- if (!Object.prototype.hasOwnProperty.call(item, '@xlink:role')) {
+ if (!(['xlink:role'] in item._attributes)) {
throw new Error('No xlink:role')
}
- const schemaVersion = item['@xlink:role']
+ const schemaVersion = item._attributes['xlink:role']
if (schemaVersion === 'http://earthdata.nasa.gov/gibs/metadata-type/layer/1.0') {
- const vectorDataLink = item['@xlink:href']
+ const vectorDataLink = item._attributes['xlink:href']
const vectorDataFile = path.basename(vectorDataLink)
- const vectorDataId = path.splitext(vectorDataFile)[0]
+ const vectorDataId = path.parse(vectorDataFile).name
wvLayer.vectorData = {
id: vectorDataId
}
@@ -168,22 +170,22 @@ function processLayer (gcLayer, wvLayers, entry) {
totalWarningCount++
} else {
for (const item of gcLayer['ows:Metadata']) {
- if (!('@xlink:role' in item)) {
+ if (!(['xlink:role'] in item._attributes)) {
throw new Error('No xlink:role')
}
- const schemaVersion = item['@xlink:role']
+ const schemaVersion = item._attributes['xlink:role']
if (schemaVersion === 'http://earthdata.nasa.gov/gibs/metadata-type/colormap/1.3') {
- const colormapLink = item['@xlink:href']
+ const colormapLink = item._attributes['xlink:href']
const colormapFile = path.basename(colormapLink)
- const colormapId = path.splitext(colormapFile)[0]
+ const colormapId = path.parse(colormapFile).name
wvLayer.palette = {
id: colormapId
}
} else if (schemaVersion === 'http://earthdata.nasa.gov/gibs/metadata-type/mapbox-gl-style/1.0') {
- const vectorstyleLink = item['@xlink:href']
+ const vectorstyleLink = item._attributes['xlink:href']
const vectorstyleFile = path.basename(vectorstyleLink)
- const vectorstyleId = path.splitext(vectorstyleFile)[0]
+ const vectorstyleId = path.parse(vectorstyleFile).name
wvLayer.vectorStyle = {
id: vectorstyleId
}
@@ -211,10 +213,10 @@ async function processEntry (entry) {
let gc
try {
const xml = await fs.promises.readFile(inputFile, 'utf8')
- gc = xmltodict.parse(xml)
+ gc = JSON.parse(convert.xml2json(xml, { compact: true, spaces: 2 }))
} catch (e) {
if (tolerant) {
- process.stderr.write(`${prog}: WARN: [${inputFile}] Unable to get GC: ${e}\n`)
+ process.stderr.write(`${prog}: WARN: [${inputFile}] Unable to get GC: ${e}\n`)
warningCount += 1
} else {
process.stderr.write(`${prog}: ERROR: [${inputFile}] Unable to get GC: ${e}\n`)
@@ -232,41 +234,39 @@ async function processEntry (entry) {
return [errorCount, warningCount, layerCount]
}
- if (typeof gc.Capabilities.Contents.Layer === 'object') {
- const gcLayer = gc.Capabilities.Contents.Layer
- const ident = gcLayer['ows:Identifier']
+ // if (typeof gc.Capabilities.Contents.Layer === 'object') {
+ // const gcLayer = gc.Capabilities.Contents.Layer
+ // const ident = gcLayer['ows:Identifier']
+ // try {
+ // layerCount += 1
+ // processLayer(gcLayer, wvLayers, entry)
+ // } catch (error) {
+ // if (error instanceof SkipException) {
+ // warningCount += 1
+ // process.stderr.write(`${prog}: WARNING: [${ident}] Skipping\n`)
+ // } else {
+ // errorCount += 1
+ // console.error(error.stack)
+ // process.stderr.write(`${prog}: ERROR: [${gcId}:${ident}] ${e}\n`)
+ // }
+ // }
+ // } else {
+ for (const gcLayer of gcContents.Layer) {
try {
layerCount += 1
processLayer(gcLayer, wvLayers, entry)
} catch (error) {
if (error instanceof SkipException) {
warningCount += 1
- process.stderr.write(`${prog}: WARNING: [${ident}] Skipping\n`)
+ process.stderr.write(`${prog}: WARNING: [${id}] Skipping\n`)
} else {
errorCount += 1
- console.error(e.stack)
+ console.error(error.stack)
process.stderr.write(`${prog}: ERROR: [${gcId}:${ident}] ${e}\n`)
}
}
- } else {
- for (const gcLayer of gcContents.Layer) {
- // const ident = gcLayer['ows:Identifier']
- try {
- layerCount += 1
- processLayer(gcLayer, wvLayers, entry)
- } catch (error) {
- if (se instanceof SkipException) {
- warningCount += 1
- process.stderr.write(`${prog}: WARNING: [${id}] Skipping\n`)
- } else {
- errorCount += 1
- console.error(e.stack)
- }
- }
- }
}
-
- processMatrixSet(gcMatrixSet)
+ // }
if (typeof gcContents.TileMatrixSet === 'object') {
processMatrixSet(gcContents.TileMatrixSet)
diff --git a/tasks/node/generateCategoryGroupOrder.js b/tasks/build/generateCategoryGroupOrder.js
similarity index 100%
rename from tasks/node/generateCategoryGroupOrder.js
rename to tasks/build/generateCategoryGroupOrder.js
diff --git a/tasks/node/getCapabilities.js b/tasks/build/getCapabilities.js
old mode 100755
new mode 100644
similarity index 97%
rename from tasks/node/getCapabilities.js
rename to tasks/build/getCapabilities.js
index 494163e32..e23c81244
--- a/tasks/node/getCapabilities.js
+++ b/tasks/build/getCapabilities.js
@@ -130,9 +130,8 @@ async function processLayer (layer) {
}
async function processGetCapabilities (outputFile) {
- const gcXML = fs.readFileSync(outputFile, { encoding: 'utf-8' })
- let gc = convert.xml2json(gcXML, { compact: true, spaces: 2 })
- gc = JSON.parse(gc)
+ const xml = fs.readFileSync(outputFile, { encoding: 'utf-8' })
+ const gc = JSON.parse(convert.xml2json(xml, { compact: true, spaces: 2 }))
try {
if (!gc.Capabilities || !gc.Capabilities.Contents) {
diff --git a/tasks/node/getVisMetadata.js b/tasks/build/getVisMetadata.js
old mode 100755
new mode 100644
similarity index 100%
rename from tasks/node/getVisMetadata.js
rename to tasks/build/getVisMetadata.js
diff --git a/tasks/build/mergeConfigWithWMTS.js b/tasks/build/mergeConfigWithWMTS.js
new file mode 100644
index 000000000..e69de29bb
diff --git a/tasks/build/processColormap.js b/tasks/build/processColormap.js
new file mode 100644
index 000000000..91bf86bab
--- /dev/null
+++ b/tasks/build/processColormap.js
@@ -0,0 +1,251 @@
+const fs = require('fs')
+const path = require('path')
+const convert = require('xml-js')
+const { promisify } = require('util')
+const yargs = require('yargs')
+
+const readdir = promisify(fs.readdir)
+const readFile = promisify(fs.readFile)
+const writeFile = promisify(fs.writeFile)
+
+const prog = path.basename(__filename)
+
+const options = yargs
+ .usage('Usage: $0 [config] [inputDir] [outputDir]')
+ .option('config', {
+ demandOption: true,
+ alias: 'c',
+ type: 'string',
+ description: 'config file'
+ })
+ .option('inputDir', {
+ demandOption: true,
+ alias: 'i',
+ type: 'string',
+ description: 'getcapabilities input directory'
+ })
+ .option('outputDir', {
+ demandOption: true,
+ alias: 'o',
+ type: 'string',
+ description: 'wmts output directory'
+ })
+ .epilog('Converts colormaps to JSON files')
+
+const { argv } = options
+if (!argv.config && !argv.inputDir && !argv.outputDir) {
+ throw new Error('Invalid number of arguments')
+}
+
+const config = argv.config
+const inputDir = argv.inputDir
+const outputDir = argv.outputDir
+
+const skips = config.skipPalettes || []
+
+function toList (v) {
+ return Array.isArray(v) ? v : [v]
+}
+
+function matchLegend (entry, legends) {
+ try {
+ let matched = 'false'
+ for (const legend of legends) {
+ if (!legend['@id']) {
+ throw new Error('No legend IDs')
+ }
+ if (legend['@id'] === entry['@ref']) {
+ matched = legend
+ }
+ }
+ return matched
+ } catch (e) {
+ throw new Error(`Invalid reference: ${entry['@ref']}`)
+ }
+}
+
+function processEntries (colormap) {
+ const entries = toList(colormap.Entries.ColorMapEntry)
+
+ let transparentMap = 'true'
+
+ for (const entry of entries) {
+ if (entry['@transparent'] === 'false') {
+ transparentMap = 'false'
+ }
+ }
+ if (transparentMap === 'true') {
+ return 'transparent'
+ }
+
+ if (!colormap.Legend) {
+ throw new Error('No Legend')
+ }
+ const mapType = colormap.Legend['@type']
+ const legends = toList(colormap.Legend.LegendEntry)
+ const colors = []
+ const values = []
+ const ticks = []
+ const tooltips = []
+ const legendColors = []
+ const refsList = []
+ const refSkipList = []
+ const colorFormat = '{0:02x}{1:02x}{2:02x}{3:02x}'
+ for (let index = 0; index < entries.length; index += 1) {
+ const entry = entries[index]
+ const legend = matchLegend(entry, legends)
+ if (legend === 'false') {
+ refSkipList.push(entry['@ref'])
+ continue
+ }
+ const [r, g, b] = entry['@rgb'].split(',')
+ let a = 0
+ if (entry.get('@transparent', 'false') === 'true') {
+ a = 255
+ }
+ if (a === 0) {
+ refSkipList.push(entry['@ref'])
+ continue
+ }
+ if (!entry['@ref']) {
+ throw new Error('No ref in legend')
+ }
+ refsList.push(entry['@ref'])
+ colors.push(colorFormat.format(parseInt(r, 10), parseInt(g, 10), parseInt(b, 10), a))
+ if (mapType === 'continuous' || mapType === 'discrete') {
+ const items = entry['@value'].replace(/[()[\]]/g, '').split(',')
+ try {
+ const newItems = []
+ for (const item of items) {
+ let v = parseFloat(item)
+ if (v === Number.POSITIVE_INFINITY) {
+ v = Number.MAX_VALUE
+ }
+ if (v === Number.NEGATIVE_INFINITY) {
+ v = Number.MIN_VALUE
+ }
+ newItems.push(v)
+ }
+ } catch (error) {
+ throw new Error(`Invalid value: ${entry['@value']}`)
+ }
+
+ let skipIndex = 0
+ const idList = []
+ for (const [index, entry] of legends.entries()) {
+ if (refSkipList.includes(entry['@id'])) {
+ skipIndex += 1
+ continue
+ }
+ const [r, g, b] = entry['@rgb'].split(',')
+ legendColors.push(colorFormat.format(parseInt(r, 10), parseInt(g, 10), parseInt(b, 10), 255))
+ if (!entry['@tooltip']) {
+ throw new Error('No tooltips in legend')
+ }
+ tooltips.push(entry['@tooltip'])
+ if (!entry['@id']) {
+ throw new Error('No id in legend')
+ }
+ idList.push(entry['@id'])
+ if (entry['@showTick']) {
+ ticks.push(index - skipIndex)
+ }
+ }
+
+ const result = {
+ type: mapType,
+ entries: {
+ type: mapType,
+ colors,
+ refs: refsList
+ },
+ legend: {
+ colors: legendColors,
+ type: mapType,
+ tooltips,
+ ticks,
+ refs: idList
+ }
+ }
+ if (mapType === 'continuous' || mapType === 'discrete') {
+ result.entries.values = values
+ }
+
+ return result
+ }
+ }
+}
+
+async function readFileAsync (file) {
+ const id = path.basename(file, path.extname(file))
+ if (skips.includes(id)) {
+ console.error(`${prog}: WARN: [${file}] Skipping`)
+ return
+ }
+ const xml = await readFile(file, { encoding: 'utf-8' })
+ return { id, xml }
+}
+
+async function processFile (id, xml) {
+ const document = JSON.parse(convert.xml2json(xml, { compact: true, spaces: 2 }))
+
+ const colormaps = toList(document.ColorMaps.ColorMap)
+ const maps = []
+ for (const colormap of colormaps) {
+ const result = processEntries(colormap)
+ if (result === 'transparent') {
+ continue
+ }
+ result.title = colormap['@title']
+ result.entries.title = colormap['@title']
+ result.legend.title = colormap['@title']
+ result.legend.id = `${id}_${maps.length}_legend`
+ if ('@minLabel' in colormap.Legend) {
+ result.legend.minLabel = colormap.Legend['@minLabel']
+ }
+ if ('@maxLabel' in colormap.Legend) {
+ result.legend.maxLabel = colormap.Legend['@maxLabel']
+ }
+ if ('@units' in colormap) {
+ result.legend.units = colormap['@units']
+ }
+ maps.push(result)
+ }
+
+ const data = {
+ id,
+ maps
+ }
+ const jsonOptions = {
+ indent: 2,
+ separators: [',', ': ']
+ }
+
+ const outputFile = path.join(outputDir, `${id}.json`)
+ await writeFile(outputFile, JSON.stringify(data, null, jsonOptions.indent), { encoding: 'utf-8' })
+}
+
+async function main () {
+ const files = await readdir(inputDir)
+ for (const file of files) {
+ const inputFile = path.join(inputDir, file)
+ try {
+ const { id, xml } = await readFileAsync(inputFile)
+ await processFile(id, xml)
+ fileCount += 1
+ } catch (e) {
+ console.error(`${prog}: ERROR: [${id}] ${e.message}`)
+ errorCount += 1
+ }
+ }
+
+ console.log(`${prog}: ${errorCount} error(s), ${fileCount} file(s)`)
+
+ if (errorCount > 0) {
+ throw new Error(`${prog}: Error: ${errorCount.length} errors occured`)
+ }
+}
+
+main().catch((err) => {
+ console.error(err.stack)
+})
diff --git a/tasks/node/processTemporalLayer.js b/tasks/build/processTemporalLayer.js
similarity index 97%
rename from tasks/node/processTemporalLayer.js
rename to tasks/build/processTemporalLayer.js
index 2e9fcb87d..6afb26307 100644
--- a/tasks/node/processTemporalLayer.js
+++ b/tasks/build/processTemporalLayer.js
@@ -5,7 +5,7 @@ function toList (val) {
return val instanceof Array ? val : [val]
}
-module.exports = function processTemporal (wvLayer, value) {
+function processTemporal (wvLayer, value) {
const dateFormat = 'YYYY-MM-DD'
const timeFormat = 'HH:mm:ss'
const dateTimeFormat = 'YYYY-MM-DD HH:mm:ss'
@@ -95,3 +95,7 @@ module.exports = function processTemporal (wvLayer, value) {
}
return wvLayer
}
+
+module.exports = {
+ processTemporal
+}
diff --git a/tasks/node/processVectorData.js b/tasks/build/processVectorData.js
similarity index 98%
rename from tasks/node/processVectorData.js
rename to tasks/build/processVectorData.js
index 8b80d3b77..22fd6b085 100644
--- a/tasks/node/processVectorData.js
+++ b/tasks/build/processVectorData.js
@@ -1,6 +1,7 @@
const fs = require('fs')
const path = require('path')
const { promisify } = require('util')
+const yargs = require('yargs')
const readFile = promisify(fs.readFile)
const writeFile = promisify(fs.writeFile)
diff --git a/tasks/node/processVectorStyles.js b/tasks/build/processVectorStyles.js
similarity index 96%
rename from tasks/node/processVectorStyles.js
rename to tasks/build/processVectorStyles.js
index 3664084c0..fa5f01327 100644
--- a/tasks/node/processVectorStyles.js
+++ b/tasks/build/processVectorStyles.js
@@ -1,6 +1,7 @@
const fs = require('fs')
const path = require('path')
const { promisify } = require('util')
+const yargs = require('yargs')
const readFile = promisify(fs.readFile)
const writeFile = promisify(fs.writeFile)
@@ -25,7 +26,7 @@ const options = yargs
.epilog('Extracts vector style information from GetCapabilities')
const { argv } = options
-if (!argv.config && !argv.inputDir && !argv.outputDir) {
+if (!argv.inputDir && !argv.outputDir) {
throw new Error('Invalid number of arguments')
}
diff --git a/tasks/node/validateConfigs.js b/tasks/build/validateConfigs.js
old mode 100755
new mode 100644
similarity index 100%
rename from tasks/node/validateConfigs.js
rename to tasks/build/validateConfigs.js
diff --git a/tasks/build/validateOptions.js b/tasks/build/validateOptions.js
new file mode 100644
index 000000000..e69de29bb
diff --git a/tasks/buildOptions.sh b/tasks/buildOptions.sh
index e604e4bcb..7d2a67969 100755
--- a/tasks/buildOptions.sh
+++ b/tasks/buildOptions.sh
@@ -7,8 +7,7 @@ SRC_DIR="$BASE/config/default"
OPT_DIR="$BASE/config/default"
BUILD_DIR="$BASE/build/options-build"
DEST_DIR="$BASE/build/options"
-PYTHON_SCRIPTS_DIR="$BASE/tasks/python3"
-NODE_SCRIPTS_DIR="$BASE/tasks/node"
+SCRIPTS_DIR="$BASE/tasks/build"
# If there is an active directory, use instead of defaults
@@ -48,13 +47,13 @@ fi
mkdir -p "$DEST_DIR/config"
mkdir -p "$BUILD_DIR/colormaps"
-# # If $FETCH_GC is set, make various API requests
+# If $FETCH_GC is set, make various API requests
# if [ "$FETCH_GC" ] ; then
# # TODO: Fix axios fetch timeouts
# # Fetch GC files and create colormaps, vectordata and vectorstyle files
# rm -rf "$OPT_DIR/$OPT_SUBDIR/gc/*"
# rm -rf "$OPT_DIR/$OPT_SUBDIR/colormaps/gc/*"
-# `node $NODE_SCRIPTS_DIR/getCapabilities.js \
+# `node $SCRIPTS_DIR/getCapabilities.js \
# --config "$OPT_DIR/$OPT_SUBDIR/config.json" \
# --getcapabilities "$OPT_DIR/$OPT_SUBDIR/gc"`
@@ -62,94 +61,102 @@ mkdir -p "$BUILD_DIR/colormaps"
# # Get metadata for files in layerOrder.json and combine this data into 1 file
# rm -rf "$OPT_DIR/$OPT_SUBDIR/layer-metadata"
# mkdir -p "$OPT_DIR/$OPT_SUBDIR/layer-metadata"
-# `node $NODE_SCRIPTS_DIR/getVisMetadata.js \
+# `node $SCRIPTS_DIR/getVisMetadata.js \
# --features "$BUILD_DIR/features.json" \
# --layerOrder "$BUILD_DIR/config/wv.json/layerOrder.json" \
# --layerMetadata "$OPT_DIR/$OPT_SUBDIR/layer-metadata/all.json"`
# fi
-# # Validate layers in wv.json with a JSON schema
-# `node $NODE_SCRIPTS_DIR/validateConfigs.js \
-# --inputDirectory "$SRC_DIR/common/config/wv.json/layers" \
-# --schemaFile "$BASE/schemas/layer-config.json"`
+# Validate layers in wv.json with a JSON schema
+`node $SCRIPTS_DIR/validateConfigs.js \
+ --inputDirectory "$SRC_DIR/common/config/wv.json/layers" \
+ --schemaFile "$BASE/schemas/layer-config.json"`
-# if [ -e "$BUILD_DIR/features.json" ] ; then
-# cp "$BUILD_DIR/features.json" "$BUILD_DIR/config/wv.json/_features.json"
-# fi
+if [ -e "$BUILD_DIR/features.json" ] ; then
+ cp "$BUILD_DIR/features.json" "$BUILD_DIR/config/wv.json/_features.json"
+fi
-# # Run extractConfigFromWMTS.py script with config.json
+# # Run extractConfigFromWMTS.js script with config.json
if [ -e "$BUILD_DIR/config.json" ] ; then
- `node $NODE_SCRIPTS_DIR/extractConfigFromWMTS.js \
+ `node $SCRIPTS_DIR/extractConfigFromWMTS.js \
--config "$BUILD_DIR/config.json" \
--inputDir "$BUILD_DIR/gc" \
--outputDir "$BUILD_DIR/_wmts"`
fi
-# # Run processVectorStyles.py and move vectorstyles where we want them
+# # Run processVectorStyles.js and move vectorstyles where we want them
if [ -e "$BUILD_DIR/gc/vectorstyles" ] ; then
mkdir -p "$BUILD_DIR/config/wv.json/vectorstyles"
- `node $NODE_SCRIPTS_DIR/processVectorStyles.js \
+ `node $SCRIPTS_DIR/processVectorStyles.js \
--inputDir "$BUILD_DIR/gc/vectorstyles" \
--outputDir "$BUILD_DIR/config/wv.json/vectorstyles"`
fi
-# Run processVectorData.py and move vectordata where we want them
+# Run processVectorData.js and move vectordata where we want them
if [ -e "$BUILD_DIR/gc/vectordata" ] ; then
mkdir -p "$BUILD_DIR/config/wv.json/vectordata"
- `node $NODE_SCRIPTS_DIR/processVectorData.js \
+ `node $SCRIPTS_DIR/processVectorData.js \
--inputDir "$BUILD_DIR/gc/vectordata" \
--outputDir "$BUILD_DIR/config/wv.json/vectordata"`
fi
-# # Run processColormap.py and move colormaps where we want them
-# if [ -e "$BUILD_DIR/colormaps" ] ; then
-# mkdir -p "$BUILD_DIR"/config/palettes
-# if [ -d "$BUILD_DIR"/gc/colormaps ] ; then
-# cp -r "$BUILD_DIR"/gc/colormaps "$BUILD_DIR"/colormaps/gc
-# fi
-# "$PYTHON_SCRIPTS_DIR/processColormap.py" "$OPT_DIR/$OPT_SUBDIR/config.json" \
-# "$BUILD_DIR/colormaps" \
-# "$BUILD_DIR/config/palettes"
-# fi
+# Run processColormap.js and move colormaps where we want them
+if [ -e "$BUILD_DIR/colormaps" ] ; then
+ mkdir -p "$BUILD_DIR"/config/palettes
+ if [ -d "$BUILD_DIR"/gc/colormaps ] ; then
+ cp -r "$BUILD_DIR"/gc/colormaps "$BUILD_DIR"/colormaps/gc
+ fi
+ `node $SCRIPTS_DIR/processColormap.js \
+ --config "$OPT_DIR/$OPT_SUBDIR/config.json" \
+ --inputDir "$BUILD_DIR/colormaps" \
+ --outputDir "$BUILD_DIR/config/palettes"`
+fi
-# # Throw error if no categoryGroupOrder.json file present
-# if [ ! -e "$BUILD_DIR/config/wv.json/categoryGroupOrder.json" ] ; then
-# echo "categoryGroupOrder.json not found. Generating..."
-# "$PYTHON_SCRIPTS_DIR/generateCategoryGroupOrder.py" "$SRC_DIR/common/config/wv.json/categories/" \
-# "$SRC_DIR/common/config/wv.json/"
-# fi
+# Throw error if no categoryGroupOrder.json file present
+if [ ! -e "$BUILD_DIR/config/wv.json/categoryGroupOrder.json" ] ; then
+ echo "categoryGroupOrder.json not found. Generating..."
+ `node $SCRIPTS_DIR/generateCategoryGroupOrder.js \
+ --inputDir "$SRC_DIR/common/config/wv.json/categories/" \
+ --outputDir "$SRC_DIR/common/config/wv.json/"`
+fi
-# if [ -e "$OPT_DIR/$OPT_SUBDIR/layer-metadata/all.json" ] ; then
-# cp "$OPT_DIR/$OPT_SUBDIR/layer-metadata/all.json" "$BUILD_DIR/config/wv.json/layer-metadata.json"
-# fi
+if [ -e "$OPT_DIR/$OPT_SUBDIR/layer-metadata/all.json" ] ; then
+ cp "$OPT_DIR/$OPT_SUBDIR/layer-metadata/all.json" "$BUILD_DIR/config/wv.json/layer-metadata.json"
+fi
-# # Run mergeConfig.py on all directories in /config
-# configs=$(ls "$BUILD_DIR/config")
-# for config in $configs; do
-# case $config in
-# *.json)
-# "$PYTHON_SCRIPTS_DIR/mergeConfig.py" "$BUILD_DIR/config/$config" \
-# "$DEST_DIR/config/$config"
-# ;;
-# *)
-# cp -r "$BUILD_DIR/config/$config" "$DEST_DIR/config/$config"
-# ;;
-# esac
-# done
-
-# # Run mergeConfigWithWMTS.py to merge layer metadata from WMTS GC with worldview layer configs into wv.json
-# "$PYTHON_SCRIPTS_DIR/mergeConfigWithWMTS.py" "$BUILD_DIR/_wmts" \
-# "$DEST_DIR/config/wv.json"
-
-# # Copy brand files from build to dest
-# cp -r "$BUILD_DIR/brand" "$DEST_DIR"
-# cp "$BUILD_DIR/brand.json" "$DEST_DIR"
-
-# # Validate the options build
-# "$PYTHON_SCRIPTS_DIR/validateOptions.py" "$BUILD_DIR/config.json" "$DEST_DIR/config"
-
-# # Fetch preview images from WV Snapshots for any layers which they are missing
-# "$PYTHON_SCRIPTS_DIR/fetchPreviewSnapshots.py" "$DEST_DIR/config/wv.json" \
-# "$OPT_DIR/common/previewLayerOverrides.json" "$BUILD_DIR/features.json"
+# Run mergeConfig.js on all directories in /config
+configs=$(ls "$BUILD_DIR/config")
+for config in $configs; do
+ case $config in
+ *.json)
+ `node $SCRIPTS_DIR/mergeConfig.js \
+ --inputFile "$BUILD_DIR/config/$config" \
+ --outputFile "$DEST_DIR/config/$config"`
+ ;;
+ *)
+ cp -r "$BUILD_DIR/config/$config" "$DEST_DIR/config/$config"
+ ;;
+ esac
+done
+
+# Run mergeConfigWithWMTS.js to merge layer metadata from WMTS GC with worldview layer configs into wv.json
+`node $SCRIPTS_DIR/mergeConfigWithWMTS.js \
+ --inputDir "$BUILD_DIR/_wmts" \
+ --outputDir "$DEST_DIR/config/wv.json"`
+
+# Copy brand files from build to dest
+cp -r "$BUILD_DIR/brand" "$DEST_DIR"
+cp "$BUILD_DIR/brand.json" "$DEST_DIR"
+
+# Validate the options build
+`node $SCRIPTS_DIR/validateOptions.js" \
+ --inputFile "$BUILD_DIR/config.json" \
+ --outputDir "$DEST_DIR/config`
+
+# Fetch preview images from WV Snapshots for any layers which they are missing
+`node $SCRIPTS_DIR/fetchPreviewSnapshots.js" \
+ --inputFile "$DEST_DIR/config/wv.json" \
+ --outputFile "$OPT_DIR/common/previewLayerOverrides.json" \
+ --featuresFile "$BUILD_DIR/features.json"`
exit 0
diff --git a/tasks/pythonInstall.sh b/tasks/pythonInstall.sh
deleted file mode 100755
index 85f9c21f4..000000000
--- a/tasks/pythonInstall.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# Install python dependencies
-echo "Installing pipenv and dependencies with python3"
-python3 -m pip install pipenv==2022.9.21
-python3 -m pipenv install
\ No newline at end of file
diff --git a/tasks/util/distclean.js b/tasks/util/distclean.js
index 0ee25cd11..056f42a78 100755
--- a/tasks/util/distclean.js
+++ b/tasks/util/distclean.js
@@ -1,8 +1,7 @@
const shell = require('shelljs')
const dirs = [
- 'node_modules',
- '.python'
+ 'node_modules'
]
dirs.forEach((dir) => {