improve search

Bug #641278 reported by Nikolay Metchev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenSatNav
Fix Committed
Critical
Unassigned

Bug Description

I have only just discovered OpenSatNav but it seems to me that if the search isn't improved drastically its use is quite restricted.
I tried searching for my post code and it didn't find it. It prompted me to enter it into freethepostcode.org. I have done so but I presume it takes a few days for the information to filter through. Any other search query I have done has returned no results. The question is how difficult would it be to integrate the two search tools that come with open street map already Nominatim (http://wiki.openstreetmap.org/wiki/Nominatim) and Name Finder (http://wiki.openstreetmap.org/wiki/Namefinder). These are used by JOSM so I would guess we can look in the source code for that for examples.

Revision history for this message
droidguy (stan-berka) wrote : Re: [Bug 641278] [NEW] improve search

I support this request. I am not able to do any useful search. The only way
for me here in Portland, OR to get any navigation is to point and hold the
location on the map. Unfortunately, if I slide the kbd in or out the
navigation is dropped and I have to repeat the whole process of finding the
dest on the map.
droidguy

On Sep 17, 2010 6:05 AM, "Nikolay Metchev" <email address hidden>
wrote:

Public bug reported:

I have only just discovered OpenSatNav but it seems to me that if the search
isn't improved drastically its use is quite restricted.
I tried searching for my post code and it didn't find it. It prompted me to
enter it into freethepostcode.org. I have done so but I presume it takes a
few days for the information to filter through. Any other search query I
have done has returned no results. The question is how difficult would it be
to integrate the two search tools that come with open street map already
Nominatim (http://wiki.openstreetmap.org/wiki/Nominatim) and Name Finder (
http://wiki.openstreetmap.org/wiki/Namefinder). These are used by JOSM so I
would guess we can look in the source code for that for examples.

** Affects: opensatnav
    Importance: Undecided
        Status: New

--
improve search
https://bugs.launchpad.net/bugs/641278
You received this bug notification because you are a member of
OpenSatNav Admins, which is the registrant for OpenSatNav.

Status in OpenSatNav: New

Bug description:
I have only just discovered OpenSatNav but it seems to me that if the search
isn't improved drastically its use is quite restricted.
I tried searching for my post code and it didn't find it. It prompted me to
enter it into freethepostcode.org. I have done so but I presume it takes a
few days for the information to filter through. Any other search query I
have done has returned no results. The question is how difficult would it be
to integrate the two search tools that come with open street map already
Nominatim (http://wiki.openstreetmap.org/wiki/Nominatim) and Name Finder (
http://wiki.openstreetmap.org/wiki/Namefinder). These are used by JOSM so I
would guess we can look in the source code for that for examples.

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

Hi,
Firstly, thanks for your interest in the program!
We already use Nominatim for the search, so if it's not working that's a bit weird.
We use Nominatim's 'viewbox' parameter to restrict the search to 20 degrees of latitude or longitude from your position, so try this in a browser, replacing the appropriate parts with your values:

http://nominatim.openstreetmap.org/search?q=<query>&viewbox=<minus 20 long>,<minus 20 lat>,<plus 20 long>,<plus 20 lat>

If you get results this way but not from OpenStreetMap then that's definitely a problem!

Changed in opensatnav:
status: New → Incomplete
Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

droidguy, sorry, I was writing my reply at the same time as yours. I can't replicate this, so either try the same query in your browser as I mentioned above, or tell me a search query and current location and origin that I can test with.

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

Just search query and current location I mean, sorry :)

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

Also droidguy, OSN losing the route when you rotate the screen is also a bug so thanks for pointing that out. I have fixed it in this branch:
https://code.launchpad.net/~kieran-fleming/opensatnav/keep-route-fix
I expect to merge it into the trunk soon. Thanks for mentioning it as it was a regression that was fixed long ago!

Revision history for this message
Nikolay Metchev (nikolaymetchev) wrote :

Kieren,
It sounds like from your comments that in order to be able to search I need to have a GPS lock otherwise you cannot restrict the query in the manner you suggest. I tried waiting for a GPS lock before hitting the Directions button and to my surprise as soon as I hit that button the GPS was switched off. Therefore when I was entering the query there was no lock. If I am correct and you need a GPS lock to search then I guess we can change this bug request to be able to search without a GPS lock.

Revision history for this message
droidguy (stan-berka) wrote : Re: [Bug 641278] Re: improve search

Kieran,
Thanks for your reply. I'm looking forward to have that fix merged. As for
the search, it's the Nominatim issue. I opened a ticket with them. Still a
bit unexpected results.
droidguy

On Sep 17, 2010 9:30 PM, "Kieran Fleming" <email address hidden> wrote:

Also droidguy, OSN losing the route when you rotate the screen is also a bug
so thanks for pointing that out. I have fixed it in this branch:
https://code.launchpad.net/~kieran-fleming/opensatnav/keep-route-fix
I expect to merge it into the trunk soon. Thanks for mentioning it as it was
a regression that was fixed long ago!

--
improve search
https://bugs.launchpad.net/bugs/641278
You received this bug notification becaus...
Status in OpenSatNav: Incomplete

Bug description:
I have only just discovered OpenSatNav but it seems to me that if the search
isn't...

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

Can you please paste the address to that bug in? That way LP will let
us know if it's fixed.

On 19 September 2010 08:31, droidguy <email address hidden> wrote:
> Kieran,
> Thanks for your reply. I'm looking forward to have that fix merged. As for
> the search, it's the Nominatim issue. I opened a ticket with them. Still a
> bit unexpected results.
> droidguy
>
> On Sep 17, 2010 9:30 PM, "Kieran Fleming" <email address hidden>
> wrote:
>
> Also droidguy, OSN losing the route when you rotate the screen is also a bug
> so thanks for pointing that out. I have fixed it in this branch:
> https://code.launchpad.net/~kieran-fleming/opensatnav/keep-route-fix
> I expect to merge it into the trunk soon. Thanks for mentioning it as it was
> a regression that was fixed long ago!
>
>
> --
> improve search
> https://bugs.launchpad.net/bugs/641278
> You received this bug notification becaus...
> Status in OpenSatNav: Incomplete
>
>
> Bug description:
> I have only just discovered OpenSatNav but it seems to me that if the search
> isn't...
>
> --
> improve search
> https://bugs.launchpad.net/bugs/641278
> You received this bug notification because you are a member of
> OpenSatNav Admins, which is the registrant for OpenSatNav.
>
> Status in OpenSatNav: Incomplete
>
> Bug description:
> I have only just discovered OpenSatNav but it seems to me that if the search isn't improved drastically its use is quite restricted.
> I tried searching for my post code and it didn't find it. It prompted me to enter it into freethepostcode.org. I have done so but I presume it takes a few days for the information to filter through. Any other search  query I have done has returned no results. The question is how difficult would it be to integrate the two search tools that come with open street map already Nominatim (http://wiki.openstreetmap.org/wiki/Nominatim) and Name Finder (http://wiki.openstreetmap.org/wiki/Namefinder). These are used by JOSM so I would guess we can look in the source code for that for examples.
>
>
>

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

Nikolay,
What you described sounds like it would work if it wasn't for this
other issue with Nominatim. When you press the 'Directions' button,
your current position is sent through. There is also another bit of
code that turns off GPS updates whenever the map screen is not active
in order to save power. Hopefully this problem with Nominatim will be
fixed so OpenSatNav will work for you :)

On 21 September 2010 22:56, Kieran Fleming <email address hidden> wrote:
> Can you please paste the address to that bug in? That way LP will let
> us know if it's fixed.
>
> On 19 September 2010 08:31, droidguy <email address hidden> wrote:
>> Kieran,
>> Thanks for your reply. I'm looking forward to have that fix merged. As for
>> the search, it's the Nominatim issue. I opened a ticket with them. Still a
>> bit unexpected results.
>> droidguy
>>
>> On Sep 17, 2010 9:30 PM, "Kieran Fleming" <email address hidden>
>> wrote:
>>
>> Also droidguy, OSN losing the route when you rotate the screen is also a bug
>> so thanks for pointing that out. I have fixed it in this branch:
>> https://code.launchpad.net/~kieran-fleming/opensatnav/keep-route-fix
>> I expect to merge it into the trunk soon. Thanks for mentioning it as it was
>> a regression that was fixed long ago!
>>
>>
>> --
>> improve search
>> https://bugs.launchpad.net/bugs/641278
>> You received this bug notification becaus...
>> Status in OpenSatNav: Incomplete
>>
>>
>> Bug description:
>> I have only just discovered OpenSatNav but it seems to me that if the search
>> isn't...
>>
>> --
>> improve search
>> https://bugs.launchpad.net/bugs/641278
>> You received this bug notification because you are a member of
>> OpenSatNav Admins, which is the registrant for OpenSatNav.
>>
>> Status in OpenSatNav: Incomplete
>>
>> Bug description:
>> I have only just discovered OpenSatNav but it seems to me that if the search isn't improved drastically its use is quite restricted.
>> I tried searching for my post code and it didn't find it. It prompted me to enter it into freethepostcode.org. I have done so but I presume it takes a few days for the information to filter through. Any other search  query I have done has returned no results. The question is how difficult would it be to integrate the two search tools that come with open street map already Nominatim (http://wiki.openstreetmap.org/wiki/Nominatim) and Name Finder (http://wiki.openstreetmap.org/wiki/Namefinder). These are used by JOSM so I would guess we can look in the source code for that for examples.
>>
>>
>>
>

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

I have the same problem: click to navigate is ok but writing anything in the directions box leads to "Sorry, could't find 'xxx'".
I also got an error in the log:
09-21 22:31:47.155: WARN/System.err(12138): java.lang.NullPointerException
09-21 22:31:47.155: WARN/System.err(12138): at org.opensatnav.services.NominatimGeoCoder.query(NominatimGeoCoder.java:81)
09-21 22:31:47.155: WARN/System.err(12138): at org.opensatnav.GetDirectionsActivity$9.run(GetDirectionsActivity.java:318)
09-21 22:31:47.155: WARN/System.err(12138): at java.lang.Thread.run(Thread.java:1096)
Let's see what's wrong there...
This was:
if (xml.item(1).getChildNodes().item(1) != null) {
and I changed it into:
if (xml.item(1) != null && xml.item(1).getChildNodes().item(1) != null) {
... now I've got no log error, but I still have no result.

I logged my nominatim request and opened it in the android browser with good results... so like Kerian said "that's definitely a problem!".

Changed in opensatnav:
status: Incomplete → Confirmed
milestone: none → 1.2
milestone: 1.2 → 1.0
importance: Undecided → Critical
Revision history for this message
Murphy (murphy2712+launchpad) wrote :

And why not changing this:
if (xml.item(1).getChildNodes().item(1) != null) {
 NodeList places = xml.item(1).getChildNodes();
into this:
if (xml.item(0).getChildNodes().item(1) != null) {
 NodeList places = xml.item(0).getChildNodes();
?
This actually works ;)
It looks like the list begins at 0!
Cf the documentation:
"The items in the NodeList are accessible via an integral index, starting from 0."
I don't know why but the second item() does not like begining at 0.

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

It's very weird - Android 2.2 starts at 0 while all the older ones start at 1!
I've changed it to this code:
if ((xml.item(0).getChildNodes().item(1) != null) || (xml.item(1).getChildNodes().item(1) != null)) {
 NodeList places = xml.item(0).getChildNodes();
 if(places.getLength()==0)
  places = xml.item(1).getChildNodes();

And it works fine on anything 1.5 and up. I've tested on the emulators, a G1, Sony Ericsson X10 and a Nexus One. Murphy, can you have a look at this? The code is so ugly but i can't see another way!

Revision history for this message
Murphy (murphy2712+launchpad) wrote :

I asked on the Google Groups but get no response...
http://groups.google.com/group/android-developers/browse_thread/thread/6283dcfb8b84e7d

Since it's critical and I don't see a better code for this, you should add some comments in the code and upload to generate a new apk for 2.2 users.

Revision history for this message
Kieran Fleming (kieran-fleming) wrote :

Pushed up as revision 173

Changed in opensatnav:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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