Opened 6 years ago

Last modified 13 months ago

#1084 new enhancement/feature request

[PATCH] more pois attributes

Reported by: erfabbri Owned by: KaZeR
Priority: major Milestone: version 0.5.2
Component: tools Version: git master
Severity: Keywords: binfile, openstreetmap
Cc:

Description (last modified by usul)

im a newbie, i managed to add more attributes for pois when clicking on "show pois attributes", modifing osm.c and attr_def.h

in short, this patches will add more poi info like:

  • opening_hours
  • capacity
  • cuisine,stars(used in hotels)
  • operator

as the latest version of navit only include address, phone, fax and postal code

some of my implementations seems to be nearly supported by navit, as i saw in osm.c the tag "addr:email", that i fixed with the current osm tag "email"

also some of the tags i added to be displaied, were already in attr_def.h like: ATTR(description) and ATTR(url)

also ATTR(entry_fee) and ATTR(open_hours) were already in, but i changed in ATTR(fee) [more generic fee for an amenity, not only entrance] and in ATTR(opening_hours) [more close to the osm tag]

NOTE: adding ATTR(operator) in attr_def.h, give the word operator in red color, using gedit.

as a newbie in C language, i dont know if this is a bug/problem and how to avoid this, so i used ATTR(operated_by) to solve.

i compiled and it worked, the only problem is about fuel:lpg=yes/no or fee=yes/no....it appears fee=1 when yes and fee=0 when no...but user tryagain in irc said you will fix this ;)

if it doesnt makes world binfile grow too much, can you include in mainstream?

thanks

Attachments (3)

osm.c.patch (4.0 KB) - added by erfabbri 6 years ago.
attr_def.h.patch (510 bytes) - added by erfabbri 6 years ago.
svn_diff.patch (5.2 KB) - added by erfabbri 6 years ago.

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by erfabbri

Changed 6 years ago by erfabbri

comment:1 Changed 6 years ago by tryagain

Hi!

I have not yet considered your patch in its merits, but have some common suggestions.

  1. It's better to make your patches with 'svn diff' command while you're in the root of the project source tree. Then you have all changes in one file and it's easier for devs to apply and review them.
  1. Changing the spelling of existing attributes is not generally a good idea as somebody can have their names in navit.xml, text file maps etc. If you really need to change the spelling, it's usually better to add a new attribute than change existing one.

tryagain.

Last edited 6 years ago by tryagain (previous) (diff)

comment:2 Changed 6 years ago by erfabbri

added svn diff generated patch as suggested, and old ATTR are not removed now.

ps: for key=yes/no (fee,fuel:lpg,dispensing,atm)....still appears key=1 when yes and key=0 when no in Navit, please fix.

thanks.

Last edited 6 years ago by erfabbri (previous) (diff)

Changed 6 years ago by erfabbri

comment:3 follow-up: Changed 6 years ago by cp15

The patch has a few problems. First it is not allowed to insert new attributes in the middle of a block. It will make maps incompatible, since the numbering of the following attributes will change and the attributes are represented in the map as numbers

Then the attributes are not expected to be user-readable in the first place, but instead should describe the object as good (and abstract) as possible. In particular:

  • Capacity is most likely a numeric attribute and not a string
  • Fee is a boolean value or time dependent, I would split this up into fee (yes/no) and fee_hours (string)
  • fuel:lpg is a bit arbitrary. I would like to use a bit field for fuel stations where each fuel type has a bit
  • description is ok I think
  • operated_by: I am not sure whether this should be a separated attribute or coded into the item types (like poi_fastfood_mcdonalds), at least for the more important ones. This would allow to display a brand icon on the map and do more specific searches.
  • cuisine: This needs to be more formal than a text string. Maybe it should be also integrated into the item type (poi_restaurant_italian) for specific searches.
  • opening_hours: open_hours should be sufficient for this, no need to introduce a new tag. In the long term I would like to convert the osm style intervals into gdf timespecs which are much more formal.
  • stars: I think it is also a numerical attribute... To include the 'Superior' suffix, I would multiply the number of stars by 2 and add 1 for superior.
  • dispensing: I would code this into a new item type poi_pharmacy_nondisp
  • atm: Should be coded as poi_atm

Best regards,

cp15

comment:4 in reply to: ↑ 3 Changed 6 years ago by erfabbri

Replying to https://wiki.navit-project.org/index.php/user:cp15:

The patch has a few problems. First it is not allowed to insert new attributes in the middle of a block. It will make maps incompatible, since the numbering of the following attributes will change and the attributes are represented in the map as numbers

Then the attributes are not expected to be user-readable in the first place, but instead should describe the object as good (and abstract) as possible. In particular:

  • Capacity is most likely a numeric attribute and not a string

that's true...in osm taginfo only some values like "unknow" is a string but useless, so i agree

  • Fee is a boolean value or time dependent, I would split this up into fee (yes/no) and fee_hours (string)

fee_hours is not in use http://taginfo.openstreetmap.org/search?q=fee_hours also "fee" in OSM seems not to be only a boolean: http://taginfo.openstreetmap.org/keys/fee#values a 5% of informations will be lost with boolean

  • fuel:lpg is a bit arbitrary. I would like to use a bit field for fuel stations where each fuel type has a bit

so you will introduce also other fuel type like biofuel and natural gas?

  • description is ok I think

i agree

  • operated_by: I am not sure whether this should be a separated attribute or coded into the item types (like poi_fastfood_mcdonalds), at least for the more important ones. This would allow to display a brand icon on the map and do more specific searches.

well, this can be made but as an extra feature. also for McDonald?'s i will not use operator but brand tag (as franchising). the puropose of my patch is to visualize the operator=* value without lost of informations.

  • cuisine: This needs to be more formal than a text string. Maybe it should be also integrated into the item type (poi_restaurant_italian) for specific searches.

ok, but what about cases like: "cusine=pizza;kebab;burger" ?

  • opening_hours: open_hours should be sufficient for this, no need to introduce a new tag. In the long term I would like to convert the osm style intervals into gdf timespecs which are much more formal.

i agree to use open_hours

  • stars: I think it is also a numerical attribute... To include the 'Superior' suffix, I would multiply the number of stars by 2 and add 1 for superior.

for me is fine, but i read in OSM ML there is a discussion about this tag, they are pushing to use "award:hotelstars" ( "hotelstars" is a european certified system that assign stars to hotels in a more comparable way) so maybe we can postpone this attributes for now?

  • dispensing: I would code this into a new item type poi_pharmacy_nondisp

we should also consider pharmacy without dispensing=* tag as unknow?

  • atm: Should be coded as poi_atm

agree...but in OSM there are still 2.323 post_office and 63.217 bank with atm=* so maybe is still a usefull information

Best regards,

cp15

thanks for possible future implementation cheers.

comment:5 Changed 6 years ago by erfabbri

just notice in attr_def.h the line: ATTR(route_follow_straight_REMOVE) This is to be removed with the next version

and also ATTR(town_id), ATTR(street_id), ATTR(district_id), and ATTR(trackingo) have a comment /* fixme */

maybe you want to make a "cleaning" on attr_def.h ?

comment:6 Changed 5 years ago by usul

  • Component changed from core to tools
  • Description modified (diff)
  • Keywords binfile openstreetmap added
  • Milestone set to version 0.5.1

Was the patch improved yet?

As it seems to be on the way, I schedule it for 0.5.1 hotfix.

comment:7 Changed 13 months ago by http://wiki.navit-project.org/index.php/user:jkoan

  • Milestone changed from version 0.5.1 to version 0.5.2

This ticket was pushed back in order to bring 0.5.1 out soon.

Note: See TracTickets for help on using tickets.