Fix!update layer export

This commit is contained in:
phil 2024-04-28 01:08:00 +02:00
parent b6496f9dba
commit 4873fc5599
6 changed files with 48 additions and 8 deletions

View file

@ -33,7 +33,8 @@ export class PrimaryGroupNode extends Node {
}
downloadGpkg() {
window.open('/download/layers/gpkg/' + this.children.map(child => child.store).join(','))
const layers = this.children.map(child => child.store).join(',')
window.open(`/api/download/geodata/${layers}?format=gpkg`)
}
}
@ -74,15 +75,15 @@ export class LayerNode extends Node {
}
downloadShapefile() {
window.open('/download/shapefile/' + this.store)
window.open(`/api/download/geodata/${this.store}?format=shapefile`)
}
downloadGpkg() {
window.open('/download/layers/gpkg/' + this.store)
window.open(`/api/download/geodata/${this.store}?format=gpkg`)
}
downloadDXF(reproject: Boolean=false) {
window.open('/download/layers/dxf/' + this.store + '?reproject=' + reproject)
window.open(`/api/download/geodata/${this.store}?format=dxf&reproject=${reproject}`)
}
downloadRawData() {

View file

@ -59,7 +59,7 @@
</button>
<button mat-menu-item (click)="downloadDXF(node)">
<mat-icon>file_download</mat-icon>
<span>Download DXF (EPSG {{ (configService.conf | async).bsData?.geo.proj })</span>
<span>Download DXF (EPSG {{ (configService.conf | async).bsData?.geo.srid }})</span>
</button>
<button mat-menu-item (click)="downloadDXF(node, true)">
<mat-icon>file_download</mat-icon>

View file

@ -47,7 +47,7 @@ export const OpenAPI: OpenAPIConfig = {
PASSWORD: undefined,
TOKEN: undefined,
USERNAME: undefined,
VERSION: '2023.4.dev63+g52e1d21.d20240408',
VERSION: '0.1.dev70+g53c2e35.d20240422',
WITH_CREDENTIALS: false,
interceptors: {response: new Interceptors(),
},

View file

@ -515,7 +515,7 @@ export const $BootstrapData = {
version: {
type: 'string',
title: 'Version',
default: '2023.4.dev63+g52e1d21.d20240408'
default: '0.1.dev70+g53c2e35.d20240422'
},
title: {
type: 'string',
@ -542,7 +542,7 @@ export const $BootstrapData = {
opacity: 0.4,
pitch: 0,
status: ['E', 'F', 'D'],
style: 'No base map',
style: 'osm',
tagKeys: ['source'],
tileServer: {
baseDir: '/home/phil/gisaf_misc/map',

View file

@ -677,6 +677,30 @@ export class DownloadService {
});
}
/**
* Download Geodata
* @returns unknown Successful Response
* @throws ApiError
*/
public downloadGeodataApiDownloadGeodataStoresGet(data: $OpenApiTs['/api/download/geodata/{stores}']['get']['req']): Observable<$OpenApiTs['/api/download/geodata/{stores}']['get']['res'][200]> {
const { stores, format, reproject } = data;
return __request(OpenAPI, this.http, {
method: 'GET',
url: '/api/download/geodata/{stores}',
path: {
stores
},
query: {
format,
reproject
},
errors: {
404: 'Not found',
422: 'Validation Error'
}
});
}
/**
* Execute Action
* Download the result of an action

View file

@ -962,6 +962,21 @@ export type $OpenApiTs = {
res: {
/**
* Successful Response
*/
200: unknown;
};
};
};
'/api/download/geodata/{stores}': {
get: {
req: {
format?: string;
reproject?: boolean;
stores: string;
};
res: {
/**
* Successful Response
*/
200: unknown;
};