I have a properties file I'm using for GIS software. You have a feature like a road, then properties under it, like so:
{
"road": {
"colour": "rgb(0,0,0)"
},
"railway": {
"colour": "rgb(100,100,100)"
}
}
Now I need to group these into categories, for example, transportation. The first thing I thought of was:
{
"transportation":
{
"road": {
"colour": "rgb(0,0,0)"
},
"railway": {
"colour": "rgb(100,100,100)"
}
}
}
This makes things awkward when I want to access "road" (for example), because now I need to know it is under "transportation" (mind you I could always write a helper function to eliminate this). Further, "road" could be under multiple groups, perhaps "transportation" and "public works". Now I would need to duplicate the properties in both instances.
Would I be wiser to use the following format, or is there a better way to do this?
{
"road": {
"colour": "rgb(0,0,0)",
"group": ["transportation"]
},
"railway": {
"colour": "rgb(100,100,100)",
"group": ["transportation"]
}
}