Reference catalogs with files, not with directories.
Describe the feature
A catalog reference is described by the catalogName
and the item (entryName
) in the catalog with this name:
<xsd:complexType name="CatalogReference">
...
...
<xsd:attribute name="catalogName" type="String" use="required"/>
<xsd:attribute name="entryName" type="String" use="required"/>
</xsd:complexType>
When resolving a catalog item, the only hint where to find it ate the directories defined in Catalog
. We might guess the type of the item and use one of those directories defined:
<xsd:complexType name="Catalog">
<xsd:sequence>
<xsd:element name="Vehicle" type="Vehicle" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Controller" type="Controller" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Pedestrian" type="Pedestrian" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="MiscObject" type="MiscObject" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Environment" type="Environment" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Maneuver" type="Maneuver" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Trajectory" type="Trajectory" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Route" type="Route" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="name" type="String"/>
</xsd:complexType>
The problem is that any file in a given directory can contain the catalog with the name catalogName
.
So basically every file in this directory must be parsed until the right catalogName
/entryName
pair is found.
- Some may not even be OSC catalog files. You might try to parse it anyway as you cannot see this file is not an OSC file from the filename.
- Multiple
catalogName
/entryName
pairs might be present in different files. So, the arbitrary first occurance has to be taken or all files in a directory have to be parsed to issue that there are multiple occurances. - As the catalog reference does not make clear which type it expects (e.g. a vehicle or a pedestrian) multiple directories may have to be searched.
When implementing a OSC Reader (that's what we are doing) it is very inefficient to process any file in a directory instead of an exact file. Further, it is not very clear how to report errors that occur in files that might not be needed to resolve the reference. They might either not an OSC file or they are OSC files with errors but might not be needed to be parsed.
Describe the solution you would like
Add an optional attribute "filename" to the type CatalogReference
. With this you define the reference to the exact file to be searched.
Describe alternatives you have considered
Please feel free to add alternatives.
Describe the backwards compatibility
An optional attribute "filename", since this approach makes it downward compatible to OSC 1.0. It may be defined in 1.x (and then helps) or not (and then it is inefficient).