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

Add an option to flatten Esri catalog groups rather than arranging items in sub-groups #725

Open meh9 opened 9 years ago

meh9 commented 9 years ago

It would be great to be able to use the "flatten" property on "esri-mapServer-group"s just like we can on "wms-getCapabilities" groups. That would make configs like the following look much better in the data catalogue:

        {
          "name": "DNI Mean 1990 - 2011",
          "type": "esri-mapServer-group",
          "url": "http://www.ga.gov.au/gisimg/rest/services/energy/Solar_Energy_DNI_Mean/MapServer",
          "flatten": true
        },
        {
          "name": "GHI Mean 1990 - 2011",
          "type": "esri-mapServer-group",
          "url": "http://www.ga.gov.au/gisimg/rest/services/energy/Solar_Energy_GHI_Mean/MapServer",
          "flatten": true
        }
chloeleichen commented 8 years ago

hi @meh9 , would you please give me a bit more details: what is this flatten property supposed to do? Also how can I test it?

meh9 commented 8 years ago

The flatten property flattens the structure of automagically loaded groups.

To illustrate and help you with testing I made an init file you can drag and drop in a Terria app (NM, AREMI, etc) that shows the different behaviour:

https://gist.github.com/meh9/3fe0d2474d815e64b9e1

chloeleichen commented 8 years ago

Thanks @meh9 :+1:

stevage commented 8 years ago

Just a thought: in terms of consistency with other CatalogGroup types (eg Ckan and Socrata), the way to express this might be:

"groupBy": "none"

chloeleichen commented 8 years ago

had a try using "groupBy": "none" but it doesn't seem to flatten the data.

Created branch issue725 to port the property, please let me know if you have any other ideas @stevage

stevage commented 8 years ago

Sorry, I meant, instead of calling the property "flatten", calling it "groupBy" with those semantics. We have a bit of a problem with similar properties being implemented on many different catalog items, with not enough inheritance.

chloeleichen commented 8 years ago

Using groupBy instead of flatten. When groupBy === "none", then the structure of the group is flattened.

@stevage , would you like me to change the existing flatten property of wms-getCapabilities into groupBy as well?

stevage commented 8 years ago

That would break any existing sites that use "flatten". Let's talk with @kring when he's back.

stevage commented 8 years ago

Hey, @kring is back now. What do you think?

kring commented 8 years ago

groupBy sounds fine. We can support backward compatibility by using the defaultUpdaters thing.