You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for reference geometry for geo questions #839
The range type has a similar definition to input and also does not accept List.UI.Common so the changes associated with getodk/xforms-spec#336 / #836 have the same issue:
From the pyxform perspective I think it's also confusing for questions to conditionally behave like selects depending on whether a parameter (tick-labelset or reference-geometry) is present.
So I suggest creating control types for these in the odk namespace (e.g. odk:range, odk:geo or something) since they would not be valid XForms elements anymore. Or if there is a way to achieve the functionality with pulldata or similar (as mentioned in getodk/collect#7118) that might be simpler.
That's ok. We use W3C XForms for inspiration but the ODK XForms spec is clearly separate now. We try not to dramatically change the meaning of existing constructs and here it feels to me like we're broadening an existing concept.
We now have range forms with child itemsets so I don't think we should reconsider the general structure, for better or worse. The client implementations are also complete.
As noted in this PR comment, about the meaning of the reference-geometry token:
[in addition to CSV] It could also be XML or geojson sources -- any named secondary instance -- whether it's internal or external or what the file format is shouldn't matter.
As noted in this commit message which addressed that clarification to allow any file type:
there are also the possibilities of instances generated for
pulldata calls and ${last-saved#q} references, but that parsing code
and logic is in survey.py which would require a larger refactor so
it is excluded from this commit.
So I would like to clarify some things in relation to scope for this feature - should they be supported now, later, or never?
pulldata
Currently not supported. The problem for now would be that a user might have a pulldata call that triggers an auto-generated secondary csv instance, but the validation for reference-geometry won't allow using that instance (because pyxform doesn't know anything about pulldata until the output processing in survey.py), and also because secondary instance names must be unique the user could not work around it by adding a csv-external or similar.
last-saved
Currently not supported. It doesn't work because survey.py looks in specific places (default, choice_filter, anything that ends up in bind) for last-saved references in order to trigger an auto-generated secondary instance for it, and those places do not include the parameters. In other words the nodeset output will look OK but there won't be a matching secondary instance. A user might be able to work around this by including a last-saved reference somewhere that causes there to be a secondary instance.
Question type aliases
Currently not supported. The reference-geometry parameter is only enabled for the primary documented question type names for geo types "geopoint", "geoshape", and "geotrace". But per question_type_dictionary.py there are a few aliases (many of which have been there since the beginning) that currently get resolved in builder.py; and there are some more recent question types that map to geopoint:
For "range" there are no aliases or mapped question types.
Advanced expressions
There is currently no parsing magic or escape hatch etc to allow advanced users to provide a custom nodeset XPath, for example to filter the repeats or secondary instance data.
Activity
lindsay-stevens commentedon Jun 9, 2026
The example XForm (posted here) does the following:
Which is not valid XForms 1.0 since the
inputelement XSD says:But the
itemsetelement is in List.UI.Common rather thanUI.Common.The
rangetype has a similar definition toinputand also does not acceptList.UI.Commonso the changes associated with getodk/xforms-spec#336 / #836 have the same issue:From the pyxform perspective I think it's also confusing for questions to conditionally behave like selects depending on whether a parameter (
tick-labelsetorreference-geometry) is present.So I suggest creating control types for these in the
odknamespace (e.g.odk:range,odk:geoor something) since they would not be valid XForms elements anymore. Or if there is a way to achieve the functionality withpulldataor similar (as mentioned in getodk/collect#7118) that might be simpler.lognaturel commentedon Jun 9, 2026
That's ok. We use W3C XForms for inspiration but the ODK XForms spec is clearly separate now. We try not to dramatically change the meaning of existing constructs and here it feels to me like we're broadening an existing concept.
We now have range forms with child itemsets so I don't think we should reconsider the general structure, for better or worse. The client implementations are also complete.
lindsay-stevens commentedon Jun 18, 2026
As noted in this PR comment, about the meaning of the
reference-geometrytoken:As noted in this commit message which addressed that clarification to allow any file type:
So I would like to clarify some things in relation to scope for this feature - should they be supported now, later, or never?
pulldata
Currently not supported. The problem for now would be that a user might have a pulldata call that triggers an auto-generated secondary csv instance, but the validation for reference-geometry won't allow using that instance (because pyxform doesn't know anything about pulldata until the output processing in survey.py), and also because secondary instance names must be unique the user could not work around it by adding a csv-external or similar.
last-saved
Currently not supported. It doesn't work because survey.py looks in specific places (default, choice_filter, anything that ends up in
bind) for last-saved references in order to trigger an auto-generated secondary instance for it, and those places do not include the parameters. In other words the nodeset output will look OK but there won't be a matching secondary instance. A user might be able to work around this by including a last-saved reference somewhere that causes there to be a secondary instance.Question type aliases
Currently not supported. The reference-geometry parameter is only enabled for the primary documented question type names for geo types "geopoint", "geoshape", and "geotrace". But per question_type_dictionary.py there are a few aliases (many of which have been there since the beginning) that currently get resolved in builder.py; and there are some more recent question types that map to geopoint:
For "range" there are no aliases or mapped question types.
Advanced expressions
There is currently no parsing magic or escape hatch etc to allow advanced users to provide a custom nodeset XPath, for example to filter the repeats or secondary instance data.
lognaturel commentedon Jun 19, 2026
Excluding csv attachments queried by search/pulldata, "fast external itemsets", last-saved and question type aliases all sound right to me.
We'd discussed in the original forum thread using
choice_filterfor that and it looks like it's working as I would expect: https://github.com/XLSForm/pyxform/pull/847/changes#diff-dc5c2adf1e90fb5537c667d9b315109955dc03310e604c94745d6ec2516f2e5bR329