Skip to content

Commit

Permalink
feat(dh): handle ogc api types
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Dec 21, 2023
1 parent 73998bf commit 2e6c0b6
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export function matchProtocol(protocol: string): ServiceProtocol {
if (/wfs/i.test(protocol)) return 'wfs'
if (/wmts/i.test(protocol)) return 'wmts'
if (/wps/i.test(protocol)) return 'wps'
if (/ogc\W*api\W*features/i.test(protocol)) return 'ogcFeatures'
if (/esri/i.test(protocol)) return 'esriRest'
return 'other'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ describe('Gn4FieldMapper', () => {
'link',
'link',
'download',
'service',
])
})
})
Expand Down
3 changes: 2 additions & 1 deletion libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ export class Gn4FieldMapper {
(/^ESRI:REST/.test(protocol) && /FeatureServer/.test(url)) ||
/^OGC:WMS/.test(protocol) ||
/^OGC:WFS/.test(protocol) ||
/^OGC:WMTS/.test(protocol)
/^OGC:WMTS/.test(protocol) ||
/ogc\W*api\W*features/i.test(protocol)
) {
return 'service'
}
Expand Down
1 change: 1 addition & 0 deletions libs/common/domain/src/lib/model/record/metadata.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export type ServiceProtocol =
| 'wps'
| 'wmts'
| 'esriRest'
| 'ogcFeatures'
| 'other'

export type DatasetDistributionType = 'service' | 'download' | 'link'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,9 @@ export const ES_LINK_FIXTURES: Record<string, unknown> = deepFreeze({
name: 'Vue HTML des métadonnées sur internet',
url: 'http://catalogue.geo-ide.developpement-durable.gouv.fr/catalogue/srv/fre/catalog.search#/metadata/fr-120066022-jdd-199fd14c-2abb-4c14-b0f8-6c8d92e7b480',
},
geodataogcfeatures: {
protocol: 'OGC API - Features',
name: 'ogcapi features layer',
url: 'https://mel.integration.apps.gs-fr-prod.camptocamp.com/data/ogcapi/collections/comptages_velo/items?',
},
})
7 changes: 7 additions & 0 deletions libs/common/fixtures/src/lib/link.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,11 @@ export const LINK_FIXTURES: Record<string, DatasetDistribution> = deepFreeze({
'http://catalogue.geo-ide.developpement-durable.gouv.fr/catalogue/srv/fre/catalog.search#/metadata/fr-120066022-jdd-199fd14c-2abb-4c14-b0f8-6c8d92e7b480'
),
},
ogcApiFormat: {
name: 'ogc api features layer',
type: 'service',
url: new URL(
'https://mel.integration.apps.gs-fr-prod.camptocamp.com/data/ogcapi/collections/comptages_velo/items?'
),
},
})
1 change: 1 addition & 0 deletions libs/feature/record/src/lib/state/mdview.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as MdViewSelectors from './mdview.selectors'
import { LinkClassifierService, LinkUsage } from '@geonetwork-ui/util/shared'
import { DatavizConfigurationModel } from '@geonetwork-ui/common/domain/model/dataviz/dataviz-configuration.model'
import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record'
import { BehaviorSubject } from 'rxjs'

@Injectable()
/**
Expand Down
2 changes: 2 additions & 0 deletions libs/util/shared/src/lib/links/link-classifier.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class LinkClassifierService {
case 'wms':
case 'wmts':
return [LinkUsage.API, LinkUsage.MAP_API]
case 'ogcFeatures':
return [LinkUsage.API]
default:
return [LinkUsage.UNKNOWN]
}
Expand Down

0 comments on commit 2e6c0b6

Please sign in to comment.