Skip to content

Commit

Permalink
Add NetCDF data upload output type
Browse files Browse the repository at this point in the history
  • Loading branch information
underbluewaters committed Oct 8, 2024
1 parent 5f23ef3 commit 36d1d36
Show file tree
Hide file tree
Showing 9 changed files with 326 additions and 89 deletions.
1 change: 1 addition & 0 deletions packages/api/generated-schema-clean.gql
Original file line number Diff line number Diff line change
Expand Up @@ -3388,6 +3388,7 @@ enum DataUploadOutputType {
FLAT_GEOBUF
GEO_JSON
GEO_TIFF
NET_CDF
PMTILES
PNG
XMLMETADATA
Expand Down
1 change: 1 addition & 0 deletions packages/api/generated-schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -3388,6 +3388,7 @@ enum DataUploadOutputType {
FLAT_GEOBUF
GEO_JSON
GEO_TIFF
NET_CDF
PMTILES
PNG
XMLMETADATA
Expand Down
5 changes: 5 additions & 0 deletions packages/api/migrations/committed/000336.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--! Previous: sha1:fc2579e6e5275d22de4e81f534d1666a014721f8
--! Hash: sha1:b8cbc01e7d5166e77a68f5e3072082b77ff40769

-- Enter migration here
alter type data_upload_output_type add value if not exists 'NetCDF';
394 changes: 307 additions & 87 deletions packages/api/schema.sql

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions packages/client/src/admin/data/QuotaUsageTreemap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ export function humanizeOutputType(type: DataUploadOutputType | "Archives") {
return "Shapefile";
case DataUploadOutputType.Png:
return "PNG Image";
case DataUploadOutputType.NetCdf:
return "NetCDF";
case "Archives":
return "Archived Versions";
case DataUploadOutputType.Xmlmetadata:
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2893,6 +2893,7 @@ export enum DataUploadOutputType {
FlatGeobuf = 'FLAT_GEOBUF',
GeoJson = 'GEO_JSON',
GeoTiff = 'GEO_TIFF',
NetCdf = 'NET_CDF',
Pmtiles = 'PMTILES',
Png = 'PNG',
Xmlmetadata = 'XMLMETADATA',
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/generated/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,7 @@ export enum DataUploadOutputType {
FlatGeobuf = 'FLAT_GEOBUF',
GeoJson = 'GEO_JSON',
GeoTiff = 'GEO_TIFF',
NetCdf = 'NET_CDF',
Pmtiles = 'PMTILES',
Png = 'PNG',
Xmlmetadata = 'XMLMETADATA',
Expand Down
3 changes: 2 additions & 1 deletion packages/spatial-uploads-handler/src/handleUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export type SupportedTypes =
| "GeoJSON"
| "FlatGeobuf"
| "ZippedShapefile"
| "GeoTIFF";
| "GeoTIFF"
| "NetCDF";

export interface ResponseOutput {
/** Remote location string as used in rclone */
Expand Down
7 changes: 6 additions & 1 deletion packages/spatial-uploads-handler/src/processRasterUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ export async function processRasterUpload(options: {

// Add original file to outputs
outputs.push({
type: ext === ".tif" || ext === ".tiff" ? "GeoTIFF" : "PNG",
type:
ext === ".tif" || ext === ".tiff"
? "GeoTIFF"
: ext === ".nc"
? "NetCDF"
: "PNG",
remote: `${process.env.RESOURCES_REMOTE}/${baseKey}/${jobId}${ext}`,
local: path,
size: statSync(path).size,
Expand Down

0 comments on commit 36d1d36

Please sign in to comment.