Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [22.x]
node-version: [22.14.x]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compare-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'
node-version: '22.14.x'

- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/harmony-in-a-box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

strategy:
matrix:
node-version: [22.x]
node-version: [22.14.x]

steps:
- name: Check out code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 22.14.x
- name: Log into registry
run: echo "${{ secrets.DOCKERHUB }}" | docker login -u "${DOCKER_USER}" --password-stdin
- name: Setup Node
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
22.14.0
2 changes: 1 addition & 1 deletion docs/notebook_helpers/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ descartes >= 1.1.0
contextily >= 1.0.0
sat-stac >= 0.4.0
xarray >= 0.16.2
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability
setuptools>=65.5.1
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"Cumulus"
],
"engines": {
"node": "^22.5.1",
"node": "^22.14.0",
"npm": ">=8"
},
"nyc": {
Expand Down
2 changes: 1 addition & 1 deletion packages/util/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"better-audit": "better-npm-audit audit"
},
"engines": {
"node": "^22.5.1",
"node": "^22.14.0",
"npm": ">=8"
},
"nyc": {
Expand Down
6 changes: 3 additions & 3 deletions services/cron-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:22.5.1-alpine
FROM node:22.14.0

RUN apk update
RUN apk add bash vim curl git python3 postgresql-client make gcc g++ libc-dev libpq-dev
RUN apt-get update
RUN apt-get install -y vim git python3 postgresql-client make gcc g++ libc-dev libpq-dev
RUN git config --global url."https://".insteadOf ssh://

RUN mkdir -p /cron-service/services/cron-service
Expand Down
4 changes: 2 additions & 2 deletions services/cron-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion services/cron-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"better-audit": "better-npm-audit audit"
},
"engines": {
"node": "^22.5.1",
"node": "^22.14.0",
"npm": ">=8"
},
"author": "NASA EOSDIS Harmony team",
Expand Down
2 changes: 1 addition & 1 deletion services/harmony/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=node:22.5.1
ARG BASE_IMAGE=node:22.14.0
FROM $BASE_IMAGE

RUN apt-get update && apt-get install -y sqlite3 libsqlite3-dev python3 python3-pip python3-venv libpq-dev build-essential
Expand Down
21 changes: 20 additions & 1 deletion services/harmony/app/middleware/shapefile-converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { HttpError, RequestValidationError, ServerError } from '../util/errors';
import { defaultObjectStore } from '../util/object-store';

const APPROXIMATE_METERS_PER_DEGREE = 111139.0;
const COORDINATE_PRECISION = 6; // in decimal places

/**
* Converts the given ESRI Shapefile to GeoJSON and returns the resulting file. Note,
Expand Down Expand Up @@ -179,6 +180,18 @@ function normalizeLongitude(lon: number): number {
return lon;
}

/**
* Round a number to a given precision
*
* @param num - the number to be rounded
* @param decimals - the number of decimal places to round to
* @returns A number with the given number of decimal places
*/
function setPrecision(num: number, decimals: number = COORDINATE_PRECISION): number {
const factor = Math.pow(10, decimals);
return Math.round(num * factor) / factor;
}

/**
* normalize all the longitudes in the file to [-180,180]
* @param geojson - the object representing the geojson
Expand All @@ -190,7 +203,9 @@ export function normalizeGeoJsonCoords(geojson: any): any {
if (Array.isArray(coordinates[0])) {
return coordinates.map(normalizeCoordinates);
} else {
return [normalizeLongitude(coordinates[0]), coordinates[1]];
const normCoords = [normalizeLongitude(coordinates[0]), coordinates[1]];
// set all coordinates to six decimal places of precision
return normCoords.map(value => setPrecision(value));
}
}

Expand Down Expand Up @@ -242,8 +257,12 @@ export function normalizeGeoJson(geoJson: object): object {
newGeoJson['features'][index] = normalizedGeoJson;
}

// need to renormalize coordinates after splitting, since the splitter might
// change coordinate precision
newGeoJson = normalizeGeoJsonCoords(newGeoJson);
// force ccw winding
newGeoJson = rewind(newGeoJson, false);

return newGeoJson;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
POST /search/granules.json
accept: application/json
content-type: multipart/form-data; boundary=----------------------------012345678901234567890123
accept-encoding: gzip,deflate
body: ------------------------------012345678901234567890123\r\nContent-Disposition: form-data; name=\"page_size\"\r\n\r\n100\r\n------------------------------012345678901234567890123\r\nContent-Disposition: form-data; name=\"temporal\"\r\n\r\n2020-01-02T00:00:00.000Z,2020-01-02T01:00:00.000Z\r\n------------------------------012345678901234567890123\r\nContent-Disposition: form-data; name=\"bounding_box\"\r\n\r\n17,-90,98,90\r\n------------------------------012345678901234567890123\r\nContent-Disposition: form-data; name=\"collection_concept_id\"\r\n\r\nC1233800302-EEDTEST\r\n------------------------------012345678901234567890123\r\nContent-Disposition: form-data; name=\"shapefile\"; filename=\"shapefile\"\r\nContent-Type: application/geo+json\r\n\r\n{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-118.2832,35.261619],[-118.407419,35.257361],[-118.530752,35.244618],[-118.652318,35.22348],[-118.771252,35.1941],[-118.886709,35.156685],[-118.997875,35.111503],[-119.103965,35.058875],[-119.204239,34.999175],[-119.298001,34.932824],[-119.384605,34.860292],[-119.463462,34.78209],[-119.534039,34.698767],[-119.595871,34.610907],[-119.648552,34.519123],[-119.691748,34.424053],[-119.725193,34.326358],[-119.74869,34.226712],[-119.762112,34.125801],[-119.765405,34.024317],[-119.758581,33.922955],[-119.741723,33.822405],[-119.714981,33.723348],[-119.678569,33.626456],[-119.632765,33.532381],[-119.577905,33.441755],[-119.514386,33.355186],[-119.442656,33.273252],[-119.363215,33.196498],[-119.276609,33.125435],[-119.183429,33.060533],[-119.084305,33.002222],[-118.979901,32.950886],[-118.870913,32.906863],[-118.758063,32.870444],[-118.642098,32.841867],[-118.523779,32.82132],[-118.403885,32.808938],[-118.2832,32.804801],[-118.162515,32.808938],[-118.042621,32.82132],[-117.924302,32.841867],[-117.808337,32.870444],[-117.695487,32.906863],[-117.586499,32.950886],[-117.482095,33.002222],[-117.382971,33.060533],[-117.289791,33.125435],[-117.203185,33.196498],[-117.123744,33.273252],[-117.052014,33.355186],[-116.988495,33.441755],[-116.933635,33.532381],[-116.887831,33.626456],[-116.851419,33.723348],[-116.824677,33.822405],[-116.807819,33.922955],[-116.800995,34.024317],[-116.804288,34.125801],[-116.81771,34.226712],[-116.841207,34.326358],[-116.874652,34.424053],[-116.917848,34.519123],[-116.970529,34.610907],[-117.032361,34.698767],[-117.102938,34.78209],[-117.181795,34.860292],[-117.268399,34.932824],[-117.362161,34.999175],[-117.462435,35.058875],[-117.568525,35.111503],[-117.679691,35.156685],[-117.795148,35.1941],[-117.914082,35.22348],[-118.035648,35.244618],[-118.158981,35.257361],[-118.2832,35.261619]]]},\"properties\":{}}],\"properties\":{\"summary\":\"Shapefile created by Earthdata Search to support spatial subsetting when requesting data from Harmony.\"}}\r\n------------------------------012345678901234567890123--\r\n

HTTP/1.1 200 OK
content-type: application/json;charset=utf-8
transfer-encoding: chunked
connection: keep-alive
date: Tue, 25 Feb 2025 21:54:35 GMT
x-frame-options: SAMEORIGIN
access-control-allow-origin: *
x-xss-protection: 1; mode=block
cmr-request-id: fc301384-6421-468a-8a9c-b0418f321d7f
content-sha1: d6c2f58c20889b8c90cf3c4b45cfd9e5cb7b68b9
strict-transport-security: max-age=31536000; includeSubDomains; preload
cmr-search-after: ["eedtest",1577923200000,1233800352]
cmr-hits: 1
access-control-expose-headers: CMR-Hits, CMR-Request-Id, X-Request-Id, CMR-Scroll-Id, CMR-Search-After, CMR-Timed-Out, CMR-Shapefile-Original-Point-Count, CMR-Shapefile-Simplified-Point-Count
x-content-type-options: nosniff
cmr-took: 70
x-request-id: fc301384-6421-468a-8a9c-b0418f321d7f
content-md5: 34c4812ce5070ce703090a76bc2fb423
server: ServerTokens ProductOnly
x-cache: Miss from cloudfront
via: 1.1 ea72b507c6af69ac1c92f38e8d545768.cloudfront.net (CloudFront)
x-amz-cf-pop: DFW59-P2
x-amz-cf-id: mRlL1Z8LQHxOhsl-40WXjgwgGLDY9Wq96Yp3xvKL_NSq6xmk_XFzpg==

{"feed":{"updated":"2025-02-25T21:54:35.706Z","id":"https://cmr.uat.earthdata.nasa.gov:443/search/granules.json","title":"ECHO granule metadata","entry":[{"producer_granule_id":"002_00_3200ff_global","boxes":["-90 -180 90 180"],"time_start":"2020-01-02T00:00:00.000Z","updated":"2020-02-25T21:43:11.000Z","dataset_id":"Harmony Example Data","data_center":"EEDTEST","title":"002_00_3200ff_global","coordinate_system":"CARTESIAN","day_night_flag":"BOTH","time_end":"2020-01-02T01:59:59.000Z","id":"G1233800352-EEDTEST","original_format":"UMM_JSON","granule_size":"1.3663883209228516","browse_flag":false,"collection_concept_id":"C1233800302-EEDTEST","online_access_flag":true,"links":[{"rel":"http://esipfed.org/ns/fedsearch/1.1/data#","type":"application/x-netcdf","hreflang":"en-US","href":"https://harmony.uat.earthdata.nasa.gov/service-results/harmony-uat-eedtest-data/C1233800302-EEDTEST/nc/002_00_3200ff_global.nc"},{"rel":"http://esipfed.org/ns/fedsearch/1.1/data#","type":"image/tiff","hreflang":"en-US","href":"https://harmony.uat.earthdata.nasa.gov/service-results/harmony-uat-eedtest-data/C1233800302-EEDTEST/tiff/002_00_3200ff_global.tif"}]}]}}
4 changes: 2 additions & 2 deletions services/harmony/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion services/harmony/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"Cumulus"
],
"engines": {
"node": "^22.5.1",
"node": "^22.14.0",
"npm": ">=8"
},
"nyc": {
Expand Down
Loading