Skip to content

feat: dem info endpoint (MAPCO-9814)#20

Open
vitaligi wants to merge 52 commits into
feat/dem-servicefrom
feat/dem-info
Open

feat: dem info endpoint (MAPCO-9814)#20
vitaligi wants to merge 52 commits into
feat/dem-servicefrom
feat/dem-info

Conversation

@vitaligi

@vitaligi vitaligi commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator
Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

missing:

  • schema/config server usage
  • extract shared resources to dem-shared package
  • tracing

@github-actions

github-actions Bot commented Mar 10, 2026

Copy link
Copy Markdown

🎫 Related Jira Issue: MAPCO-9814

@vitaligi vitaligi requested a review from asafMasa March 10, 2026 09:47

@asafmas-rnd asafmas-rnd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, keep up the good work!

Comment thread config/default.json
Comment thread src/common/constants.ts Outdated
Comment thread src/dem/controllers/demController.ts Outdated
Comment thread openapi3.yaml Outdated
Comment thread openapi3.yaml
Comment thread src/info/fileHandlers/gdal.ts Outdated
Comment thread src/info/fileHandlers/gdal.ts
Comment thread src/info/fileHandlers/gdal.ts Outdated
Comment thread src/info/fileHandlers/gdal.ts
Comment thread src/info/models/infoManager.ts Outdated

@asafmas-rnd asafmas-rnd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking Good, Thanks! 😎
Don't forget to fix the tests

Comment thread src/info/fileHandlers/gdal.ts Outdated
Comment thread src/info/fileHandlers/gdal.ts Outdated
Comment thread openapi3.yaml Outdated
@injectAll('FileHandler') private readonly fileHandlers: FileHandler[]
) {}

public async info(options: InfoOptions): Promise<InfoResponse> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need both methods, "info" and "process"? As I see it, there is no logic in "info" class

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged into single function

try {
const { driver, format } = this.getDriver(filePath);
dataset = await driver.openAsync(fullFilePath, 'r');
const band = await dataset.bands.getAsync(1); // DEMs are mostly single banded

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"mostly"? How do we handle this use case?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gdal-async will throw an error when accessing undefined band
since we access the first band the risk of an error thrown is negligible (zero bands raster is probably a very rare possibility)

};
}

private async validateMetadata({ band, dataset }: { band: RasterBand; dataset: Dataset }): Promise<void> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

};
}

private async validateMetadata({ band, dataset }: { band: RasterBand; dataset: Dataset }): Promise<void> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you pass the arguments inside of an object and not as a method argument (several places)?

@vitaligi vitaligi Apr 16, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer it since it's best practice for long term maintainability and usage

Comment thread package.json
@@ -1,11 +1,11 @@
{
"name": "service-name",
"name": "dem-gateway",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the service description

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants