dev-maps
DEV:
    maps
< PRE-DRAFT >

Revisions:
    xxxx stub
    xxxx push d+kor @ 🔗season6-B
    20200807 light touch




Basics

* Replace Google MyMaps with OpenStreetMaps as underlying engine

* Edit coordinates in a pad via an API !

* Improve 🔗trails, in direction of a system to find people to co-travel routes with

* Rendering map to image/pdf file:
    * My maps on web -> ... -> Print (A3, Landscape, PDF). Automate!:
        * Request needs a coordinate bounding box (in url) and a Google cookie
        * Berlin map url: http://www.google.com/maps/d/pdf?mid=1CXjFDEriRqbyHivFkit67lbhhP8&pagew=1190&pageh=842&llsw=52.435347%2C13.190363&llne=52.59914%2C13.357218
    * OSM? (bounding box (easy) + how to render?)





*** TODO


... Try OsmAndMapCreator ???

http://wiki.openstreetmap.org/wiki/OsmAndMapCreator
* .jar was not easy to find (should be on side)
* .jar is on HTTP
------------
#TODO @34c3
        find them, define user cases, and go!



E2H must allow direct .GPX exporting from pads

* set correct mime type?

* anything else for it tow work in osmand?

_________

TESTING ON PHONE:
    just open "https://e2h.totalism.org/e2t.php?_=test-gpx.gpx&mime=gpx" !
    STATUS: ??? TODO

TESTING ON LAPTOP -  as 🔗test-gpx.gpx:
    https://e2h.totalism.org/e2t.php?_=test-gpx&mime=gpx
    --------
    SANITY CHECK:
        $ curl -I "https://e2h.totalism.org/e2t.php?_=test-gpx.gpx&mime=gpx"
        MUST SAY IT IS "GPX" type !!!



Make the GPX (like, from E2gpx) also work on "[Gnome] Maps"

STATUS:
    * the base gpx from 🔗test-gpx works if copied to file -- as equal dots

NEXT:
    DIFFERENT MARKERS ?
    DIFFERENT "TYPES"?





*** STAGES


version 1

manual + scripts to... :

    * export from (mobile) OSMand markers to some common (web) map:

            SHOULD have some notion of "types" (=marker color/icon & type name)

                A) current Google MyMaps map

                B) some sort of a new OSM-based self-hosted map:
                    * self-host OSM
                    * import existing data (including types)

                C) use OSMAnd Favorites:
                    C1) make a hacky python script to separate a .gpx by types:
                        * !!! DAVID HAS SOME PYTHON CODE @ CHTv1🔗cht-dev-maps-export
                        * each type is its own GPX file now!
                    C2) hack OSMAnd config in a way to "include the whole legend" (=a set of sets):
                    C3) possibly also refreshing all of this periodically ?

                * [...]




    hacking favorites.gpx [d]

$ adb pull "/storage/self/primary/Android/data/net.osmand.plus/files/favourites.gpx"
# EDIT
$ adb push favourites.gpx "/storage/self/primary/Android/data/net.osmand.plus/files/favourites.gpx"
$ adb shell
$$$ cat "/storage/self/primary/Android/data/net.osmand.plus/files/favourites.gpx"


* has a "color":
    I THINK ALSO ONLY SUPPORTS A DEFAULT SET OF COLORS:
        <color>#b410c0f0</color> == LIGHTBLUE
        <color>#b488e030</color> == GREEN
        <color>#b4a71de1</color> == PURPLE


* (trying to change this ........... @20190205)




version 2 (ideas)

* have OSM maps (tiles) and markers setup without OSMand (==in self-hosted web or desktop)

* auto-import marker sets

* do something cool with Trip Recording ("trails"):
    what you already have is "ONLINE TRACKING" (see Plugins > Trip Recording > settings !)

* make the app interface let you "select your ontology", so the way sets of poitns will be represented on export !
(talk of david and kor)






*** imported from david notes [SORTING!!!]


SOLUTION


    .KML -> .OSM

via:
        * http://osmand.net/help-online?id=technical-articles#Using_KML_Files
        * [...]

FROM
        $ gpsbabel -i kml -f my_places.kml -o osm,tagnd="tourism:museum",​created_by -F my_places.osm

TO
        gpsbabel -i kml -f *Kranj*.kml -o osm,tagnd="tourism:museum",​created_by -F TESTIS.osm

OK.



    .OSM -> .OBF

"OBF format is the output format and used by OsmAnd for offline rendering, routing, and search on a mobile device"

VIA:
        http://wiki.openstreetmap.org/wiki/OsmAndMapCreator#Regular_Creation_of_OBF_Files_.28via_Command_Line.29

FROM:
        $ java -Djava.util.logging.config.file=logging.properties -Xms64M -Xmx6300M -cp "./OsmAndMapCreator.jar:lib/OsmAnd-core.jar:./lib/*.jar" net.osmand.data.index.IndexBatchCreator batch.xml 

TO:
        $ java -Djava.util.logging.config.file=logging.properties -Xms64M -Xmx6300M -cp "./OsmAndMapCreator.jar:lib/OsmAnd-core.jar:./lib/*.jar" net.osmand.data.index.IndexBatchCreator batch-DAVID.xml 



    NEXT

<--------------------------------- (NOW) ....... the old one



CHECK THIS !!!!!!


        * ALIKE WORKS !!!!!!

                "HOW To – Import POIs to Osmand" PDF by "richard.goodwin@morphology.co.uk" !!!!!!
                Add to .GPX:
                        """
                        <category>Wildcamping – Car Park Rural</category>
                        <extensions>
                                <color>#1CD71C</color>                        
                        </extensions>
                        """
                COOL!



                ----------------------------- extra research now:

                        * .KML does specify color:
                                in separate <style><iconstyle> parts
                                they're referenced in individual <placemark> items .....
                                but this is lost to .GPX in babel .........
                        
                                WHAT NOW ???????????????????????
                                
                                        a) patch babel to include color!
                                                * new type, "osmgpx" which would do the right thing
                                                * OR ???
                                        b) generate .GPX out of Google's .KML myself
                                        c) [...]


                        * CAN I FILTER BY THE TYPES I SPECIFIED?
                                i think not

                        * http://www.topografix.com/gpx/gpx_style/0/2/
                                possible bug: i think "category" is not valid GPX!

                        * [...]



                --------------------------------- READING CODE:

                        * seems both "category" or "type" would work
                                https://github.com/osmandapp/Osmand/blob/2e64b42727b5f7e0dc375b2aa6a0608e2d12b837/OsmAnd/src/net/osmand/plus/GPXUtilities.java#L1109

                        * [...]





        * CHECK MORE ALIKE SOLUTIONS:
                
                * "My places" ?????

                * https://github.com/andrewerrington/sotalayer

                * [...] 
                
        

        
        * OSMAND CODE !!!!!!

                * GPXUtilities.java
                        * parses EXTENSIONS and COLOR
                        * https://github.com/osmandapp/Osmand/blob/2e64b42727b5f7e0dc375b2aa6a0608e2d12b837/OsmAnd/src/net/osmand/plus/GPXUtilities.java
                * [...]







DOING THIS

<---------------------------- (now) UPDATE: try if all of this does something

:
        * CONNECT PHONE !
        
        * doctor a .GPX FILE as above and upload and test!

        -------------------------------------------
        
        * put the .OBF files to PROPER PHONE LOCATION
                ... which are:
                        * mtp://[usb:001,008]/Internal%20storage/Android/data/net.osmand/files
                                * favourites.gpx
                                * poi_types.xml
                                * /tracks/rec
                                * /tracks/import
                                * [...]
                        * mtp://[usb:001,008]/SD%20card/Android/data/net.osmand/files
                                SEEMS A DIFFERENT ONE !??????!!!!!
                        * [...]
                --------------------------
                #TOMERGE
                WITH __ANDROID_PULL !!!!!!
                --------------------------------
                via:
                        * http://wiki.openstreetmap.org/wiki/OsmAndMapCreator#Copy_OBF_File.28s.29_to_mobile_phone


        * TORESEARCH: what are the allowed "tagnd" types ???????????
                Info:
                        * These are "POI icons" I think?
                        * See http://osmand.net/help/HowToArticles.html#How_To_Use_Your_Own_POI_Database
                Mod:
                        * see "poi_types.xml" !
                        * can customize ?????????????? <----------
        
        
        * MANUAL OSMAND .OBF FOR REGIONS:
                http://download.osmand.net/rawindexes/ !!!!!!
                #WORKFLOW







RESEARCH


    WHAT TO DO

$ gpsbabel -i kml -f my_places.kml -o osm,tagnd="tourism:museum",​created_by -F my_places.osm

via
        https://www.youtube.com/watch?v=Y_fekLfcUOc&feature=youtu.be

* generate sqlite file
* put in tiles folder
* set as "overlay map and underlay map"


-----------------------

More info:
    * https://www.youtube.com/watch?v=qkknv48ySBE
    * [...]



------------------------

ACTUALLY:
    * the sqlite is for TILES
    * this is the solution to my MARKERS PROBLEM:
            http://osmand.net/help-online?id=technical-articles#Using_KML_Files
            <---------------- (now) !!!!!!

So:
        * gpsbabel to .osm
        * use OsmAndMapCreater to create .obf
                http://wiki.openstreetmap.org/wiki/OsmAndMapCreator



    QUESTIONS:

can OSM->OBF be done in CLI???????
    https://help.openstreetmap.org/questions/29155/how-to-convert-an-osm-file-to-obf-via-command-line !!!!!!
    https://help.openstreetmap.org/questions/25683/import-my-maps-from-my-google-account-to-osmand-app



    SOLUTIONS / TOOLS

    * https://github.com/osmandapp/OsmAnd-tools

    * wiki.openstreetmap.org/wiki/Osmconvert ?
                -----------
                package: osmctools
                $ osmconvert
                
                
    * http://wiki.openstreetmap.org/wiki/Osmosis

    * [...]








*** OPEN QUESTIONS


(osmand) is it a restricted set of colors?


(osmand) is it okay for us (as gpx providers) to assume map ontology?







*** PAD


201902 <kor | osmand importing

Osmand:
    * Cannot import multiple colors in the same category:
        (don't know how david did it (--TODO). it's android color format).
    * However it is possible to:
        import multiple categories at a time (=in a single file), each with a color if we want
        (not sure if it's a restricted set of colors)

two options (for exporting from MAPS):
    a) import in a single category:
        Colors/maps symbol/categories are lost.
        But we don't pollute the favourites.
    b) import in multiple categories:
        Colors will represent different categories.
        But we import lots of categories at once.
        ... This may be unwanted by the user who does not want to adopt the same "legend".


automatic rating of craters.




201902 | get osmand "favorites.gpx" with adb

(for david's samsung x)

$ adb pull "/storage/self/primary/Android/data/net.osmand.plus/files/favourites.gpx"
$ adb push favourites.gpx "/storage/self/primary/Android/data/net.osmand.plus/files/favourites.gpx"






(MOVING IN FROM 20190204 +kor)


Put somewhere !!!


___  ___  ___  ___  ___  ___  ___  ___  ___  ___  ___  ___  

  Approaches


      A) import the markers from existing google-maps:
    * GPX into PHP scripts KMS


      B) OSMand markers as GPX file:
    * to upload 1/month to the website
    * BUT how to merge markers from everybody ?


      C) set up an editor as good as google maps:
    * collaborative editor for OSM


      D) satellite view for offline maps


_________________________________________________

#todocument
>david +matic
import markers & types





Fuerte maps ...

lol :) 

https://docs.google.com/spreadsheets/d/1f7v-FFV_H4zt1TlL_1MxOXmFmzsKBImyzp14xSMkvpM/export?format=pdf&gid=931643835
(link on site)
--->
https://docs.google.com/spreadsheets/d/1f7v-FFV_H4zt1TlL_1MxOXmFmzsKBImyzp14xSMkvpM/export
--->
etc ?




ACCESS BUGS ... 2020/02/28 !!!!!!

WORKS OK
https://totalism.org/E2H/kmz2gpx.php?LINK=zFrRdvAInsWM.k9JS7oeaIbNQ&NAME=Lanzarote,%20Canary%20Islands

DOES NOT WORK
https://totalism.org/E2H/kmz2gpx.php?LINK=1zezxHo_v75i9aErdjAiXzXvuoU2RVlmn&NAME=Fuerteventura,%20Canarias

https://totalism.org/E2H/kmz2gpx.php?LINK=1KLi4Chw650N5U2mNl87lGTdzcYc&NAME=Busline%206

OK I SEE THE PROBLEM :-/




("dev-osm" contents)

This really needs to happen though.

Not so much to "get rid of google" - Google MyMaps is a great editor, and all the data is public.
More because we need to keep and navigate OFFLINE MAPS without needing to resort to OsmAnd.



(was on the todos page, no idea what this is)

* Putting images with gps data on map:
    * gpsbabel:
        # init output file
        $ echo "<gpx></gpx>" > <output.gpx>
        # add image one by one
        $ gpsbabel -i exif -f <image.jpg> -i gpx -f <output.gpx> -o gpx -F <output.gpx>
    * google http://support.google.com/mymaps/answer/3433053 :
        Create a new layer
        Click Import
        Select Photo albums
        Choose the photos you want to import and click Select
        Your photos will automatically be placed on the map and a thumbnail image will be created for each photo




<--------------------- ((new))





(Site generated by E2H, an "Etherpad hypermedia" project by @dcht00). Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.


Edit Site

Edit CSS