Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Interactive Map - Evaluation in GIS

  • VKTDresden
  • VKTDresden's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago #208381 by VKTDresden
Interactive Map - Evaluation in GIS was created by VKTDresden
Hey all,

at Limeysurvey I use the Interactive Map Question to ask for important activity locations of participants. To create a kind of heatmap, I want evaluate it with GIS. Unfortunately the coordinates in the exported CSV file from LimeSurvey are separated in one column and by semicolon. How is it possible to export longitude and latitudeaus separately from LimeSurvey and calculate with them in GIS (e.g. QGIS)? Unfortunately I could not find any entry related to this topic in the forum.

Thank you very much and greetings
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208383 by Joffm
Replied by Joffm on topic Interactive Map - Evaluation in GIS
Hi,
you can use two questions of type "equation" to split the string, one for longitude, one for latitude.
Use the functions "substr" and "strpos".

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • VKTDresden
  • VKTDresden's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago #208396 by VKTDresden
Replied by VKTDresden on topic Interactive Map - Evaluation in GIS
Thank you for this quick answer and the useful advice I needed.

Further information related to this I found under forums.limesurvey.org/forum/can-i-do-thi...uestion-as-variables
The topic has been locked.
  • VKTDresden
  • VKTDresden's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago - 3 years 4 months ago #208559 by VKTDresden
Replied by VKTDresden on topic Interactive Map - Evaluation in GIS
I have one more question about the correct implementation of the equations.
In the survey logic I get an error message "questions contain warnings that need to be verified.“

Here is an example for the implementation in Lime

Code: A10110 Map Question to get the point of interest
Code: A10111 (Eq) {strpos(A10110.NAOK,";",0)}
Code: A10112 (Eq) {substr(A10110.NAOK,0,A10111.NAOK)}
Code: A10113 (Eq) {substr(A10110.NAOK,A10111.NAOK+1)}

In the last line with the code A10113 the "+" sign is marked red. But during testing the survey I get longitude and latitude separately in colums. Also the import into GIS works. Does anyone know the reason for the logic error?
Last edit: 3 years 4 months ago by VKTDresden.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208562 by Joffm
Replied by Joffm on topic Interactive Map - Evaluation in GIS
It's usually not an error, but a warning.
If you hover the sign, you see


and in the logic file


And this is the paragraph in the manual

Warning with plus operator (+)

For consistency between JavaScript and PHP, the plus operator (+) does addition if both operands are numeric, but does concatenation if both parts are non-numeric strings. However, we recommend using the join() function for concatenation and sum() function for addition, as that makes your intent more clear, and avoids unexpected results if you were expecting strings but got numbers instead (or vice versa).


You know, the "+" is used to concatenate strings, too.

Therefore, if you do not take care, you might get
"12" + "1" : "121"

But I never got a false result using the "+" sign in this (your) context.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208581 by holch
Replied by holch on topic Interactive Map - Evaluation in GIS
It is always good to provide a screenshot with the error message (just like Joffm did) or even better: a LSS-file with just the relevant portion of the survey:
Code:
Code: A10113 (Eq) {substr(A10110.NAOK,A10111.NAOK+1)}

Shouldn't this be rather:
Code:
Code: A10113 (Eq) {substr(A10110.NAOK,A10111.NAOK)+1}

Not sure though, just a guess.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208583 by Joffm
Replied by Joffm on topic Interactive Map - Evaluation in GIS
Now I read again, and...

In the survey logic I get an error message "questions contain warnings that need to be verified.“

Please do not say, you got an "error message", if the message itself says "... contain warnings...".

As I said before, it's just a warning to take care.

And @holch.
Should not.
This is correct.
{substr(A10110.NAOK,A10111.NAOK+1)}
A10111.NAOK is the index of the colon. The substring of A10110 starts one index after the ";".



Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: holch
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208585 by holch
Replied by holch on topic Interactive Map - Evaluation in GIS

And @holch.
Should not.
This is correct.

Thanks for clarifying. Just saw your screenshot and there the "+" seems ot be outside the "()", which is why I guessed.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • VKTDresden
  • VKTDresden's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208586 by VKTDresden
Replied by VKTDresden on topic Interactive Map - Evaluation in GIS
Yes, it was not the correct expression. This is only a warning. In the future I will include screenshots in my posts.

As a new user of Limesurvey, you must first acquire a certain basic knowledge. The posts in the forum are very helpful in addition to the manual. So, thanks for answering!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose