Closed mariush444 closed 3 months ago
To do: We need to convert color from GPX and icons (from GPX OsmAnd format), so it look identical as GPX and as OBF
If you add extensions to each track in the GPX file, it will keep the color when converting to OBF. However, I was not able to get the width to change.
Example:
`
<name>Track</name>
<trkseg>
<trkpt lat="44.486968014389277" lon="-85.290206596255302" />
<trkpt lat="44.486643970012665" lon="-85.290624769404531" />
</trkseg>
`
Finally I got the same result. Reddit ;)
2 tasks:
Any update here? I would love the ability to change the width of the track in the resulting obf file. Are there any other ways to accomplish this?
Issue #19892 deals with rhe 'Waypoint' appearance (color/icon) portion of this question and seems currently 'work in progress'.
I am not aware of any activity about the track width, though. It would be coding similarly to what has recently been achieved here: https://github.com/osmandapp/OsmAnd/issues/20051
Bugs and notes:
long id = -10
should be started differentlyosmand:*
extensions as OSM tags for <way>
(new method addOsmAndTags?)Tech plan:
addOsmAndTags
to add osmand:*
ext tags to <way>
(OsmGpxWriteContext)width
into default.render.xml, test in v1, v2, v2/3d, v2/track3did
better to avoid id overlapping for multiple obf-gpx filesNote: width might be string: thin/medium/bold or int-value (custom)
xmd5a:
width for "route" : "segment"
to other important styles (touring, offroad, etc)thin
medium
bold
custom-specified (not thin/medium/bold width=X) should be supported later
Question about track - route (https://github.com/osmandapp/OsmAnd-Issues/issues/2277)
Connected task: https://github.com/osmandapp/OsmAnd/issues/18876
The link https://github.com/osmandapp/OsmAnd-Issues/issues/2277 doesn't work. I'm not sure if the chackboxe's are for user's voting or for osmand team. If it is user voting then I vote 2 then 1.
@mariush444, Issue 2277 is our internal task to implement travel OBF collection (just a reminder for connected tasks). The checkboxes are used as a TODO list for the current Issue, and I'm going to prettify waypoint icons and try to implement GPX-like customizations. I agree with you about 2 and 1 indeed.
Some waypoint customization has been implemented. It's far away from the ideal look (as GPX points), but it renders much faster.
GPX-points | OBF-points |
---|---|
Devel notes:
Kotlin:
Platforms:
[todo] do not forget to fix ios TravelObfHelper
[x] Web - rename OBF collection to .travel.obf (confirm first)
GPX:
[x] support GPX point_groups tag
[x] pass all OsmAnd tags on GPX-OBF generation (Map section - tags to render, POI section - all tags)
[x] restore extension tags for track and points in Travel guides (apply all generated tags)
UI:
[todo] fix V2 engine click-on-track, click-on-point, show/hide OBF-GPX tracks/points from "Travel routes" menu
[todo] think about the ref
tag - it is displayed as "736" in the second screenshot above, and it is clickable (the way is highlighted, but click activated like a point - all in v2 engine)
Bugs:
diff_ele_down
/ diff_ele_up
in the generation in OsmGpxWriteContext (screenshot)original / fixed:
TODO:
How to test (for OsmAnd QA team):
Happy testing!
OsmAnd iOS report:
Tested using OsmAnd~ 4.9.0#3365m, released: 2024-10-07 and TestFlight 4.8.3.6 on iPhone 13 mini and on the desktop version
I confirmed this is working as expected. Is there any way to get transparency applied to the color?
@brad10281 you could tune GPX-in-OBF colors by editing routes.addon.render.xml
file in OsmAnd files/rendering
folder.
For example, you can try the following block with transparent colors:
(find the block by OBF-GPX relation track width/color
)
Transparent colors:
<apply_if additional="color_white" color="#44ffffff"/>
<apply_if additional="color_gray" color="#44999999"/>
<apply_if additional="color_darkyellow" color="#44afb61c"/>
<apply_if additional="color_lightgreen" color="#446cb52b"/>
<apply_if additional="color_lightblue" color="#442ec6ff"/>
<apply_if additional="color_red" color="$osmcRedColor"/>
<apply_if additional="color_orange" color="$osmcOrangeColor"/>
<apply_if additional="color_brown" color="$osmcBrownColor"/>
<apply_if additional="color_yellow" color="$osmcYellowColor"/>
<apply_if additional="color_green" color="$osmcGreenColor"/>
<apply_if additional="color_blue" color="$osmcBlueColor"/>
<apply_if additional="color_purple" color="$osmcPurpleColor"/>
<apply_if additional="color_black" color="$osmcBlackColor"/>
And place it instead of the standard colors:
(find the block by OBF-GPX track colors
)
Standard colors:
<apply_if additional="color_white" color="#ffffff"/>
<apply_if additional="color_red" color="#ff0000"/>
<apply_if additional="color_orange" color="#ff7200"/>
<apply_if additional="color_brown" color="#ba7007"/>
<apply_if additional="color_darkyellow" color="#afb61c"/>
<apply_if additional="color_yellow" color="#edc300"/>
<apply_if additional="color_lightgreen" color="#6cb52b"/>
<apply_if additional="color_green" color="#00842b"/>
<apply_if additional="color_lightblue" color="#2ec6ff"/>
<apply_if additional="color_blue" color="#4e4eff"/>
<apply_if additional="color_purple" color="#a71de1"/>
<apply_if additional="color_gray" color="#999999"/>
<apply_if additional="color_black" color="#000000"/>
Thanks for the response. I'll give this a try.
One more question, What are all of the "0's" that are now displayed on the imported map? Is there a way to get rid of them?
The "0" will soon serve as the click-on-map icon. This feature is under construction now. Could you share your OBF file and the GPX tracks included in it (create ZIP archive)?
To remove it manually, you can play with the section OBF-GPX usual shields (based on textLength)
in routes.addon.render.xml
file.
Just try to edit out the following lines:
<case nameTag="ref" textOnPath="false" textColor="#404040" textShield="yellow_square_9_road_shield">
<apply_if textLength="1" textShield="yellow_hexagon_3_road_shield"/>
<apply_if textLength="2" textShield="yellow_hexagon_4_road_shield"/>
<apply_if textLength="3" textShield="yellow_hexagon_5_road_shield"/>
<apply_if textLength="4" textShield="yellow_square_6_road_shield"/>
<apply_if textLength="5" textShield="yellow_square_7_road_shield"/>
<apply_if textLength="6" textShield="yellow_square_8_road_shield"/>
</case>
Just wondering, what exactly is the "click-on-map icon"?
That screenshot must have been a one-of-a-kind. I cannot get that many 0's to display on the screen anymore. It only shows one or two now. I attached the GPX file here. It's a rather large file. MI ORV Route.gpx.txt
The "click-on-map" (aka Road Shield) icon will activate the Save-to-GPX dialog in the future. Additionally, GPX files would have unique tags such as shield_fg, shield_bg, shield_text, and shield_textcolor to customize the Shield appearance.
You can check how it could be displayed on our development screenshot:
Do you have an example of how to implement that in the GPX file? Does this work in v4.9.2? Is the idea to show a shield for each track segment?
The feature is currently under construction.
The current approach is to define 1 shield_fg/bg/text per 1 GPX file, not for each distinct segment.
Your case with a really big GPX file seems unique. Your GPX has 34k points, which is greater than a standard Garmin device can display (AFAIK, a maximum of 20k per 1 GPX).
PS. OBF generation based on this kind of GPX-tags will be available soon. You could try matching the tags in the example below with the corresponding sections of routes.addon.render.xml (XML-file has already been added in 4.9.2):
<metadata>
<name>Terchovsko - Oravská cyklomagistrála</name>
<desc>Strečno - Terchová - Novoť</desc>
<extensions>
<osmand:relation_gpx>yes</osmand:relation_gpx>
<osmand:color>red</osmand:color>
<osmand:shield_text>C</osmand:shield_text>
<osmand:shield_textcolor>red</osmand:shield_textcolor>
<osmand:shield_bg>osmc_white_bg</osmand:shield_bg>
</extensions>
</metadata>
is it possible to add support for style of tracks and points?
./utilities.sh convert-gpx-to-obf xxxxx creates tracks as a very thin red line and track points as red circle with small white star.
It would be nice to have possibility to create tracks with defined width and color as an option. Track point should be the same as define in gpx (icon and color)