Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Migrate data process from DynatestData repo
Browse files Browse the repository at this point in the history
  • Loading branch information
liulw2022 authored and Seb-sti1 committed Dec 12, 2023
1 parent 5141d8b commit c987fca
Show file tree
Hide file tree
Showing 12 changed files with 2,369 additions and 50 deletions.
30 changes: 30 additions & 0 deletions backend/package-lock.json

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

2 changes: 2 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"knex-postgis": "^0.14.3",
"multer": "^1.4.5-lts.1",
"nestjs-knex": "^2.0.0",
"papaparse": "^5.4.1",
"pg": "^8.11.3",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1"
Expand All @@ -49,6 +50,7 @@
"@types/jest": "^29.5.5",
"@types/multer": "^1.4.10",
"@types/node": "^20.6.2",
"@types/papaparse": "^5.3.14",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
Expand Down
2 changes: 2 additions & 0 deletions backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ImageService } from './images/image.service';
import { SurveyService } from './surveys/survey.service';
import { SurveyController } from './surveys/survey.controller';
import { UploadController } from './upload/upload.controller';
import { UploadService } from './upload/upload.service';

import { BullModule } from '@nestjs/bull';
import { FileProcessor } from './upload/file.processor';
Expand Down Expand Up @@ -71,6 +72,7 @@ const database = (config: any, name: string) => {
SurveyService,
ImageService,
FileProcessor,
UploadService,
],
})
export class AppModule {}
9 changes: 5 additions & 4 deletions backend/src/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Ways = (k: Knex) => k.from<IWays>('ways');
//

export interface IImage {
id?: number;
id?: string;
fk_survey_id: string;
distance_survey: number;
image_path: string;
Expand All @@ -49,7 +49,7 @@ export interface IImage {
export const Image = (k: Knex) => k.from<IImage>('image');

export interface IMeasurement {
id?: number;
id?: string;
fk_survey_id: string;
distance_survey: number;
type_index: MeasurementType;
Expand All @@ -62,17 +62,18 @@ export interface IMeasurement {
export const Measurement = (k: Knex) => k.from<IMeasurement>('measurement');

export interface ISurvey {
id?: number;
id?: string;
section_geom: Geometry;
timestamp: Date;
datasource: string;
/** The Dynatest id of the surveys or null */
survey_id: number;
}

export const Survey = (k: Knex) => k.from<ISurvey>('survey');

export interface IWay<T = LineString> {
id?: number;
id?: string;
way_name: string;
osm_id: string; // This is because bigint is not supported by knex
node_start: string; // See https://stackoverflow.com/questions/39168501/pg-promise-returns-integers-as-strings/39176670#39176670
Expand Down
Loading

0 comments on commit c987fca

Please sign in to comment.