Coder Social home page Coder Social logo

Comments (20)

suntri-star avatar suntri-star commented on June 21, 2024 1

io2osm-namibia.py.tar.gz

I adapted the small script according to my needs. Now I'm very happy with it. Thanks again. Great thing.

from osmand.

mariush444 avatar mariush444 commented on June 21, 2024

Please verify if you have osmand definition at the end of the gpx file.
Something like

<extensions>
    <osmand:points_groups>
      <group name="Official Campground" color="#1010a0" icon="building_type_pyramid" background="circle" />
      <group name="Informal Campsite" color="#1010a0" icon="special_star" background="circle" />
      <group name="Wild Camping" color="#1010a0" icon="special_star_stroked" background="circle" />
      <group name="Hotel" color="#1010a0" icon="tourism_hotel" background="circle" />

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

places20240528-186-aihxsw.gpx.txt

try three

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

I assign the colors and icon after the import. “Categories” are created under points as shown in the picture. If I import the newer file later, the points fall into the same categories. That's good. But they don't have the color and icon like the existing ones. And if there is an identical point, you won't be asked whether you should skip it or overwrite it. The dot will then appear twice. And if I do it again three dots appear.

I also can't delete an old import or a country. Only everything or categories. A pity.

from osmand.

mariush444 avatar mariush444 commented on June 21, 2024

Generally (in my opinion based on observation and practse)
When you got exported data from iO to gpx file don't import it to osmand.
Osmand during import makes some coversion and import waypoint to its internal DB that is not optimalized to big number of favorities and doesn't recognize duplicates
Beter method is to copy gpx to osmand's tracks folder. (I hope you have access to the folder and you know how to do it).
After coping you can activate it as any other gpx in menu favorities -> tab tracks -> 3dots -> show on the map.
In the track menu "points" you have possibility to activate/deactivate groups in gpx fastly and change icon/colors for group and/or waypoint.
When you have new gpx then do the same what you have done with previous one but deactivate the previous file.
Thats all.

Problem with icon/color for group.
Befor coping gpx into folder edit gpx file and put my code at the very end of the file before last tag .

</wpt> <- the last wpt
<- put the code here
</gpx> <- the last tag in the file

Of course, this is my proposition of icons and colors. You can change as you want.

PS. Please notice that exported file from iO contains only the 1st note about a waypoint. Any added info are ommited during export by iO, so it means that you haven't newest info in osmand. You have to use iO still.


<extensions>
      <osmand:points_groups>
        <group name="Official Campground" color="#1010a0" icon="building_type_pyramid" background="circle" />
        <group name="Informal Campsite" color="#1010a0" icon="special_star" background="circle" />
        <group name="Wild Camping" color="#1010a0" icon="special_star_stroked" background="circle" />
        <group name="Hotel" color="#1010a0" icon="tourism_hotel" background="circle"/>
        <group name="Hostel" color="#1010a0" icon="tourism_hostel" background="circle"/>
        <group name="Propane" color="#10c0f0" icon="gas" background="circle"/>
        <group name="Mechanic and Parts" color="#a71de1" icon="shop_car_repair" background="circle" />
        <group name="Water" color="#10c0f0" icon="water_tap" background="circle" />
        <group name="Restaurant" color="#10c0f0" icon="restaurants" background="circle" />
        <group name="Customs and Immigration" color="#a71de1" icon="barrier_border_control" background="circle"/>
        <group name="Other" color="##dfc520" icon="special_flag" background="circle"/>
        <group name="Fuel Station" color="#a71de1" icon="fuel" background="circle" />
        <group name="Tourist Attraction" color="#d00d0d" icon="special_star_stroked" background="circle" />
        <group name="Sanitation Dump Station"  color="#10c0f0" icon="sanitary_dump_station" background="circle" />
        <group name="Consulate / Embassy" color="#a71de1" icon="barrier_border_control" background="circle"/>
        <group name="Vehicle Insurance" color="#a71de1" icon="insurance" background="circle"/>
        <group name="Vehicle Shipping" color="#a71de1" icon="route_ferry_ref" background="circle" />
        <group name="Checkpoint" color="#a71de1" icon="amenity_police" background="circle" />
        <group name="Warning" color="#000001" icon="special_symbol_exclamation_mark" background="circle" />
        <group name="Shopping" color="#10c0f0" icon="shop_supermarket" background="circle" />
        <group name="Medical" color="#10c0f0" icon="clinic" background="circle"/>
        <group name="Pet Services" color="#10c0f0" icon="pet_grooming" background="circle"/>
        <group name="Laundry" color="#10c0f0" icon="shop_laundry" background="circle"/>
        <group name="Laundromat" color="#10c0f0" icon="shop_laundry" background="circle" />
        <group name="Vehicle Storage" color="#a71de1" icon="parking_multi_storey" background="circle"/>
        <group name="Short-term Parking" color="#a71de1" icon="amenity_parking_paid" background="circle" />
        <group name="Eco-Friendly" color="#dfc520" icon="special_flag" background="circle"/>
        <group name="Financial" color="#10c0f0" icon="amenity_atm" background="circle"/>
        <group name="Wifi" color="#10c0f0" icon="internet_access_wlan" background="circle" />
        <group name="Showers" color="#10c0f0" icon="shower" background="circle"/>
      </osmand:points_groups>
    </extensions>

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

Thanks for the answer to my question. I've tried this before and wasn't happy with it. Now I will test it again with the additional code. I hope this gets better. Of course, this approach is no longer applicable for every user. I'll report back with my results. THANKS

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

It looks bad. I am quite sure that the directory where the GPX files are located was accessed months ago. But access is no longer possible. I can't copy files there. I don't see it anymore either. Something must have changed.
I tried moving OSMand from the location. Unfortunately that didn't help.

from osmand.

mariush444 avatar mariush444 commented on June 21, 2024

What Android version do you have? What phone (samsung, xiaomi ....)?
Can you show "data storage folder" in osmand settings?

Can you install Mixplorer from gplay or github or other app
https://play.google.com/store/apps/details?id=org.aospstudio.files

(This app is link to embeded andriod file menager that should show more than usually . You will see it in app list as second file manager)

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

I've come a little further.
I have access to the directory using Android's file manager.
This was not possible with another file manager. Strange.
Now I have already put a modified GPX file in the directory. I see the dots on the map. Unfortunately all with standard icon and color. Now I'll look again at what you wrote above and implement it exactly the same way. I'll get in touch

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

first copied the gpx files to obb/net.osmand.plus/tracks/import. I could turn it on and off. However, everything is red and normal icon.
I think that was the wrong place. So I moved it to obb/net.osmand.plus/favorites/. I also see 4 groups that I know. But after starting up I don't see the new GPX files for selection? Which is the right place?

from osmand.

mariush444 avatar mariush444 commented on June 21, 2024

Can you attach you gpx file?

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

io-botswana.gpx.txt

Here the file

from osmand.

sonora avatar sonora commented on June 21, 2024

Cross-link to #19892 (comment), closely related.

There seems currently a bug, probably a regression, to the effect that the point group appearacne extension at the end of GPX files is not properly handled (or perhaps ignored) when displaying the waypoint icons.

from osmand.

mariush444 avatar mariush444 commented on June 21, 2024

Yes, I noticed that and try to prepare python script for you to solve it (workaround). The queation is if you can use python? (e.g. pytdroid on android or python on pc)

from osmand.

sonora avatar sonora commented on June 21, 2024

@Chumva Perhaps your work on GPX appearance nid April may be related? We need to somehow have a logic where the gpx appearance extensions (tags color, icon, background) are honored in this priority order:

  1. Highest priority: user's appearance setting in OsmAnd (only if/once specifically set), overrules
  2. file-internal specification from extension directly in each point's <wpt> section, overrules
  3. applicable file-internal group specification from osmand:points_groups extension, overrules
  4. Osmand's rendering default

Code ref, as found for the Editor, already partially honoring this:

But I cannot find such group color detection code outside the Editor function, and even there the identifcation of the groups seems buggy, as all wpts fall back to the favorite default color after exiting/canceling the edit dialog.

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

I don't want an intermediate solution with Python. I hope the bug can be fixed in the next version. My next trip is scheduled to start at the end of July. It would be nice if it could work until then. Otherwise, I'll do the import as before, unfortunately with a lot of effort.

from osmand.

vshcherb avatar vshcherb commented on June 21, 2024

@sonora GPX-specific settings only apply latest if all other are default. Also in application you can reset folder or specific track to "default view".

Please note that we didn't implement yet Default Favorite appearance as we planned to make it similar to GPX Folder default settings.

from osmand.

mariush444 avatar mariush444 commented on June 21, 2024

@suntri-star
Anyway I've already done it so maybe it will be helpful for others.


how to run
copy gpx from iOverlander and the script into the same directory
in Pydroid 3 (from Google play store)
from menu choose option Terminal
change directory to the script (use command: cd PATH)
run scrpit (use command: ./io2osm.py)

when finnished, you find new gpx file in the directory


how to modify

open script in text editor
change input and output file to convert other files

you can modify icons, shape and colors as you need
it is just my proposition
BUT you have to change item twice
1st occurence is for waypoints - line starts with: replace('
2nd occurence is for group - line starts with: '<group name="

it is not optimalized but I'm on a trip and I have smartphon only with me and I tested one file only that I got from you.

icons that you can use are in pdf https://github.com/mariush444/gmapIcons2osmand/blob/main/icons-gmap-osmand.pdf
background: circle , square , octagon
color - any you like


zip contains: python script, converted file of Botswana and this info
iO2osm.zip

from osmand.

suntri-star avatar suntri-star commented on June 21, 2024

Hello
I tried the script. It works perfectly. I will now adapt it to my needs. So I have a solution for my needs. However, I hope that the problem will be incorporated into the product so that it becomes easier. I'm sure I'm not the only one who would be happy about that.
I would like to thank you very much for your support.
I hope point "Online recording - Buffer for long trips (7 days) #19972" will also be incorporated into the product. I'm on tour at the end of July where I would really like to use it.
So thank you again and kind regards from Switzerland.

from osmand.

yuriiurshuliak avatar yuriiurshuliak commented on June 21, 2024

The bug has been reproduced. When a custom appearance is set for a group of favorites and new favorites are imported into that group, the new favorites don't adopt the custom appearance.

Currently, we haven't implemented the default appearance for favorites. As a workaround, after importing new favorites, you can change their appearance to the desired one by clicking "Apply to existing". Alternatively, if you prefer to add favorites manually, you can select "Apply only to new favorites," and all manually added favorites will inherit the custom appearance previously assigned.

OsmAnd~ 4.8.0#2476m, released: 2024-06-10

from osmand.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.