Default geopoint in Southern Hemisphere?

Hi,

I’m having a problem setting the default map view on a geopoint question.

In the survey tab of my XLSForm I have used a default column to set the default by including 4 space-separated values: latitude, longitude, altitude, accuracy.
This works fine as long as both latitude and longitude are positive values, e.g. 12.18714 96.830564 0.0 0.0

However, I need the map default to be in the Southern Hemisphere, at -12.18714 96.830564 0.0 0.0
Whenever I use a negative value for lat or long, the geopoint question does not load, and if I try to Deploy the form I get the following error:

your form cannot be deployed because it contains errors:

Unexpected KoBoCAT error 400: b’{“detail”:“ODK Validate Errors:\n>> XForm is invalid. See above for the errors.\n: Invalid XPath in value set action declaration: '- 12.18714 96.830564 0.0 0.0'\n Problem found at nodeset: /html/body/group[@ref=${grp_location}]/group[@ref=${location_data}]/repeat[@count= ${location_data_count} ][@nodeset=${location_data}]/setvalue\n With element \n\n\nThe following files failed validation:\n${tmpuw21seg4}\n\nResult: Invalid”}’

Is this a bug, or am I using incorrect syntax or something?

Thanks!

Seems you have a blank after the - ? Remove it, please.

1 Like

@BecSCS, this post discussed previously should help you solve your issue:

Hi Wroos, I removed the space, same error unfortunately.

Thanks Kal - this was the post that got me to where I am now.

As noted above, this works fine as long as both latitude and longitude are positive values, e.g. the hypotheticals you gave. If I use a negative latitude I get the error.

I followed the discussions from that post and searched the forums and only found examples using positive lat/long values, which is why I posted the issue here.

1 Like

Hello @BecSCS,
Could you share an extract (or screenshot) of the related part of your form, please?

1 Like

geopoint_default_test.xlsx (12.5 KB)

Hi again @wroos, I’ve attached an extract with the same question twice, only difference being the negative latitude… screenshot shows the survey preview.

Many thanks for your help!

Hello @BecSCS,
It seems a problem/bug of KoBoToolbox. (@Kal_lam, @Josh). The geopoint field even is shown as a simple text variable (see widget). Maybe the default is not parsed correctly, if it includes any “-” sign (either for latitude or for longitude!). The form will open in preview, but deployment will stop with an error.

As far as I can see, it works with the Online validator (Enketo). See screenshot at the end here.
.
As workaround in KoBoToolbox you could use a calculation - with once(…) - instead of the default, see example
geopoint_default_03.xlsx (10.4 KB)
This will work, see lower part of the following screenshot.:

.

The next screenshot from Online validator shows that even the default is working there.

.

Further hint: You can import the XLSForm and it shows7stores the default in the KoBo FormBuilder, but the problem is the same on preview and deployment.

1 Like

Wonderful, thanks @wroos for the workaround, as we’ll need to run offline.

Whilst we’re here… do you happen to know whether it’s possible to specify satellite as the default map view?

Offline with Collect (preferable ODK)? Probably even the default works with Collect. Would you mind to test it and give feedback here, please?

In Collect app you can configure the map style in the settings, e.g. google satellite or hybrid. In Enketo, there is also an appearance option satellite for geopoint etc., see XLSForm Reference Table. So, you can it it to the appearance as: satellite placement-map. It will show up in KoBo/Enketo, but not in the Online validator.
image

Furthermore, you can also change to satellite mode etc. with the Earth icon on the map.

Maybe someone form the community or Core Team can explain more help for the satellite option…

1 Like

We’re still in the process of designing surveys, haven’t yet bought tablets or decided which app / collection method we’re going to use. Good to know that this should work with the Collect app. Will need to be offline as there is no phone signal at field survey locations.

Thanks heaps for your help with this!

1 Like

I just found another restriction which might be interesting

1 Like