From e40abbf0820c475f8e5692fe55ff8002682f65c2 Mon Sep 17 00:00:00 2001 From: Lukas Merz Date: Wed, 25 Oct 2023 13:35:19 +0200 Subject: [PATCH] Update API specs --- .../models/gb3-api-generated.interfaces.ts | 1662 +++++++++-------- .../services/apis/gb3/gb3-topics.service.ts | 4 +- 2 files changed, 880 insertions(+), 786 deletions(-) diff --git a/src/app/shared/models/gb3-api-generated.interfaces.ts b/src/app/shared/models/gb3-api-generated.interfaces.ts index f36759283..148115cf8 100644 --- a/src/app/shared/models/gb3-api-generated.interfaces.ts +++ b/src/app/shared/models/gb3-api-generated.interfaces.ts @@ -9,6 +9,52 @@ * --------------------------------------------------------------- */ +export interface Feature { + feature_info: { + /** LV95 East coordinate of center of query bbox */ + east: number; + /** LV95 North coordinate of center of query bbox */ + north: number; + results: { + /** Topic name */ + topic: string; + /** Geolion ID of topic */ + geolion_gdd: number | null; + /** UUID from geommetadatabase */ + geolion_karten_uuid: string | null; + layers: { + /** Layer name */ + layer: string; + /** Layer title */ + title: string; + /** Geolion ID of layer */ + geolion_gds: number | null; + /** UUID from geommetadatabase */ + geolion_geodatensatz_uuid: string | null; + features: { + /** Feature ID */ + fid: number; + /** Feature fields */ + fields: { + /** Field label */ + label: string; + /** Field value (string, numeric or null) */ + value: string | number | null; + }[]; + /** + * Bounding box of this feature + * @maxItems 4 + * @minItems 4 + */ + bbox: number[]; + /** GeoJSON geometry object */ + geometry: Geometry; + }[]; + }[]; + }; + }; +} + export interface General { general_info: { spatial_reference: { @@ -54,62 +100,49 @@ export interface General { }; } -export interface Product { - /** Product UUID */ - uuid: string; - /** Product GDP-Nummer */ - gdpnummer: number; - /** Name des Geodatenprodukts */ - name: string; - /** Beschreibung */ - beschreibung: string; - /** Link auf Bild */ - image_url: string | null; - kontakt: { - /** Kontakt: Zuständig für Geometadaten */ - metadaten: { - /** Amt */ - amt: string; - /** Fachstelle */ - fachstelle: string | null; - /** Sektion */ - sektion: string | null; - /** Vorname */ - vorname: string; - /** Nachname */ - nachname: string; - /** Strassenname */ - strassenname: string; - /** Hausnummer */ - hausnummer: number; - /** Postfach */ - postfach: string | null; - /** PLZ */ - plz: number; - /** Ortschaft */ - ortschaft: string; - /** Telephon */ - telephon: string; - /** Telephon direkt */ - telephon_direkt: string; - /** E-Mail */ - email: string; - /** URL */ - weburl: string; - }; +export interface Legend { + legend: { + /** Topic name */ + topic: string; + /** Geolion ID of topic */ + geolion_gdd: number | null; + /** UUID from geommetadatabase */ + geolion_karten_uuid: string | null; + layers: { + /** Layer name */ + layer: string; + /** Layer title */ + title: string; + layer_classes?: { + /** Class label */ + label: string; + /** Path to class image */ + image: string; + }[]; + /** Layer attribution */ + attribution?: string; + /** Geolion ID of layer */ + geolion_gds: number | null; + /** UUID from geommetadatabase */ + geolion_geodatensatz_uuid: string | null; + }[]; }; - datasets: { - /** Dataset UUID */ - uuid: string; - /** Dataset GIS-ZH-Nummer */ - giszhnr: number; - /** Name des Geodatensatzes */ - name: string; - /** Kurzbeschreibung des Geodatensatzes */ - kurzbeschreibung: string; - /** Link auf Geodatashop bei NOGD-Daten */ - url_shop: string | null; - }[]; +} + +export interface MetadataDataset { + dataset: Dataset; +} + +export interface MetadataDatasets { + datasets: Dataset[]; +} + +export interface MetadataMap { + map: Map; +} + +export interface MetadataMaps { + maps: Map[]; } export interface MetadataProduct { @@ -120,345 +153,40 @@ export interface MetadataProducts { products: Product[]; } -export interface Map { - /** Map UUID */ - uuid: string; - /** Map GB2-Nummer */ - gb2_id: number; - /** Topic name */ - topic: string; - /** Kartenname */ - name: string; - /** Beschreibung der Karte */ - beschreibung: string; - /** Link auf Bild */ - image_url: string | null; - kontakt: { - /** Kontakt: Verantwortlich für Geodaten */ - geodaten: { - /** Amt */ - amt: string; - /** Fachstelle */ - fachstelle: string | null; - /** Sektion */ - sektion: string | null; - /** Vorname */ - vorname: string; - /** Nachname */ - nachname: string; - /** Strassenname */ - strassenname: string; - /** Hausnummer */ - hausnummer: number; - /** Postfach */ - postfach: string | null; - /** PLZ */ - plz: number; - /** Ortschaft */ - ortschaft: string; - /** Telephon */ - telephon: string; - /** Telephon direkt */ - telephon_direkt: string; - /** E-Mail */ - email: string; - /** URL */ - weburl: string; - }; - }; - datasets: { - /** Dataset UUID */ - uuid: string; - /** Dataset GIS-ZH-Nummer */ - giszhnr: number; - /** Name des Geodatensatzes */ - name: string; - /** Kurzbeschreibung des Geodatensatzes */ - kurzbeschreibung: string; - /** Link auf Geodatashop bei NOGD-Daten */ - url_shop: string | null; - }[]; +export interface MetadataService { + service: Service; } -export interface MetadataMap { - map: Map; +export interface MetadataServices { + services: Service[]; } -export interface MetadataMaps { - maps: Map[]; -} - -export interface Dataset { - /** UUID */ - uuid: string; - /** Dataset GIS-ZH-Nummer */ - giszhnr: number; - /** Name des Geodatensatzes */ - name: string; - /** Kurzbeschreibung */ - kurzbeschreibung: string; - /** Beschreibung */ - beschreibung: string; - /** eCH Geokategorien / Themen */ - themen: string | null; - /** Schlüsselwörter */ - keywords: string | null; - /** Datengrundlage */ - datengrundlage: string | null; - /** Bemerkungen */ - bemerkungen: string | null; - /** Abgabeformat */ - abgabeformat: string; - /** Anwendungeinschränkung */ - anwendungeinschraenkung: string; - /** Link auf Bild */ - image_url: string | null; - /** Name des PDFs */ - pdf_name: string | null; - /** Link auf PDF */ - pdf_url: string | null; - /** Link auf Geodatashop bei NOGD-Daten */ - url_shop: string | null; - kontakt: { - /** Kontakt: Verantwortlich für Geodaten */ - geodaten: { - /** Amt */ - amt: string; - /** Fachstelle */ - fachstelle: string | null; - /** Sektion */ - sektion: string | null; - /** Vorname */ - vorname: string; - /** Nachname */ - nachname: string; - /** Strassenname */ - strassenname: string; - /** Hausnummer */ - hausnummer: number; - /** Postfach */ - postfach: string | null; - /** PLZ */ - plz: number; - /** Ortschaft */ - ortschaft: string; - /** Telephon */ - telephon: string; - /** Telephon direkt */ - telephon_direkt: string; - /** E-Mail */ - email: string; - /** URL */ - weburl: string; - }; - /** Kontakt: Zuständig für Geometadaten */ - metadaten: { - /** Amt */ - amt: string; - /** Fachstelle */ - fachstelle: string | null; - /** Sektion */ - sektion: string | null; - /** Vorname */ - vorname: string; - /** Nachname */ - nachname: string; - /** Strassenname */ - strassenname: string; - /** Hausnummer */ - hausnummer: number; - /** Postfach */ - postfach: string | null; - /** PLZ */ - plz: number; - /** Ortschaft */ - ortschaft: string; - /** Telephon */ - telephon: string; - /** Telephon direkt */ - telephon_direkt: string; - /** E-Mail */ - email: string; - /** URL */ - weburl: string; - }; - }; - maps: { - /** Map UUID */ - uuid: string; - /** Map GB2-ID */ - gb2_id: number; - /** Topic name */ - topic: string; - /** Kartenname */ - name: string; - }[]; - layers: { - /** Layer GIS-ZH-Nummer */ - giszhnr: string; - /** Layername */ - name: string; - /** Beschreibung des Layers */ - beschreibung: string; - /** Metadaten Sichtbarkeit */ - metadaten_sichtbarkeit: string; - /** Datenbezugart */ - datenbezugart: string; - }[]; - services: { - /** Service UUID */ - uuid: string; - /** Geodaten-Service-Nummer */ - gdsernummer: number; - /** Servicetyp, z.B. WMS, WFS */ - servicetyp: string; - /** Servicename */ - name: string; - }[]; - products: { - /** Product UUID */ - uuid: string; - /** Geodatenprodukt-Nummer */ - gdpnummer: number; - /** Produktname */ - name: string; - }[]; -} - -export interface MetadataDataset { - dataset: Dataset; -} - -export interface MetadataDatasets { - datasets: Dataset[]; -} - -export type FavoriteDrawings = VectorLayer; - -export type FavoriteMeasurements = VectorLayer; - -export type FavoriteContent = { - /** ID of the map */ - id: string; - /** ID of the map */ - mapId: string; - /** Visibility of the map */ - visible: boolean; - /** Opacity of the map */ - opacity: number; - /** Single layer of the map */ - isSingleLayer: boolean; - layers: { - /** ID of the layer */ - id: number; - /** Layer of the map */ - layer: string; - /** Visibility of the layer */ - visible: boolean; - }[]; -}[]; - -export type FavoriteContentNew = { - /** ID of the map */ - id: string; - /** ID of the map */ - mapId: string; - /** Visibility of the map */ - visible: boolean; - /** Opacity of the map */ - opacity: number; - /** Single layer of the map */ - isSingleLayer: boolean; - layers: { - /** ID of the layer */ - id: number; - /** Layer of the map */ - layer: string; - /** Visibility of the layer */ - visible: boolean; - }[]; -}[]; - -export interface SharedFavorite { - /** UUID of the favorite */ - id: string; - /** Name of the owner of the favorite */ - owner: string | null; - /** LV95 East coordinate of the favorite */ - east: number; - /** LV95 North coordinate of the favorite */ - north: number; - /** Scale denominator of the favorite */ - scaledenom: number; - /** Basemap of the favorite */ - basemap: string; - /** - * Creation date of the favorite - * @format date_time - */ - created_at: string; - /** - * Update date of the favorite - * @format date_time - */ - updated_at: string; - content: FavoriteContent; - drawings: FavoriteDrawings; - measurements: FavoriteMeasurements; -} - -export interface SharedFavoriteNew { - /** - * LV95 East coordinate of the favorite - * @example 2600100 - */ - east: number; - /** - * LV95 North coordinate of the favorite - * @example 1100100 - */ - north: number; - /** - * Scale denominator of the favorite - * @example 1100 - */ - scaledenom: number; - /** - * Basemap of the favorite - * @example "basemap1" - */ - basemap: string; - content: FavoriteContentNew; - drawings: FavoriteDrawings; - measurements: FavoriteMeasurements; -} - -export interface PersonalFavorite { - /** UUID of the favorite */ - id: string; - /** Title of the favorite */ - title: string; - /** LV95 East coordinate of the favorite */ - east: number; - /** LV95 North coordinate of the favorite */ - north: number; - /** Scale denominator of the favorite */ - scaledenom: number; - /** Basemap of the favorite */ - basemap: string; - /** - * Creation date of the favorite - * @format date_time - */ - created_at: string; - /** - * Update date of the favorite - * @format date_time - */ - updated_at: string; - content: FavoriteContent; - drawings: FavoriteDrawings; - measurements: FavoriteMeasurements; +export interface PersonalFavorite { + /** UUID of the favorite */ + id: string; + /** Title of the favorite */ + title: string; + /** LV95 East coordinate of the favorite */ + east: number; + /** LV95 North coordinate of the favorite */ + north: number; + /** Scale denominator of the favorite */ + scaledenom: number; + /** Basemap of the favorite */ + basemap: string; + /** + * Creation date of the favorite + * @format date_time + */ + created_at: string; + /** + * Update date of the favorite + * @format date_time + */ + updated_at: string; + content: FavoriteContent; + drawings: FavoriteDrawings; + measurements: FavoriteMeasurements; } export interface PersonalFavoriteNew { @@ -481,294 +209,236 @@ export interface PersonalFavoriteNew { scaledenom: number; /** Basemap of the favorite */ basemap: string; - content: FavoriteContentNew; + content: FavoriteContent; drawings: FavoriteDrawings; measurements: FavoriteMeasurements; } -export interface Legend { - legend: { - /** Topic name */ - topic: string; - /** Geolion ID of topic */ - geolion_gdd: number | null; - /** UUID from geommetadatabase */ - geolion_karten_uuid: string | null; - layers: { - /** Layer name */ - layer: string; - /** Layer title */ - title: string; - layer_classes?: { - /** Class label */ - label: string; - /** Path to class image */ - image: string; - }[]; - /** Layer attribution */ - attribution?: string; - /** Geolion ID of layer */ - geolion_gds: number | null; - /** UUID from geommetadatabase */ - geolion_geodatensatz_uuid: string | null; +export interface PrintCapabilities { + print: { + /** Available output formats */ + formats: string[]; + /** Available DPI settings */ + dpis: number[]; + /** Available print templates */ + reports: { + /** Report name */ + name: string; + map: { + /** Width of map element in px @ 72dpi */ + width: number; + /** Height of map element in px @ 72dpi */ + height: number; + }; }[]; }; } -export interface Feature { - feature_info: { - /** Center x coord of query bbox */ - x: number; - /** Center y coord of query bbox */ - y: number; - results: { - /** Topic name */ - topic: string; - /** Geolion ID of topic */ - geolion_gdd: number | null; - /** UUID from geommetadatabase */ - geolion_karten_uuid: string | null; - layers: { - /** Layer name */ - layer: string; - /** Layer title */ - title: string; - /** Geolion ID of layer */ - geolion_gds: number | null; - /** UUID from geommetadatabase */ - geolion_geodatensatz_uuid: string | null; - features: { - /** Feature ID */ - fid: number; - /** Feature fields */ - fields: { - /** Field label */ - label: string; - /** Field value (string, numeric or null) */ - value: string | number | null; - }[]; - /** - * Bounding box of this feature - * @maxItems 4 - * @minItems 4 - */ - bbox: number[]; - /** GeoJSON geometry */ - geometry: { - /** GeoJSON geometry type */ - type: string; - /** GeoJSON geometry coordinates */ - coordinates: (number | number[] | number[][][])[]; - }; - }[]; - }[]; - }; - }; -} - -export interface GeometryCrs { +export interface PrintFeatureInfoNew { + /** List of query topics */ + query_topics: { + /** + * Topic name + * @example "BASISKARTEZH" + */ + topic: string; + /** + * Query layers + * @example ["gemeindegrenzen","adressen","haltestellen"] + */ + layers: string[]; + }[]; /** - * GeoJSON crs type - * @example "name" + * Query bounding box as minx, miny, maxx, maxy coords (default in EPSG:2056) + * @maxItems 4 + * @minItems 4 + * @example [2683470,1247913,2683480,1247923] */ - type: 'name'; - properties: { + bbox: number[]; + /** + * SRID for query bbox (default: 2056) + * @example 2056 + */ + srid?: number; +} + +export interface PrintLegendNew { + /** List of legend topics */ + legend_topics: { /** - * GeoJSON crs name - * @example "EPSG:2056" + * Topic name + * @example "BASISKARTEZH" */ - name: string; - }; + topic: string; + /** + * Legend layers + * @example ["gemeindegrenzen","adressen","haltestellen"] + */ + layers: string[]; + }[]; } -/** GeoJSON geometry object */ -export interface Geometry { +export interface PrintNew { /** - * Type of GeoJSON geometry object - * @example "Polygon" + * Report name + * @example "A4 hoch" */ - type: 'Polygon' | 'Point' | 'LineString' | 'MultiPoint' | 'MultiPolygon'; - crs?: GeometryCrs; + report: string; /** - * coordinates for GeoJSON geometry object - * @example [[[2681730,1247976],[2680217,1249161],[2680809,1250249],[2681937,1249504],[2681730,1247976]],[[2680836,1249355],[2681554,1249477],[2681327,1248867],[2680836,1249355]]] + * Output format + * @example "pdf" */ - coordinates: (number | number[] | number[][] | number[][][])[]; -} - -export interface GeojsonFeature { - /** GeoJSON Feature */ - type: 'Feature'; - properties: { + format: string; + attributes: { /** - * Reference to style ID in 'styles' - * @example "a" + * Report title + * @example "Landeskarten, Übersichtsplan" */ - style: string; + report_title?: string; /** - * Text to display if using text marker style - * @example "Label text" + * User title + * @example "User title" */ - text?: string; + user_title?: string; + /** + * User comment + * @example "User comment" + */ + user_comment?: string; + /** + * Show legend (default: false) + * @example false + */ + show_legend?: boolean; + }; + map: { + /** + * Map center + * @maxItems 2 + * @minItems 2 + * @example [2683465,1248055] + */ + center: number[]; + /** + * Map scale + * @example 25000 + */ + scale: number; + /** + * Map rotation + * @example 0 + */ + rotation?: number; + /** + * DPI + * @example 300 + */ + dpi: number; + /** Map layers ordered from bottom to top */ + layers: ( + | { + /** WMS layer type */ + type: 'WMS'; + /** + * WMS URL + * @example "https://maps.zh.ch/wms/BASISKARTEZH" + */ + url: string; + /** + * WMS layer names + * @example ["wald","seen","gemeindegrenzen"] + */ + layers: string[]; + /** + * Custom WMS params + * @example {"format":"image/png; mode=8bit","transparent":true} + */ + custom_params?: object; + /** + * Layer opacity + * @min 0 + * @max 1 + * @example 1 + */ + opacity?: number; + /** Map title (for Kartenset only) */ + map_title?: string; + /** + * Mark as background layer (for Kartenset only) (default: false) + * @example false + */ + background?: boolean; + } + | VectorLayer + )[]; }; - /** GeoJSON geometry object */ - geometry: Geometry; } -/** - * GeoJSON FeatureCollection - * @example {"type":"FeatureCollection","features":[{"type":"Feature","properties":{"style":"a"},"geometry":{"type":"Point","coordinates":[2683465,1248055]}}]} - */ -export interface GeojsonFeatureCollection { - /** GeoJSON FeatureCollection */ - type: 'FeatureCollection'; - features: GeojsonFeature[]; +export interface ProductsList { + /** Timestamp of product list in ISO8601 format */ + timestamp: string; + products: ProductItem[]; + relevant_products: ProductItem[]; + municipalities: MunicipalityItem[]; } -/** - * Style definitions for features. NOTE: keys are style IDs referenced in feature 'style' property - * @example {"a":{"pointRadius":15,"fillColor":"#ee3333","fillOpacity":0,"strokeColor":"#ee3333","strokeWidth":3}} - */ -export type VectorLayerStyles = { - /** Style definition based on OpenLayers 2 Symbolizer. NOTE: Style properties are optional. */ - a?: { - /** Fill color of the drawing */ - fillColor?: string; - /** Fill opacity of the drawing */ - fillOpacity?: number; - /** Rotation of the drawing */ - rotation?: string; - /** External graphic of the drawing */ - externalGraphic?: string | null; - /** Graphic name of the drawing */ - graphicName?: string; - /** Graphic opacity of the drawing */ - graphicOpacity?: number | null; - /** Point radius of the drawing */ - pointRadius?: number; - /** Stroke color of the drawing */ - strokeColor?: string; - /** Stroke opacity of the drawing */ - strokeOpacity?: number; - /** Stroke width of the drawing */ - strokeWidth?: number; - /** Stroke linecap of the drawing */ - strokeLinecap?: string; - /** Stroke linejoin of the drawing */ - strokeLinejoin?: string; - /** Stroke dashstyle of the drawing */ - strokeDashstyle?: string; - /** Font color of the drawing */ - fontColor?: string; - /** Font family of the drawing */ - fontFamily?: string; - /** Font size of the drawing */ - fontSize?: string; - /** Font style of the drawing */ - fontStyle?: string; - /** Font weight of the drawing */ - fontWeight?: string; - /** Halo color of the drawing */ - haloColor?: string; - /** Halo opacity of the drawing */ - haloOpacity?: string; - /** Halo radius of the drawing */ - haloRadius?: string; - /** Label of the drawing */ - label?: string; - /** Label align of the drawing */ - labelAlign?: string; - /** Label rotation of the drawing */ - labelRotation?: string; - /** Label X offset of the drawing */ - labelXOffset?: string; - /** Label Y offset of the drawing */ - labelYOffset?: string; - }; -}; - -/** Vector layer */ -export interface VectorLayer { - /** Vector layer type */ - type: 'Vector'; - /** GeoJSON FeatureCollection */ - geojson: GeojsonFeatureCollection; - /** Style definitions for features. NOTE: keys are style IDs referenced in feature 'style' property */ - styles: VectorLayerStyles; -} - -export interface Service { - /** Service UUID */ - uuid: string; - /** Service GDSer-Nummer */ - gdsernummer: number; - /** Servicetyp, z.B. WMS, WFS */ - servicetyp: string; - /** Name des Geodienstes */ - name: string; - /** Beschreibung */ - beschreibung: string; - /** URL */ - url: string; - /** Version */ - version: string; - /** Zugang */ - zugang: string; - /** Link auf Bild */ - image_url: string | null; - kontakt: { - /** Kontakt: Zuständig für Geometadaten */ - metadaten: { - /** Amt */ - amt: string; - /** Fachstelle */ - fachstelle: string | null; - /** Sektion */ - sektion: string | null; - /** Vorname */ - vorname: string; - /** Nachname */ - nachname: string; - /** Strassenname */ - strassenname: string; - /** Hausnummer */ - hausnummer: number; - /** Postfach */ - postfach: string | null; - /** PLZ */ - plz: number; - /** Ortschaft */ - ortschaft: string; - /** Telephon */ - telephon: string; - /** Telephon direkt */ - telephon_direkt: string; - /** E-Mail */ - email: string; - /** URL */ - weburl: string; - }; - }; - datasets: { - /** Dataset UUID */ - uuid: string; - /** Dataset GIS-ZH-Nummer */ - giszhnr: number; - /** Name des Geodatensatzes */ - name: string; - /** Kurzbeschreibung des Geodatensatzes */ - kurzbeschreibung: string; - /** Link auf Geodatashop bei NOGD-Daten */ - url_shop: string | null; - }[]; -} +export type SearchResultsList = { + index: string; + matches: SearchMatch[]; +}[]; -export interface MetadataService { - service: Service; +export interface SharedFavorite { + /** UUID of the favorite */ + id: string; + /** Name of the owner of the favorite */ + owner: string | null; + /** LV95 East coordinate of the favorite */ + east: number; + /** LV95 North coordinate of the favorite */ + north: number; + /** Scale denominator of the favorite */ + scaledenom: number; + /** Basemap of the favorite */ + basemap: string; + /** + * Creation date of the favorite + * @format date_time + */ + created_at: string; + /** + * Update date of the favorite + * @format date_time + */ + updated_at: string; + content: FavoriteContent; + drawings: FavoriteDrawings; + measurements: FavoriteMeasurements; } -export interface MetadataServices { - services: Service[]; +export interface SharedFavoriteNew { + /** + * LV95 East coordinate of the favorite + * @example 2600100 + */ + east: number; + /** + * LV95 North coordinate of the favorite + * @example 1100100 + */ + north: number; + /** + * Scale denominator of the favorite + * @example 1100 + */ + scaledenom: number; + /** + * Basemap of the favorite + * @example "basemap1" + */ + basemap: string; + content: FavoriteContent; + drawings: FavoriteDrawings; + measurements: FavoriteMeasurements; } export interface Topics { @@ -900,150 +570,560 @@ export interface Topics { }[]; } -export interface PrintCapabilities { - print: { - /** Available output formats */ - formats: string[]; - /** Available DPI settings */ - dpis: number[]; - /** Available print templates */ - reports: { - /** Report name */ - name: string; - map: { - /** Width of map element in px @ 72dpi */ - width: number; - /** Height of map element in px @ 72dpi */ - height: number; - }; - }[]; - }; -} - -export interface PrintNew { - /** - * Report name - * @example "A4 hoch" - */ - report: string; - /** - * Output format - * @example "pdf" - */ - format: string; - attributes: { - /** - * Report title - * @example "Landeskarten, Übersichtsplan" - */ - report_title?: string; - /** - * User title - * @example "User title" - */ - user_title?: string; - /** - * User comment - * @example "User comment" - */ - user_comment?: string; - /** - * Show legend (default: false) - * @example false - */ - show_legend?: boolean; - }; - map: { - /** - * Map center - * @maxItems 2 - * @minItems 2 - * @example [2683465,1248055] - */ - center: number[]; - /** - * Map scale - * @example 25000 - */ - scale: number; - /** - * Map rotation - * @example 0 - */ - rotation?: number; - /** - * DPI - * @example 300 - */ - dpi: number; - /** Map layers ordered from bottom to top */ - layers: ( - | { - /** WMS layer type */ - type: 'WMS'; - /** - * WMS URL - * @example "https://maps.zh.ch/wms/BASISKARTEZH" - */ - url: string; - /** - * WMS layer names - * @example ["wald","seen","gemeindegrenzen"] - */ - layers: string[]; - /** - * Custom WMS params - * @example {"format":"image/png; mode=8bit","transparent":true} - */ - custom_params?: object; - /** - * Layer opacity - * @min 0 - * @max 1 - * @example 1 - */ - opacity?: number; - /** Map title (for Kartenset only) */ - map_title?: string; - /** - * Mark as background layer (for Kartenset only) (default: false) - * @example false - */ - background?: boolean; - } - | VectorLayer - )[]; +export interface Dataset { + /** UUID */ + uuid: string; + /** Dataset GIS-ZH-Nummer */ + giszhnr: number; + /** Name des Geodatensatzes */ + name: string; + /** Kurzbeschreibung */ + kurzbeschreibung: string; + /** Beschreibung */ + beschreibung: string; + /** eCH Geokategorien / Themen */ + themen: string | null; + /** Schlüsselwörter */ + keywords: string | null; + /** Datengrundlage */ + datengrundlage: string | null; + /** Bemerkungen */ + bemerkungen: string | null; + /** Abgabeformat */ + abgabeformat: string; + /** Anwendungeinschränkung */ + anwendungeinschraenkung: string; + /** Link auf Bild */ + image_url: string | null; + /** Name des PDFs */ + pdf_name: string | null; + /** Link auf PDF */ + pdf_url: string | null; + /** Link auf Geodatashop bei NOGD-Daten */ + url_shop: string | null; + kontakt: { + /** Kontakt: Verantwortlich für Geodaten */ + geodaten: { + /** Amt */ + amt: string; + /** Fachstelle */ + fachstelle: string | null; + /** Sektion */ + sektion: string | null; + /** Vorname */ + vorname: string; + /** Nachname */ + nachname: string; + /** Strassenname */ + strassenname: string; + /** Hausnummer */ + hausnummer: number; + /** Postfach */ + postfach: string | null; + /** PLZ */ + plz: number; + /** Ortschaft */ + ortschaft: string; + /** Telephon */ + telephon: string; + /** Telephon direkt */ + telephon_direkt: string; + /** E-Mail */ + email: string; + /** URL */ + weburl: string; + }; + /** Kontakt: Zuständig für Geometadaten */ + metadaten: { + /** Amt */ + amt: string; + /** Fachstelle */ + fachstelle: string | null; + /** Sektion */ + sektion: string | null; + /** Vorname */ + vorname: string; + /** Nachname */ + nachname: string; + /** Strassenname */ + strassenname: string; + /** Hausnummer */ + hausnummer: number; + /** Postfach */ + postfach: string | null; + /** PLZ */ + plz: number; + /** Ortschaft */ + ortschaft: string; + /** Telephon */ + telephon: string; + /** Telephon direkt */ + telephon_direkt: string; + /** E-Mail */ + email: string; + /** URL */ + weburl: string; + }; + }; + maps: { + /** Map UUID */ + uuid: string; + /** Map GB2-ID */ + gb2_id: number; + /** Topic name */ + topic: string; + /** Kartenname */ + name: string; + }[]; + layers: { + /** Layer GIS-ZH-Nummer */ + giszhnr: string; + /** Layername */ + name: string; + /** Beschreibung des Layers */ + beschreibung: string; + /** Metadaten Sichtbarkeit */ + metadaten_sichtbarkeit: string; + /** Datenbezugart */ + datenbezugart: string; + }[]; + services: { + /** Service UUID */ + uuid: string; + /** Geodaten-Service-Nummer */ + gdsernummer: number; + /** Servicetyp, z.B. WMS, WFS */ + servicetyp: string; + /** Servicename */ + name: string; + }[]; + products: { + /** Product UUID */ + uuid: string; + /** Geodatenprodukt-Nummer */ + gdpnummer: number; + /** Produktname */ + name: string; + }[]; +} + +export type FavoriteContent = { + /** ID of the map */ + id: string; + /** ID of the map */ + mapId: string; + /** Visibility of the map */ + visible: boolean; + /** Opacity of the map */ + opacity: number; + /** Single layer of the map */ + isSingleLayer: boolean; + layers: { + /** ID of the layer */ + id: number; + /** Layer of the map */ + layer: string; + /** Visibility of the layer */ + visible: boolean; + }[]; +}[]; + +export type FavoriteDrawings = VectorLayer; + +export type FavoriteMeasurements = VectorLayer; + +export interface GeojsonFeature { + /** GeoJSON Feature */ + type: 'Feature'; + properties: { + /** + * Reference to style ID in 'styles' + * @example "a" + */ + style: string; + /** + * Text to display if using text marker style + * @example "Label text" + */ + text?: string; + }; + /** GeoJSON geometry object */ + geometry: Geometry; +} + +/** + * GeoJSON FeatureCollection + * @example {"type":"FeatureCollection","features":[{"type":"Feature","properties":{"style":"a"},"geometry":{"type":"Point","coordinates":[2683465,1248055]}}]} + */ +export interface GeojsonFeatureCollection { + /** GeoJSON FeatureCollection */ + type: 'FeatureCollection'; + features: GeojsonFeature[]; +} + +/** GeoJSON geometry object */ +export interface Geometry { + /** + * Type of GeoJSON geometry object + * @example "Polygon" + */ + type: 'Polygon' | 'Point' | 'LineString' | 'MultiPoint' | 'MultiPolygon'; + crs?: GeometryCrs; + /** + * coordinates for GeoJSON geometry object + * @example [[[2681730,1247976],[2680217,1249161],[2680809,1250249],[2681937,1249504],[2681730,1247976]],[[2680836,1249355],[2681554,1249477],[2681327,1248867],[2680836,1249355]]] + */ + coordinates: (number | number[] | number[][] | number[][][])[]; +} + +export interface GeometryCrs { + /** + * GeoJSON crs type + * @example "name" + */ + type: 'name'; + properties: { + /** + * GeoJSON crs name + * @example "EPSG:2056" + */ + name: string; + }; +} + +export interface Map { + /** Map UUID */ + uuid: string; + /** Map GB2-Nummer */ + gb2_id: number; + /** Topic name */ + topic: string; + /** Kartenname */ + name: string; + /** Beschreibung der Karte */ + beschreibung: string; + /** Link auf GB2-Karte */ + gb2_url: string | null; + /** Link auf Bild */ + image_url: string | null; + kontakt: { + /** Kontakt: Verantwortlich für Geodaten */ + geodaten: { + /** Amt */ + amt: string; + /** Fachstelle */ + fachstelle: string | null; + /** Sektion */ + sektion: string | null; + /** Vorname */ + vorname: string; + /** Nachname */ + nachname: string; + /** Strassenname */ + strassenname: string; + /** Hausnummer */ + hausnummer: number; + /** Postfach */ + postfach: string | null; + /** PLZ */ + plz: number; + /** Ortschaft */ + ortschaft: string; + /** Telephon */ + telephon: string; + /** Telephon direkt */ + telephon_direkt: string; + /** E-Mail */ + email: string; + /** URL */ + weburl: string; + }; }; + datasets: { + /** Dataset UUID */ + uuid: string; + /** Dataset GIS-ZH-Nummer */ + giszhnr: number; + /** Name des Geodatensatzes */ + name: string; + /** Kurzbeschreibung des Geodatensatzes */ + kurzbeschreibung: string; + /** Link auf Geodatashop bei NOGD-Daten */ + url_shop: string | null; + }[]; } -export interface PrintFeatureInfoNew { - /** List of query topics */ - query_topics: { - /** - * Topic name - * @example "BASISKARTEZH" - */ - topic: string; +export interface MunicipalityItem { + /** Municipality BFS number */ + bfs_no: number; + /** Municipality name */ + name: string; + /** GeoJSON geometry object */ + boundingbox: Geometry; +} + +export interface Product { + /** Product UUID */ + uuid: string; + /** Product GDP-Nummer */ + gdpnummer: number; + /** Name des Geodatenprodukts */ + name: string; + /** Beschreibung */ + beschreibung: string; + /** Link auf Bild */ + image_url: string | null; + kontakt: { + /** Kontakt: Zuständig für Geometadaten */ + metadaten: { + /** Amt */ + amt: string; + /** Fachstelle */ + fachstelle: string | null; + /** Sektion */ + sektion: string | null; + /** Vorname */ + vorname: string; + /** Nachname */ + nachname: string; + /** Strassenname */ + strassenname: string; + /** Hausnummer */ + hausnummer: number; + /** Postfach */ + postfach: string | null; + /** PLZ */ + plz: number; + /** Ortschaft */ + ortschaft: string; + /** Telephon */ + telephon: string; + /** Telephon direkt */ + telephon_direkt: string; + /** E-Mail */ + email: string; + /** URL */ + weburl: string; + }; + }; + datasets: { + /** Dataset UUID */ + uuid: string; + /** Dataset GIS-ZH-Nummer */ + giszhnr: number; + /** Name des Geodatensatzes */ + name: string; + /** Kurzbeschreibung des Geodatensatzes */ + kurzbeschreibung: string; + /** Link auf Geodatashop bei NOGD-Daten */ + url_shop: string | null; + }[]; +} + +export interface ProductItem { + /** Product ID */ + id: string; + /** Product GISZHNR */ + giszhnr: number; + /** Product AKS type */ + akstype: string | null; + /** Product category - 1 is OGD, 2 is NOGD */ + category: number; + /** Product key */ + key: string | null; + /** Product name */ + name: string; + /** Product type */ + type: 'Vektor' | 'Raster'; + /** Product gesetzklasse */ + gesetzklasse: string; + /** Product geoshopverfahren */ + geoshopverfahren: string; + /** Product keywords as comma-separated list */ + keywords: string | null; + /** Product themes as comma-separated list */ + themes: string | null; + /** Product description */ + description: string; + /** Product service URL */ + service_url: string | null; + /** Product OGD flag */ + ogd: boolean; + /** Product URL for non-OGD products */ + url: string | null; + dataowner: { + /** Product dataowner name */ + name: string; + /** Product dataowner phone */ + phone: string; + /** Product dataowner email */ + email: string; + /** Product dataowner amt */ + amt: string; + /** Product dataowner fachstelle */ + fachstelle: string | null; + }; + /** Available Product formats */ + formats: { + /** Format ID */ + id: number; + /** Format description */ + description: string; /** - * Query layers - * @example ["gemeindegrenzen","adressen","haltestellen"] + * MB per km2 median + * @format float */ - layers: string[]; + mb_per_km2_med: number | null; + /** Fixed size flag */ + is_fixed_size: boolean | null; }[]; - /** - * Query bounding box as minx, miny, maxx, maxy coords (default in EPSG:2056) - * @maxItems 4 - * @minItems 4 - * @example [2683470,1247913,2683480,1247923] - */ - bbox: number[]; - /** - * SRID for query bbox (default: 2056) - * @example 2056 - */ - srid?: number; } +export interface SearchMatch { + displayString: string; + score: number; + /** GeoJSON geometry object */ + geometry?: Geometry; +} + +export interface Service { + /** Service UUID */ + uuid: string; + /** Service GDSer-Nummer */ + gdsernummer: number; + /** Servicetyp, z.B. WMS, WFS */ + servicetyp: string; + /** Name des Geodienstes */ + name: string; + /** Beschreibung */ + beschreibung: string; + /** URL */ + url: string; + /** Version */ + version: string; + /** Zugang */ + zugang: string; + /** Link auf Bild */ + image_url: string | null; + kontakt: { + /** Kontakt: Zuständig für Geometadaten */ + metadaten: { + /** Amt */ + amt: string; + /** Fachstelle */ + fachstelle: string | null; + /** Sektion */ + sektion: string | null; + /** Vorname */ + vorname: string; + /** Nachname */ + nachname: string; + /** Strassenname */ + strassenname: string; + /** Hausnummer */ + hausnummer: number; + /** Postfach */ + postfach: string | null; + /** PLZ */ + plz: number; + /** Ortschaft */ + ortschaft: string; + /** Telephon */ + telephon: string; + /** Telephon direkt */ + telephon_direkt: string; + /** E-Mail */ + email: string; + /** URL */ + weburl: string; + }; + }; + datasets: { + /** Dataset UUID */ + uuid: string; + /** Dataset GIS-ZH-Nummer */ + giszhnr: number; + /** Name des Geodatensatzes */ + name: string; + /** Kurzbeschreibung des Geodatensatzes */ + kurzbeschreibung: string; + /** Link auf Geodatashop bei NOGD-Daten */ + url_shop: string | null; + }[]; +} + +/** Vector layer */ +export interface VectorLayer { + /** Vector layer type */ + type: 'Vector'; + /** GeoJSON FeatureCollection */ + geojson: GeojsonFeatureCollection; + /** Style definitions for features. NOTE: keys are style IDs referenced in feature 'style' property */ + styles: VectorLayerStyles; +} + +/** + * Style definitions for features. NOTE: keys are style IDs referenced in feature 'style' property + * @example {"a":{"pointRadius":15,"fillColor":"#ee3333","fillOpacity":0,"strokeColor":"#ee3333","strokeWidth":3}} + */ +export type VectorLayerStyles = { + /** Style definition based on OpenLayers 2 Symbolizer. NOTE: Style properties are optional. */ + a?: { + /** Fill color of the drawing */ + fillColor?: string; + /** Fill opacity of the drawing */ + fillOpacity?: number; + /** Rotation of the drawing */ + rotation?: string; + /** External graphic of the drawing */ + externalGraphic?: string | null; + /** Graphic name of the drawing */ + graphicName?: string; + /** Graphic opacity of the drawing */ + graphicOpacity?: number | null; + /** Point radius of the drawing */ + pointRadius?: number; + /** Stroke color of the drawing */ + strokeColor?: string; + /** Stroke opacity of the drawing */ + strokeOpacity?: number; + /** Stroke width of the drawing */ + strokeWidth?: number; + /** Stroke linecap of the drawing */ + strokeLinecap?: string; + /** Stroke linejoin of the drawing */ + strokeLinejoin?: string; + /** Stroke dashstyle of the drawing */ + strokeDashstyle?: string; + /** Font color of the drawing */ + fontColor?: string; + /** Font family of the drawing */ + fontFamily?: string; + /** Font size of the drawing */ + fontSize?: string; + /** Font style of the drawing */ + fontStyle?: string; + /** Font weight of the drawing */ + fontWeight?: string; + /** Halo color of the drawing */ + haloColor?: string; + /** Halo opacity of the drawing */ + haloOpacity?: string; + /** Halo radius of the drawing */ + haloRadius?: string; + /** Label of the drawing */ + label?: string; + /** Label align of the drawing */ + labelAlign?: string; + /** Label rotation of the drawing */ + labelRotation?: string; + /** Label X offset of the drawing */ + labelXOffset?: string; + /** Label Y offset of the drawing */ + labelYOffset?: string; + }; +}; + export type TopicsFeatureInfoDetailData = Feature; export type GeneralInfoListData = General; @@ -1092,8 +1172,22 @@ export interface PrintCreateData { report_url: string; } +export interface PrintFeatureInfoCreateData { + /** Link to report file */ + report_url: string; +} + +export interface PrintLegendCreateData { + /** Link to report file */ + report_url: string; +} + export type PrintDetailData = any; +export type ProductsListData = ProductsList; + +export type SearchListData = SearchResultsList; + export type FavoritesListData = SharedFavorite[]; export type FavoritesCreateData = SharedFavorite; diff --git a/src/app/shared/services/apis/gb3/gb3-topics.service.ts b/src/app/shared/services/apis/gb3/gb3-topics.service.ts index e1cbd6de6..ea7309649 100644 --- a/src/app/shared/services/apis/gb3/gb3-topics.service.ts +++ b/src/app/shared/services/apis/gb3/gb3-topics.service.ts @@ -287,8 +287,8 @@ export class Gb3TopicsService extends Gb3ApiService { return { featureInfo: { - x: featureInfo.x, - y: featureInfo.y, + x: featureInfo.east, + y: featureInfo.north, results: { topic: featureInfo.results.topic, metaDataLink: featureInfo.results.geolion_karten_uuid