costales / unav

GPS Navigator for Ubuntu Touch
GNU General Public License v3.0
25 stars 8 forks source link

Offline navigation via OSM Scout Server #8

Closed jonnius closed 4 years ago

jonnius commented 4 years ago

Would you be interested in letting unav use the OSM Scout Server for offline navigation in uNav? If so I would include Mapnik in OSM Scout Server to provide the map tiles.

costales commented 4 years ago

I think is not returning that:

phablet@ubuntu-phablet:~$ wget -S -O - "http://localhost:8553/v1/guide?limit=1&lng=-5.668974&lat=43.532307&poitype=any"
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8553... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:8553... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Connection: Keep-Alive
  Transfer-Encoding: chunked
  Content-Type: application/json; charset=UTF-8
  Date: Wed, 12 Aug 2020 22:05:32 GMT
Length: unspecified [application/json]
Saving to: ‘STDOUT’

-                       [<=>                 ]       0  --.-KB/s               {
    "origin": {
        "lat": 43.532307,
        "lng": -5.668974
    },
    "query_name": "",
    "query_type": "any",
    "results": [
    ]
}
-                       [ <=>                ]     148  --.-KB/s    in 0s      

2020-08-13 00:05:32 (2.93 MB/s) - written to stdout [148]

phablet@ubuntu-phablet:~$

From QML worked fine, but from javascript is not working. I'm trying to fix that, but I'm not sure if it's possible from the client side...

rinigus commented 4 years ago

Could be. But what's the difference with search then? Do you call search from QML and guide from JS?

rinigus commented 4 years ago

PS: If the header is needed, I will make the corresponding patch and the new release. Just want to be sure.

costales commented 4 years ago

I think it was fixed adding this into the QML! :))))

settings.localContentCanAccessRemoteUrls: true

But I'm always getting an empty value:

{"origin":{"lat":43.53662234550157,"lng":-5.66564692509271},"query_name":"","query_type":"any","results":[]}

This is the call:

wget -qO- "http://localhost:8553/v1/guide?limit=1&lng=-5.668974&lat=43.532307&poitype=any"

{
    "origin": {
        "lat": 43.532307,
        "lng": -5.668974
    },
    "query_name": "",
    "query_type": "any",
    "results": [
    ]
}

And it's a city, in 100 meters, it should be there any POI.

Am I calling it right?

Thanks

rinigus commented 4 years ago

Try to increase the radius. Let's see if it helps

costales commented 4 years ago

Try to increase the radius. Let's see if it helps

Same with 1km:

http://localhost:8553/v1/guide?limit=10&radius=1000&lng=-5.668974&lat=43.532307&poitype=any

The reply is:

    "origin": {
        "lat": 43.532307,
        "lng": -5.668974
    },
    "query_name": "",
    "query_type": "any",
    "results": [
    ]
}
rinigus commented 4 years ago

Hmm, let me see if I can reproduce it

rinigus commented 4 years ago

After downloading Spain, I am getting

curl "http://localhost:8553/v1/guide?limit=1&radius=100&lng=-5.668974&lat=43.532307&poitype=any" 
{
    "origin": {
        "lat": 43.532307,
        "lng": -5.668974
    },
    "query_name": "",
    "query_type": "any",
    "results": [
        {
            "admin_levels": 4,
            "admin_region": "Aparcamiento reservado para motos, Gijón/Xixón, Asturias / Asturies, Asturias / Asturies",
            "distance": 23.09495124324293,
            "lat": 43.53251213977123,
            "lng": -5.669021797694427,
            "object_id": 91835,
            "phone": "",
            "postal_code": "",
            "title": "Aparcamiento reservado para motos, Gijón/Xixón",
            "type": "Motorcycle parking",
            "website": ""
        }
    ]
}
costales commented 4 years ago

Thanks a lot for the test.

I tried in my another phone with UT and it worked! In my 1st phone it doesn't work, with same maps and profile in both of them. Weird...

One thing less :)

A hug!

rinigus commented 4 years ago

I wonder if the maps are the same... Maybe just would need to check for updates, maybe re-download and ensure it is not Barcelona, but full Spain

costales commented 4 years ago

Yes, it was weird. Maps & search worked but not the POIs.

I flashed my device and it is working fine now. Both of my phones.

costales commented 4 years ago

Hi,

About the POIs, there are 2 types of them that are not getting me anything (other yes, there are getting data).

They are building_church and amenity_taxi. When I search my city (Xixón) nothing comes up.

Testing here, I can see POIs  http://openpoimap.org/

image

I think OSM Scout should return POIs (the URL is the same as any other POI working). Any idea please? Thanks!

costales commented 4 years ago

API call examples:

Doesn't work: wget "http://localhost:8553/v1/guide?radius=1000&limit=100&lng=-5.66355&lat=43.53654&poitype=amenity_taxi"

Works: wget "http://localhost:8553/v1/guide?radius=1000&limit=100&lng=-5.66355&lat=43.53654&poitype=amenity_fuel"

rinigus commented 4 years ago

Question is whether I import those POIs. Not all is getting into the database, I have to select them. Although, they seem to be there in https://github.com/rinigus/geocoder-nlp/blob/master/importer/stylesheet/whitelist . I will have to check

On Fri, Aug 14, 2020 at 4:31 PM Costales notifications@github.com wrote:

API call examples:

Doesn't work: wget " http://localhost:8553/v1/guide?radius=1000&limit=100&lng=-5.66355&lat=43.53654&poitype=amenity_taxi "

Works: wget " http://localhost:8553/v1/guide?radius=1000&limit=100&lng=-5.66355&lat=43.53654&poitype=amenity_fuel "

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/costales/unav/issues/8#issuecomment-674076087, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADX2T3ICMUUJPVBUEFMUI5TSAU4DTANCNFSM4KLEWCMA .

rinigus commented 4 years ago

For churches, use amenity_place_of_worship - then it will find all fine.

As for taxi, it did not import for some reason. And it is not very clear to me why it happened. Will have to look into it when I get a chance to work on the import again

Alternative, is to use one of the aliases as returned by http://localhost:8553/v1/poi_types, but those would depend on used language. And as taxi is not in the database, it will not help there

costales commented 4 years ago

Thanks @rinigus

amenity_place_of_worship worked perfect.

Another option for a Taxi didn't work:

phablet@ubuntu-phablet:~$ cat poi_types  | grep -i taxi
    "Taxi",
    "Taxi Rank",
    "Taxi Ranks",
    "Taxis",
phablet@ubuntu-phablet:~$

A hug.

rinigus commented 4 years ago

No, data is not imported from OSM, unfortunately. But let's keep it in mind when I get back to geocoder import - there are few other things to fix as well.

Opened an issue regarding it in OSM Scout Server repo

costales commented 4 years ago

Hi @rinigus

With georeverse I saw things like these:

The title has " , " at the start: "title":" , Gijón/Xixón" and it looks weird:

{"origin":{"lat":43.52922728792814,"lng":-5.660495253388129},"query_name":"","query_type":"any","results":[{"admin_levels":4,"admin_region":" , Gijón/Xixón, Asturias / Asturies, Asturias / Asturies","distance":4.222268129033717,"lat":43.52920095271767,"lng":-5.660457504246068,"object_id":91984,"phone":"","postal_code":"","title":" , Gijón/Xixón","type":"Motorcycle parking","website":""}]}

The number of street is before the name, probably English format but I would like to rise you if it is not the desired result:

{"origin":{"lat":43.53336587445253,"lng":-5.658108328263222},"query_name":"","query_type":"any","results":[{"admin_levels":6,"admin_region":"9, Calle San Rafael, Distrito Este, Gijón/Xixón, Asturias / Asturies, Asturias / Asturies","distance":5.769474675495295,"lat":43.53341336200694,"lng":-5.658137393430906,"object_id":95178,"phone":"","postal_code":"33209","title":"9, Calle San Rafael","type":"address","website":""}]}

Thanks!

rinigus commented 4 years ago

Evening @costales,

what you observe, is due to the format and notation used by the geocoder. In short, cannot change it unless major rework will be done on it. Below, is why

In the geocoder, I am storing each object (as house) with the link to its parent object (as street). Geocoder later creates an address admin_region as a string representation of a hierarchy. So, in the second example, you get exactly as it is in OSM: house number, street, district, ..., county boundary, state boundary (last ones are with the same name).

In the first example, we have a POI without a name. Hence it starts with " " as a name and proceeds after that. As a result, you get title with " , " in the beginning. Not optimal, for sure, but allows to distinguish POI from the region with that name. Should think how to show it differently...

At this stage, I don't save what is the level the object belongs to. So, I don't know that 9 is a house number and Calle San Rafael is a street. When I get to the geocoder, should think how to approach it better.

costales commented 4 years ago

Hi,

OK :) No problem, I'll patch the name.

Thanks for the feedback!

costales commented 4 years ago

Hi, in my tests, the drinking wather POIs are not found either (amenity_drinking_water).

Thanks in advance!

rinigus commented 4 years ago

I presume it is not imported as it is not in https://github.com/rinigus/geocoder-nlp/blob/master/importer/stylesheet/whitelist

costales commented 4 years ago

But the tags here are valid too? Should they find POIs? Or should I use only your link as tags resource?

https://rinigus.github.io/osmscout-server/tags/tag2alias_en.html

Thanks in advance! -- Sent using Dekko from my Ubuntu device

--

Costales.

rinigus commented 4 years ago

tags are valid. The list I referred to has POI types which are imported even without names. The notation of the tags in this list is can be different from the one used by server, it is notation of the lib I am using for import. The tag list you refer to is used while searching via OSM Scout Server. Sorry for complexity, project has been evolving for years and that shows.

costales commented 4 years ago

Sorry, but then, drinking water should be find when I ask for that amenity?

-- Sent using Dekko from my Ubuntu device

rinigus commented 4 years ago

No, it is not in the database. It was ignored by the import script, even with the names

costales commented 4 years ago

Released! :) Thanks a lot @rinigus and @jonnius for your support and help!!

rinigus commented 4 years ago

Congratulations!!!