Preload multiple polygons and display them in the odk collection application

I have a database identified by an identification number and I want to preload the polygons so that they are displayed in the application, with the selected-at function I use it, but since the coordinates have ; I get an error. Is there any other way to preload these coordinates? @Sadiq_Khoja

when loading the template I get this error and when loading .csv the polygons are not displayed in the application, I don't know where the error would be, If you could help me I appreciate it.

productores.csv (410 Bytes)
productores.xlsx (437.7 KB)

Hi @Daniel_Zota,

I was able reproduce the error that's there in your screenshot. It looks like there is some issue with using pulldata for setting calculated values of geo types.

I have updated your Form definition and csv file for the following corrections and workaround:

  • Corrected the position of quotation marks in your csv file.
  • Changed the calculate of 'poligono' to use List lookups
    formula instead of pulldata, for that I had to include a hidden select_one_from_file question with relevance=false and custom value/label parameters.
  • Changed the type of 'trazo_pol' to geoshape since you have polygon in your dataset - this is optional, you can revert this back to geotrace if not all of the datapoints in your dataset are polygons

productores.xlsx (438.0 KB)
productores.csv (404 Bytes)

1 Like

Hi, @Sadiq_Khoja Thank you for the answer, I have one last question if in the CED field, the person has more than two (2) polygons, how could these two fields of IDs be visualized, on different maps. I share with you the file column c: CERTIFICATE (the duplicate ID cards are highlighted in red) I thank you very much for your collaboration and explanation of the error.
24.10_socodevi_ODK.xlsx (151.3 KB)

You can use repeat with its repeat_count equal to the number of matching rows in your dataset. For example: count(instance('soccodevi')/root/item[{CEDULA=${cedula}]).

In the repeat you can add geoshape to show each matching polygon. Calculate would look something like instance('soccodevi')/root/item[{CEDULA=${cedula}][position(..)]/Coordenadas

1 Like