Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Lime Survey Geo Spatial Suggestion

Lime Survey Geo Spatial Suggestion 3 Jahre 1 Monat her #65992

  • lobsang
  • lobsangs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Dank erhalten: 1
  • Karma: 1
On a few occasions we've had a need to map survey respondents by geographic location. (The examples below are regional ICT and telecommunication studies)

This is achieved by asking them their town/region during the survey - and then all new survey responses are geocoded

This allows all responses to be shown on a map directly from the Lime Survey database (With Google Maps and Google charts integration)
Users can then select different questions from the menus - and the markers are updated dynamically. (eg: Internet questions -> Internet Reliability)

eg: (All markers and ajax are extracted dyanmically from the Lime Survey database
Using Google charts also seems much faster than the built in Lime Survey reports)

www.cecc.com.au/grampians_map.php
www.cecc.com.au/gsc_map.php
www.cecc.com.au/moorabool_map.php
www.cecc.com.au/yarra_map.php



At the moment this is achieved by some minor alterations to the Lime Survey database (Adding lat/lng to response table)- and some code to geocode and graph the responses (As is designed with a particular set of questions in mind) - so setup is manual and requires a little bit of coding.

But it could be a very handy extension to Lime Survey for research surveys to visualise data.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Lime Survey Geo Spatial Suggestion 3 Jahre 1 Monat her #65994

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6472
  • Dank erhalten: 855
  • Karma: 254
lobsang schrieb:
But it could be a very handy extension to Lime Survey for research surveys to visualise data.
Did yu have a look to:
docs.limesurvey.org/Question+type+-+Shor...#Use_mapping_service

( no documentation actually, to be done).

Maybe need some optimisation for adress search for example, but it's here.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Lime Survey Geo Spatial Suggestion 3 Jahre 1 Monat her #66012

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5351
  • Dank erhalten: 299
  • Karma: 250
lobsang schrieb:
At the moment this is achieved by some minor alterations to the Lime Survey database (Adding lat/lng to response table)- and some code to geocode and graph the responses (As is designed with a particular set of questions in mind) - so setup is manual and requires a little bit of coding.
As shnoulle pointed out such a geo location question type already exists, it stores that lat and lng data.
Mapping that data to a Google Map at the browse response option is missing AFAIK. Would be nice if you could share your solution so we can add it. Have a look at docs.limesurvey.org/How+to+contribute+new+features

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Lime Survey Geo Spatial Suggestion 3 Jahre 1 Monat her #66147

  • lobsang
  • lobsangs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Dank erhalten: 1
  • Karma: 1
Unfortunately I haven't extended Lime Survey as such (So contributing directly via svn isn't an option unless its refactored) - I've created a stand alone map class with all the SQL functions I need.

This differs from the "Use mapping service" question type - in that users are not asked to put their location on a map - it is automatically geocoded from their response to a town/city question. (Usually a select box)

I don't know how much of this is useful for you - but in general terms- this is what was done:

- Created table "lime_geo" with the following fields
sid rid lat lng
Survey ID , Response Id, Latitude, Longitude

- For each survey - define what the geo question is for that survey (Usually acity, but sometimes a region - "What town do you live in?") - and the corresponding response field
eg:
define('CITY_RESPONSE_FIELD',"41781X34X1350");
define('CITY_QUESTION_ID','1350');
(All surveys had an applicable list of all cities and town imported for the region they were surveying as responses for that question)

- Create an SQL INDEX on the response field to queries are efficient

- Every time the map is loaded- it searches for any responses with lat/lng - then geocodes them based on their response to the geo question (This could be cron scheduled- or run manually. It can also be disabled once the survey is finished )

- The lime geo table is then used to provide a json response for any request (So that different questions can be displayed on the map)
eg: ajax/grampians_map_json.php?question_id=1375

- The json is loaded by javascript/jquery - which is reasonably straight forward , but you can view the source from those links
eg: www.cecc.com.au/maps/grampians_map.js

The json response also includes the url for the Google Charts pie chart marker
eg:
{"city":"Yarriambiack Shire Council","city_code":"13","question_id":1373,"lat":"-36.253202","lng":"142.402596","chart_url":"http:\/\/chart.googleapis.com\/chart?cht=p&chs=100x100&chd=t:5,13,21,34,15,6&chco=33FF33|88FF88|BBFFBB|FFCC00|FF3300|333333&chf=bg,s,ffffff00|a,s,00000099","num_responses":"94","legend_chart_url":"http:\/\/chart.googleapis.com\/chart?cht=p3&chs=300x50&chd=t:1,1,1,1,1,1&chco=33FF33|88FF88|BBFFBB|FFCC00|FF3300|333333&chl=Excellent|Very good|Good|Fair|Poor|No Answer&chf=bg,s,ffffff00|a,s,000000aa","map_name":"How would you rank the quality of mobile phone coverage in your local government area?"}
www.cecc.com.au/ajax/grampians_map_json...._type=mobile_quality

Specific things to my solution
- Local Government Areas (LGA's) - have their location hardcoded - and have an associated KML file - this would not work worldwide

Since every town belongs to an LGA - this allows different levels of clustering - cluster results by town, or cluster by LGA (This could expand to state/country etc)
www.cecc.com.au/grampians_map.php

- The colour code pie chart scales are based on a very specific range of questions - and may not make sense if applied to any question (eg: Do the responses go from Good -> Bad, or Bad -> Good - or neither, 1-5, 1-7 ?)

- Colours are also hardcoded- they'd be better off customisable in the database
eg:
$COLOR_SCALES [5]= array("FF3300","FFCC00","BBFFBB","88FF88","33FF33");

- The jquery dialog- is focused on a specific set of 4 question groups

- There are some hardcoded question names to stop them displaying on the map when they don't make sense.

- Theres a bit of fuzzy logic to look for certain words in surveys and abbreviate them to they fit on the map/graphs
Letzte Änderung: 3 Jahre 1 Monat her von lobsang.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Lime Survey Geo Spatial Suggestion 3 Jahre 1 Monat her #66152

  • lobsang
  • lobsangs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Dank erhalten: 1
  • Karma: 1
Hmm - I cant edit that post - anyway - what I meant to add was:
This differs from the "Use mapping service" question type - in that users are not asked to put their location on a map - it is automatically geocoded from their response to a town/city question. (Usually a select box)

This allows aggregation of responses by city/region/state etc (To see the differences in responses between areas) - whereas letting users select their exact lat lng might mean all responses are in a unique location - and no aggregation is possible.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Lime Survey Geo Spatial Suggestion 3 Jahre 1 Monat her #66163

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5351
  • Dank erhalten: 299
  • Karma: 250
Wow, this looks quite complex but might be useful for others. Can you open a ticket at our bugtracker at the "user patches" section and add this information plus your files there so other can also play around with it!? Because the forum posts are wiped out about once a year and it would be a pity to loose your explanations so the bugtracker is the better place.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Lime Survey Geo Spatial Suggestion 2 Jahre 7 Monate her #76641

  • nidele
  • nideles Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 18
  • Karma: 0
for environment issues (mobility managment) i try to use the new version of limesurvey with geografic question but i think it could be improved.

i want to put an address and the system geocode this address in lat/long

some italian consultant have try to use a trick with php extentions and limesurvey but if there is a native geocoding in limesurvey it could be useful for many issues

i think also at the experiense of ushahidi
ushahidi.com/
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Lime Survey Geo Spatial Suggestion 2 Jahre 7 Monate her #76676

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6472
  • Dank erhalten: 855
  • Karma: 254
Maybe a solution with cloudmade.com and/or www.openlayers.org/ can be a solution too.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Ladezeit der Seite: 0.302 Sekunden
Donation Image