[Clock] [Weather] Return more fine-grained territorial divisions for city search results

Bug #1230153 reported by David Planella
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu Clock App
Fix Released
Medium
Nekhelesh Ramananthan
Ubuntu UX
Fix Released
Medium
Unassigned
Ubuntu Weather App
Fix Released
Medium
Martin Borho

Bug Description

Both the Weather and Clock app feature functionality to add a city to provide data for. The workflow or adding the city via a search is the same, and we should also unify the data provider.

We want to ensure we provide results that are fine-grained enough in terms of territorial divisions that duplicate names of cities can be differentiated from each other. That is, the data we get should enable us to fix bug 1226834.

So far we've been considering:

- Geonames.org (used by clock already)
- Mapquest

We've come to the conclusion to use geonames.org. This will mean:

- For Clock: add at least adminName2 from geonames.org when we get duplicate results
- For Weather: add adminName1 and at least adminName2 from geonames.org when we get duplicate results

[1] See the results for a duplicate UK city, where adminName2 provides the http://api.geonames.org/search?username=uweatherdev&q=Farnborough&style=full

Related branches

David Planella (dpm)
Changed in ubuntu-clock-app:
status: New → Triaged
importance: Undecided → Medium
Changed in ubuntu-weather-app:
status: New → Triaged
importance: Undecided → Medium
description: updated
Revision history for this message
David Planella (dpm) wrote :

I'm leaning more towards geonames.org since:

- It's a service used widely in Ubuntu already: in the installer and the time indicator
- Being used in Ubuntu means that the usage and license of the data should already be taken care of
- The service has proven to be reliable for Ubuntu so far
- The data we're missing to make duplicate results distinctive is available in geonames.org, we just need to display it (this needs testing, but I believe we need only adminName2 or adminName3)

Revision history for this message
David Planella (dpm) wrote :

- Geonames.org provides localized results as well

Changed in ubuntu-clock-app:
milestone: none → hack-days-1309
Revision history for this message
David Planella (dpm) wrote :

Ok, it seems after a chat with Martin from the Weather team, geonames.org provides all the data we need already, it's simply that we were not showing adminName2 and adminName3. Here's an example of the output:

http://api.geonames.org/search?username=uweatherdev&q=Aichhalden&style=full

So in summary, we've agreed to use geonames.org for both apps.

Revision history for this message
Martin Borho (martin-borho) wrote :

Geonames returns with the "style=full" params everything is needed, so it would also fit for the weather app. Perhaps we should try to filter out some <fcode> or <fcodeName> to get a cleaner result set, but thats a minor caveat:

http://api.geonames.org/search?username=uweatherdev&q=Buxtehude&style=full

So, for me it looks now also more suitable as MQ.

Changed in ubuntu-weather-app:
assignee: nobody → Martin Borho (martin-borho)
David Planella (dpm)
description: updated
tags: added: bitesize
summary: - Use the same city search service for Weather and Clock
+ Return more fine-grained territorial divisions for city search results
tags: added: avengers
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Re: Return more fine-grained territorial divisions for city search results

There is just one concern. By adding adminname2, the results will start overflowing the space available. The same issue *will* affect the weather app. This might require the format,

City Name (Bold, larger font)
State Name, County Name
Country Name

Currently it is,

City Name (Bold, larger font)
State Name, Country Name

However in order to have 3 lines, we need to increased the height of ListItem.Standard. I am not sure if that's possible. May be we could do that by using ListItem.Base instead.

Revision history for this message
David Planella (dpm) wrote :

Thanks a lot for looking into this. I'm adding a task for Design to keep them in the loop, and to get some input on whether there is any clever way to fix this design-wise.

tags: added: needs-design
Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

@nik90

I don't know if you'll want to do it for design reasons, but you can do three lines in a ListItem.Subtitled. I do this in another app. It accepts the height property and it responds to line breaks (\n) in the subText property.

http://bazaar.launchpad.net/~andrewsomething/stackbrowser/trunk/view/head:/QuestionDelegate.qml

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Thanks Andrew. I will try different stuff when I get home. I will ListItem.Subtitled a shot, but however I am not that optimistic since most likely it will not match the designs for several reasons,

1. The left margin needs to be changed for the text (both title and subtitle) which cannot be done AFAIK.
2. The subtitle string will have a different color, font size

Infact, if you take a look at http://bazaar.launchpad.net/~ubuntu-clock-dev/ubuntu-clock-app/trunk/view/head:/clock/WorldClock.qml (lines 181 onwards), despite using a ListItem.Standard, I have had to add Labels {} to achieve the anchoring and sizing that design needs. My plan was to transistion them to ListItem.Base which allows this to be done.

That said I will test your solution. I appreciate your help.

Changed in ubuntu-weather-app:
status: Triaged → In Progress
Changed in ubuntu-clock-app:
status: Triaged → In Progress
assignee: nobody → Nekhelesh Ramananthan (nik90)
Revision history for this message
Martin Borho (martin-borho) wrote :

I'm in the progress of implementing the location search in the weather app with geonames.org and I'm ended up with the following search parameters, which are serving in my view the best results:

style=full
featureClass=P // see => http://www.geonames.org/export/codes.html
name_startsWith=term

Examples:

with namestarts_with and feature class:
http://api.geonames.org/search?style=full&username=uweatherdev&name_startsWith=Hamburg&maxRows=25&featureClass=P

with default fulltext search and feature class:
http://api.geonames.org/search?style=full&username=uweatherdev&q=Hamburg&maxRows=25&featureClass=P

without featureClass:
http://api.geonames.org/search?style=full&username=uweatherdev&name_startsWith=Hamburg&maxRows=25 (first two are doubles)

About the sparse place in the listitem subtitle: I'm just adding adminName1, adminName2, adminName3 and country if tehy are available.

http://imageshack.us/a/img200/291/m43.png

Text gets cut, but the location is immediately identificable. Also the text would be fully readable in larger screens. So for me this would be ok

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Martin, thnx. I will also use featureClass=P and name_startsWith= to my search url. However do we really adminName3? I do realise that looking at your screenshot, without adminName3, the first 2 entries will appear as duplicates, however it seems like a lot of info for something which should be so simple.

As for the overflowing text, the 1.0 release is focussed on the phone and hence it is not recommended to show overflowing text.

Revision history for this message
Martin Borho (martin-borho) wrote :

Hmm, since adminName 3 is the most specific one, it can get priority over adminName2, if available.

What do you think?

Problem is: I guess it differs from country to country, how good adminName2 or adminName3 matches. In the screenshot, adminName2 is mostly irrelevant, but in the UK adminName2 is more relevant AFAIK.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

if adminName3 is good for certain countries while in others adminName2 is revelant, then that's a tough one :). Personally I would add them all, but this is going to pose an issue for the design team to come up with something which will appear nice as well. Unfortunately I can only talk to Lina next week. So lets' wait until then.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

Fix committed into lp:ubuntu-weather-app at revision 128, scheduled for release in ubuntu-weather-app, milestone alpha-1

Changed in ubuntu-weather-app:
status: In Progress → Fix Committed
Changed in ubuntu-ux:
assignee: nobody → Christina Li (christina-li)
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Martin Borho (martin-borho) wrote :

It is possibe to truncate text which is too long in Label with:

width: parent.width-units.gu(3)
elide: Text.ElideRight

for example.

"..." will then be added at the end, like it's done ListItem.Subtitled

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

ah that's useful. This I think I can accept. I will implement your idea along with adding adminName 3 with adminName 2 for improved accuracy.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

I decided to not use adminName3 after noticing it duplicating the results of adminName2 on several occasions. I am sure an intelligent filtering of results can be done, but I rather deal with that next cycle.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

Fix committed into lp:ubuntu-clock-app at revision 220, scheduled for release in ubuntu-clock-app, milestone final-1.0

Changed in ubuntu-clock-app:
status: In Progress → Fix Committed
Changed in ubuntu-clock-app:
status: Fix Committed → Fix Released
David Planella (dpm)
Changed in ubuntu-weather-app:
status: Fix Committed → Fix Released
John Lea (johnlea)
Changed in ubuntu-ux:
assignee: Christina Li (christina-li) → Giorgio Venturi (giorgio-venturi)
summary: - Return more fine-grained territorial divisions for city search results
+ [Clock] [Weather] Return more fine-grained territorial divisions for
+ city search results
Changed in ubuntu-ux:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.