Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(catalog): add catalog composite #559

Merged
merged 11 commits into from Feb 11, 2020
Merged

feat(catalog): add catalog composite #559

merged 11 commits into from Feb 11, 2020

Conversation

hugbe8
Copy link
Member

@hugbe8 hugbe8 commented Jan 23, 2020

Please check if the PR fulfills these requirements

What is the current behavior? (You can also link to an open issue here)

  1. A catalog is only a reflection of its service.
  2. A layer without group does not appear in the wms catalog
  3. The catalog item constructor does not manage nested groups

What is the new behavior?

  1. Configure a catalog from several sources (service: wms, wmts, ...) with the possibility of imposing a group in a catalog call
    feat(catalog): add catalog composite

Guideline:

  • the groups merge on the identifier "id"
  • the layers merge on the identifier "title". On this case:
    • only one layer with same group and same catalogue source is keep
    • an enumeration indicator is used when many layers have the same final group and different origin catalog

Method to use step by step:

  • Repare all catalog call. [Catalog1, Catalog2, Catalog3, ...]
  • Get all groups and layers for each service catalog call. [CatalogItems[], CatalogItems[], CatalogItems[], ...]
  • On the "groupImpose" option, put all the layers flat from a specific catalog in a custom group.
    entrance: [CatalogItems[Group1[layer1, layer2], Group2[layer1, layer4], CatalogItems[], CatalogItems[], ...]
    output: [CatalogItems[GroupImpose[layer1, layer2, layer4], CatalogItems[], CatalogItems[], ...]
  • Concat all CatalogItems in a single array list CatalogItems[]
  • Merge the groups with same id on the first level only.
  • Merge the layers with same title on each group level (as in the guideline).

Config sample:

  "catalog": {
    "sources": [
        {
          id: 'group_impose',
          title: '(composite catalog) group imposed and unique layer title for same source',
          composite: [
            {
              id: 'tq_swtq',
              url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/swtq',
              regFilters: ['zpegt'],
              groupImpose: {id: 'zpegt', title: 'zpegt'}
            },
            {
              id: 'Gououvert',
              url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/igo_gouvouvert.fcgi',
              regFilters: ['zpegt'],
              groupImpose: {id: 'zpegt', title: 'zpegt'}
            },
            {
              id: 'Gououvert',
              url: 'https://geoegl.msp.gouv.qc.ca/apis/ws/igo_gouvouvert.fcgi',
              regFilters: ['zpegt'],
              groupImpose: {id: 'zpegt', title: 'zpegt'}
            },
            {
              id: 'rn_wmts',
              url: 'https://servicesmatriciels.mern.gouv.qc.ca/erdas-iws/ogc/wmts/Cartes_Images',
              type: 'wmts',
              crossOrigin: true,
              matrixSet: 'EPSG_3857',
              version: '1.0.0',
              groupImpose: {id: 'cartetopo', title: 'Carte topo échelle 1/20 000'}
            }
          ]
        },

PrintScreen:
image

  1. The wms layers without group is recover for the catalog
    fix(catalog): get the wms layers without group on first level of catalog

  2. Nested groups are retrieved by the catalog builder
    fix(catalog): recursive loop on wms groups on prepare object for catalog.
    N.B: the fix for display the items is not yet applied

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications:

Other information:
The composite catalog is based on the design pattern composite

hbernard added 6 commits Jan 22, 2020
fix(catalog): get the wms layers without group on first level of catalog
fix(catalog): recursive loop on wms groups on prepare object for catalog. N.B: the fix on the display is not yet applied
@hugbe8
Copy link
Member Author

hugbe8 commented Jan 27, 2020

refer to issues:
Resolved: #566, #565
Unresolved: #564

@mbarbeau mbarbeau merged commit 2d729fc into master Feb 11, 2020
@mbarbeau mbarbeau deleted the compositeCatalog branch Feb 11, 2020
@hugbe8 hugbe8 mentioned this pull request Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants