meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
jolla2014:group7:start [2014/03/05 19:30] 3_fishermen |
jolla2014:group7:start [2014/03/06 11:48] (current) 3_fishermen |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Welcome to Wiki Page of Group 7. In this page, you will find everything you need to know about our **" | + | \\ |
+ | //Welcome to Wiki Page of Group 7. In this page, you will find everything you need to know about our **" | ||
\\ | \\ | ||
\\ | \\ | ||
Line 20: | Line 21: | ||
\\ | \\ | ||
\\ | \\ | ||
- | To help the user determine the quality of the apartment, we calculate a rating (from 1 to 5 stars)based on the distance criteria. The nearest the distance from the 7 places, the higher the rating will be. If distance is within 300 meters, score will be 5 star. Within 500 meters, score will be 4 stars. Within 700 meters, score will be 3 stars. Within 1 km, score will be 2 stars. And lastly, within | + | To help the user determine the quality of the apartment, we calculate a rating (from 1 to 5 stars)based on the distance criteria. The nearest the distance from the 7 places, the higher the rating will be. If distance is within 300 meters, score will be 5 star. Within 500 meters, score will be 4 stars. Within 700 meters, score will be 3 stars. Within 1 km, score will be 2 stars. And lastly, within |
\\ | \\ | ||
\\ | \\ | ||
Line 53: | Line 54: | ||
\\ | \\ | ||
\\ | \\ | ||
- | ====== Codes ====== | + | ====== |
+ | **Retrieval of Coordinate of an address** | ||
< | < | ||
- | < | ||
- | <place place_id="59553626" | + | QString urlString |
- | </searchresults> | + | |
+ | //Getting the XML for the user's address | ||
+ | manager | ||
+ | reply = manager-> | ||
+ | QEventLoop loop; | ||
+ | connect(reply, | ||
+ | loop.exec(); | ||
+ | |||
+ | |||
+ | //Parsing the XML to get the coordinate of the user's address | ||
+ | QDomDocument *doc = new QDomDocument(); | ||
+ | doc-> | ||
+ | |||
+ | |||
+ | //Get the root element | ||
+ | QDomElement docElem = doc-> | ||
+ | QDomNodeList nodeList = docElem.elementsByTagName("place"); | ||
+ | |||
+ | //Check each node one by one. | ||
+ | //for(int ii = 0;ii < nodeList.count(); | ||
+ | for(int ii = 0;ii < 1; ii++) | ||
+ | QString urlString = | ||
+ | |||
+ | //Getting the XML for the user's address | ||
+ | manager = new QNetworkAccessManager(this); | ||
+ | reply = manager-> | ||
+ | QEventLoop loop; | ||
+ | connect(reply, SIGNAL(finished()), | ||
+ | loop.exec(); | ||
+ | |||
+ | |||
+ | //Parsing the XML to get the coordinate of the user's address | ||
+ | QDomDocument *doc = new QDomDocument(); | ||
+ | doc-> | ||
+ | |||
+ | |||
+ | //Get the root element | ||
+ | QDomElement docElem = doc-> | ||
+ | QDomNodeList nodeList = docElem.elementsByTagName("place" | ||
+ | |||
+ | //Check each node one by one. | ||
+ | //for(int ii = 0;ii < nodeList.count(); | ||
+ | for(int ii = 0;ii < 1; ii++) | ||
+ | { | ||
+ | QDomElement el = nodeList.at(ii).toElement(); | ||
+ | latit = el.attribute("lat" | ||
+ | longit = el.attribute(" | ||
+ | } | ||
+ | |||
+ | setLatLong(latit+"|"+longit); | ||
+ | |||
+ | </ | ||
+ | \\ | ||
+ | **Find parameters (bus stops,shops,atm,university,city center, restaurant, and hospitals) closest to the address** | ||
+ | < | ||
+ | //within 500m | ||
+ | //1. Getting ATM list | ||
+ | QString atmString = " | ||
+ | atmString | ||
+ | //Getting the XML | ||
+ | // | ||
+ | reply = manager-> | ||
+ | connect(reply, | ||
+ | loop.exec(); | ||
+ | |||
+ | doc-> | ||
+ | //Get the root element | ||
+ | docElem = doc-> | ||
+ | nodeList = docElem.elementsByTagName("node" | ||
+ | if (nodeList.count()> | ||
+ | // | ||
+ | theATM.score = "4"; | ||
+ | theATM.distance=" | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | QDomElement el = nodeList.at(ii).toElement(); | ||
+ | |||
+ | atmResult = atmResult+" | ||
+ | } | ||
+ | atmResult=atmResult+" | ||
+ | atmResulti=4; | ||
+ | |||
+ | </code> | ||
+ | \\ | ||
+ | **Rate the place** | ||
+ | < | ||
+ | totalz = totalz+atmResulti + municipalityResulti+restaurantResulti + busStopResulti + universityResulti+ smarketResulti + hospitalResulti; | ||
+ | totalz=qRound(totalz/ | ||
</ | </ | ||
\\ | \\ | ||
Line 75: | Line 167: | ||
====== Report ====== | ====== Report ====== | ||
Read this to get a detailed explanation: | Read this to get a detailed explanation: | ||
- | {{: | + | {{: |
\\ | \\ | ||
\\ | \\ | ||
====== Poster ====== | ====== Poster ====== | ||
{{: | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | ====== Application ====== | ||
+ | You can download our application here:\\ | ||
+ | [[https:// | ||
\\ | \\ | ||
\\ | \\ | ||
====== Source Code ====== | ====== Source Code ====== | ||
You can download our source code here:\\ | You can download our source code here:\\ | ||
- | [[https:// | ||
[[https:// | [[https:// | ||
- | |||
- | |||