Skip to content

Commit

Permalink
Fix inversed parsing of LV95 coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-va committed Jul 9, 2024
1 parent 22e5282 commit 1efdae5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libs/asset-viewer/src/lib/services/all-study.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class AllStudyService {
studyId: `study_${id}`,
assetId: parseInt(assetId),
isPoint: Boolean(isPoint),
centroid: { x: parseInt(x), y: parseInt(y) } as LV95,
centroid: { x: parseFloat(x), y: parseFloat(y) } as LV95,
} as AllStudyDTO;
}),
toArray(),
Expand Down
6 changes: 3 additions & 3 deletions libs/shared/src/lib/models/lv95.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export const lv95RoundedToMillimeter = (lv95: LV95): LV95 => ({
});

export const parseLV95 = (value: string, { separator }: { separator: string }): LV95 => {
const [x, y] = value.split(separator, 2);
const [y, x] = value.split(separator, 2);
return {
x: parseInt(x) as LV95X,
y: parseInt(y) as LV95Y,
x: parseFloat(x) as LV95X,
y: parseFloat(y) as LV95Y,
};
};

0 comments on commit 1efdae5

Please sign in to comment.