LiveTracking .. back in Locus

Started by barbudor, March 25, 2013, 23:05:29

0 Members and 1 Guest are viewing this topic.

barbudor

Hello

I find the LiveTracking feature very interesting, having the possibility to publish its own position to a server is nice.
But requiring to open a web page to see buddies is a annoying while we are already running a mapping application.

What I would love is to see the live tracking the other way back : being able to display within Locus, along my own position, positions of buddies.
I would require some kind of "dynamic points".
Locus could for example submit a GET request to a server giving its current position and the radius of the search, and in return it would get a list of buddies in the neighbourhood.

The radius could be determined automatically by Locus as the displayed area so only buddies displayable on the map would be retrieved.
Or it could be user specified. In that case, if buddies are retrieved outside the map, some icon on the border of the map could show the direction where is such buddy.
It should be also possible to designate one buddy as the destination for navigation which would be updated in realtime (I don't mean road navigation, but heading, like for geocaching).

On my side, I already have such a server to follow tracker devices such as the popular TK102. Getting such live tracking back on Locus where I can see my position vs tracker's device position, and navigate to it would be great.

Note that this also could be the base for an access to AIS (ship position) or net-APRS (HAM radio/internet location sharing systems) servers. (I believe there is also a similar thing for planes).

Thanks for considering this.

(Sorry if this is already posted, But was not able to find anything like this on the forum)

Best regards

barbudor.
  •  

sherman

#1
Hi,

Locus is able to display Network Link KML, which enables to refresh a position of a waypoints from a server. See: http://www.google.com/earth/outreach/tu ... _link.html

I am going to make a simple PHP script which receives data from Locus and makes such NL KML which can be displayed back in Locus or in any other capable app.

The problem remains you should still run your own server.
  •  

berkley

#2
Quote from: "sherman"The problem remains you should still run your own server.

As you need to have an internet connection for sending your position to a live tracking service anyway... Would an app like this work?
https://play.google.com/store/apps/deta ... rsultimate

edit: search google for "free webspace with mysql and php"...
http://www.000webhost.com/
Search before posting!!!
XDA Orbit, HTC Touch HD, SGS1, SGS2, Nexus S, S4 Active, OnePlus One, Innos D6000
OnePlus X
  •  

sherman

#3
Of course any PHP capable server will do. I just wanted to point out someone still has to set it up, it is not "Tap & Play".

I am working on the script right now. I intend it for my personal use only; but once done I will post it here so anyone can modify and use it.

I guess an alpha version could be this/next week.
  •  

barbudor

#4
Hi Sherman

Didn't know that this live KML can work
That's great

I will try to implement it on my server (I already have my own server to manage thos TK102 trackers)

So I just need to make a base KML which refer to the URL/PHP on my server which in turn provide the latest position of the tracked objects.
I just have to open this KML in Locus, et voilà ?
If I am correct, the refresh period is also defined in the KML itself.

Thanks.

I will try and report back here
  •  

gynta

#5
Quote from: "barbudor"What I would love is to see the live tracking the other way back : being able to display within Locus, along my own position, positions of buddies.

An Idea similar to:
https://getsatisfaction.com/locus/topic ... ote_server
or
https://getsatisfaction.com/locus/topic ... y_tracking

barbudor

#6
Guys,

I've been able to experiment with quite good success.

Here is the structure of my network-link file :
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
  <Folder>
    <name>My Buddies</name>
    <visibility>0</visibility>
    <open>0</open>
    <description>Folder-Desc</description>
    <NetworkLink>
      <name>NL-Name</name>
      <visibility>1</visibility>
      <open>0</open>
      <description>NL-desc</description>
      <refreshVisibility>0</refreshVisibility>
      <flyToView>0</flyToView>
      <Link>
        <href>http://myserver.url/map/data2kml.php</href>
        <refreshInterval>10</refreshInterval>
        <refreshMode>onInterval</refreshMode>
        <viewRefreshMode>onStop</viewRefreshMode>
        <viewRefreshTime>0</viewRefreshTime>
      </Link>
    </NetworkLink>
    <ScreenOverlay>
      <name>buddies logo</name>
      <visibility>1</visibility>
      <description>Real-time buddies tracking</description>
      <Icon>
        <href>http://myserver.url/map/image/buddies3a.png</href>
      </Icon>
      <overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
      <screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
      <size x="-1" y="-1" xunits="fraction" yunits="fraction"/>
    </ScreenOverlay>
  </Folder>
</kml>

And here is a sample returned KML from the PHP script:
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2' xmlns:gx='http://www.google.com/kml/ext/2.2' xmlns:kml='http://www.opengis.net/kml/2.2' xmlns:atom='http://www.w3.org/2005/Atom'>
  <Document>
    <visibility>1</visibility>
    <Style id="bgx">
      <IconStyle>
        <Icon>
          <href>http://myserver.url/map/image/bgx.gif</href>
        </Icon>
        <hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
      </IconStyle>
    </Style>
    <Folder>
      <name>MyBuddy</name>
      <open>1</open>
      <Placemark>
        <name>MyBuddy</name>
        <styleUrl>#bnx</styleUrl>
        <Point>
          <coordinates>2.332078,48.339405</coordinates>
        </Point>
      </Placemark>
    </Folder>
  </Document>
</kml>

For now the PHP script is dummy and return a point which move on a segment.

I can successfully see the icon of my buddy moving on the map at the proper refresh rate.

Question 1 : If I try to get into a menu like "Map" or "Data", it automatically goes back to the map at the refresh timeout. For example with a refresh rate of 10 sec, I can go to the Data window but it will come back to the map at expiration of the 10 sec timer.
Am I doing something wrong ?
Anything to prevent this display reset ?
==> I think that when we are in another window than the map window, the refresh shall still be performed in the background but we should be able to navigate into other windows of the software.

Question 2 : Is there a way to start a navigation towards my buddy (compass mode, like a geocache, not turn-by-turn navigation) ? The buddy does not appears in the data section, so I don't know how I could request Locus to drive me to my buddy.
Would be super useful if the buddy is out of the screen.

Question 3 : I would like to provide arguments to the PHP script in the network-link file. Something like :
       <href>http://myserver.url/map/data2kml.php?buddyId=123456&&buddyName=MyFriend</href>
GoogleEarth rejects this syntax.
Any idea how I could have it working ?

Question 4 : I would hope that the icons are cached and not reloaded each time the file is refreshed but I am afraid it is not the case. I don't have any idea how I could check this.
Do you think icons are cached ?

Thanks for your help.

best regards

barbudor
  •  

sherman

#7
Hi barbudor,

you got farther then me - I started to write the script but had not enough time to get it to a working state. So I am sorry but I am not able to help you as you know more then I now ;)

The quit from menu after KML refresh time seems to be a bug in Locus - we should ask menion to look at it.

Multiple arguments should work but you have to use "&amp;" instead of simple & – see https://groups.google.com/forum/?fromgr ... oODLYgItxo

Do you plan to provide your script to others? I would like to do it myself but I am afraid I will not have enough time to finish it to be really usable.
  •  

barbudor

#8
Hi Sherman
It was quick because I already have a tracking application in place and an existing similar script which create an GoogleImageMap.
So I just had to replace the GoogleImageMapApi syntax by KML syntax.
Which also mean this script is essentially tight t my existing application which I use with embedded trackers like TK102/TK103.
So as I don't plan to release my full application that do not make much sense releasing just the script.
Or may be I will do an simplified one.

Just tried the &amp; and it works
However <httpQuery> works in GEarth but not in Locus

I have also noticed that each refresh use 10KB of date which confirm that icons are reloaded each time. Clearly not a good solution.

I have also been able to activate navigation but unfortunately the it is started towards the location where the buddy is at the time it is enabled. When the buddy move, the navigation still points to the original location. Unfortunate.

These 2 last points make we believe that while this is great, I should probably look into Locus API to write an add-on :
- to limit download of icons
- to allow navigation to a moving buddy
- to allow center map on a moving buddy (instead of my own location)

What is the preferred method to report bugs and enhancement suggestions to Menion ?
Is that on this forum or on Getsatisfaction ?

Thanks & Best regards

Barbudor
  •  

gynta

#9
Getsatisfaction

barbudor

#10
Hi

Concerning the point 2 here above (downloading icons at each refresh) I tried as per a suggestion from berkley on getsatisfaction, to use a KMZ.

So I build MyBuddies.kmz from which the doc.kml is as follow:
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2' xmlns:gx='http://www.google.com/kml/ext/2.2' xmlns:kml='http://www.opengis.net/kml/2.2' xmlns:atom='http://www.w3.org/2005/Atom'>
<Document>
<visibility>1</visibility>
<Style id="bgs">
 <IconStyle>
<Icon>
 <href>MyBuddies/files/bgs.gif</href>
</Icon>
<hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
 </IconStyle>
<Folder>
<name>MyBuddies</name>
<description>Real-time buddies tracking</description>
<visibility>0</visibility>
<open>0</open>
<NetworkLink>
<name>Real-time position</name>
<visibility>1</visibility>
<open>0</open>
<description>Real-time position</description>
<refreshVisibility>0</refreshVisibility>
<flyToView>0</flyToView>
<Link>
<href>http://myserver.net/map/data2kml2.php?devid=xxx&amp;devname=TK102</href>
<refreshInterval>10</refreshInterval>
<refreshMode>onInterval</refreshMode>
<viewRefreshMode>onStop</viewRefreshMode>
<viewRefreshTime>0</viewRefreshTime>
</Link>
</NetworkLink>
<ScreenOverlay>
<name>MyBuddies logo</name>
<visibility>1</visibility>
<description>Real-time buddies tracking</description>
<Icon>
<href>MyBuddies/files/buddies2a.gif</href>
</Icon>
<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<size x="-1" y="-1" xunits="fraction" yunits="fraction"/>
</ScreenOverlay>
</Folder>
</Document>
</kml>

And the KML returned by the PHP script is as follow :

<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2' xmlns:gx='http://www.google.com/kml/ext/2.2' xmlns:kml='http://www.opengis.net/kml/2.2' xmlns:atom='http://www.w3.org/2005/Atom'>
<Document>
<visibility>1</visibility>
<Folder>
  <name>My Buddy</name>
  <open>1</open>
  <Placemark>
    <name>My Buddy name</name>
    <styleUrl>MyBuddies.kmz#bgs</styleUrl>
    <Point>
       <coordinates>2.3331678,48.333005</coordinates>
    </Point>
    </Placemark>
</Folder>
</Document>
</kml>

The Overlay picture defined in MyBuddies.kmz/doc.kml works fine (it can find the picture within MyBuddies/files/) but then I have not been able to find a proper syntax for referring the style "bgs".

Any idea ?

thanks
  •  

berkley

#11
have a look at this page:
https://developers.google.com/kml/docum ... mzarchives

sorry, no Desktop Computer available right now to fix your problem.
but i think, you will find an answer in the link above.
download the files and replace your own images to understand how it works.
Search before posting!!!
XDA Orbit, HTC Touch HD, SGS1, SGS2, Nexus S, S4 Active, OnePlus One, Innos D6000
OnePlus X
  •  

Menion

#12
1. images from KML files are always cached. Are you sure they aren't? Have to check it
2. seems you really want to have stuff around KML/KMZ improved. I just started work on some altitude stuff, but seems, this will have higher priority ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •