TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.16k stars 361 forks source link

Why are these CSW record titles repeated? #2227

Open rsignell-usgs opened 7 years ago

rsignell-usgs commented 7 years ago

I'm wondering why certain CSW record titles are repeated, as in this screenshot: 2016-11-16_12-59-36

You can explore this by visiting http://gamone.whoi.edu/terriajs/#https://raw.githubusercontent.com/USGS-CMG/terriajs-dive/master/examples/csw.json

I notice this only on WMS endpoints from THREDDS Data Servers.

kring commented 6 years ago

Sorry to sit on this so long and then ask you this @rsignell-usgs , but... can you still reproduce this? I don't see the Woods Hole CSW at the link above anymore.

ccancellieri commented 4 years ago

Hi all, I'm investigating on some strange behaviour happening when using CSW and I'd like to clarify here what could happen and propose a quick solution: Let me use an image: image

Let me describe the problem:

As you might see we actually have many of those items duplicated in the terriajs catalog. Note also that, while the second link (green line) is working as expected showing a map, the first one (red line) is completely unuseful.

The problem is located here -> terriajs/lib/Models/CswCatalogGroup.js

the check against a generic filter WMS is probably too inclusive in these cases:

(uri.protocol || uri.scheme).match(catalogGroup[f[0]])

manches the 'protocol' twice (since we have 2 WMS items)

In addition to that I see that both the resources are called in the same way (using the resource title) this is done here

Why we are not using the layername or the description if present?

Possible solutions:

  1. Modify metadata to contain only a single getmap url

    • in most cases this is not possible and not desired
  2. Work over the CSW parser

    • Improve that filter matching only working getmap links: WMS-1.?.0-http-get-map
    • Find a better way to name each layer (using layer attributes such as name and or description)
    • Maybe provide some configuration options to template the layer name (f.e.: ${layername:0:15} - ${description:0:25})

Is it reasonable? Any thoughts?

Can we include a fix for this in the next release? I would help you to address this issue soon.

regards, C.

Important notes: The metadata is a ISO 19139 stored over GeoNetwork 3.10.2 vanilla and fetched using CSW group directly by TerriaJS (using an ogc filter by keyword).

ccancellieri commented 4 years ago

I noted that the WMS filter can be changed in the configuration or in the query and it's also a very special case so I focused over the new functionnality: Make item name configurable through Mustache template