Apps-madeingermany.de Forum

Welcome to my support forum

You are not logged in.

#1 2014-11-10 13:26:17

Appsmadeingermany
Administrator
Registered: 2014-10-26
Posts: 256

Export / Import Positions and Routes

The app supports import and export of routes and positions from version 1.7.0 and up.
You can export and import to your SD-Card or import from URLs. You will find the options in the "Storage" Tab.
Here is how you have to format the data to be able to import it:

Just make a .txt file with one route/position per line.

A route is identified by a "r" at the beginning of the line, followed by the name of the route and then the position data in brackets. EDIT: Added delays to routes - the third parameter is the delay in ms.

r,routeName,[latitude1:longitude1:delay1;latitude2:longitude2:delay2]

Example:

r,smallRoute,[12.112142108:49.017142583:0;12.118846625:49.015086613:2000]

A position is identified by a "p" at the beginning of the line, followed by the name of the position and then a single position in brackets

p,positionName,[latitude:longitude]

Example:

p,regensburgDom,[12.098302580:49.019728805]

Here is a full example file:

r,anotherRoute,[12.11166501:49.016941827;12.110506966:49.013997245;12.114189304:49.013473223;12.117143757:49.013730727;12.11962413:49.015448338]
r,myRoute,[12.101894728:49.020134471;12.102143168:49.020978552;12.104376107:49.021676629;12.107954174:49.021343093;12.112941406:49.020836517;12.112719118:49.019534876;12.112066671:49.017341578;12.109891735:49.017707025;12.107602134:49.018359193;12.105374895:49.018742442;12.103418894:49.019265529]
r,smallRoute,[12.112142108:49.017142583;12.118846625:49.015086613]
p,position1,[12.113447003:49.020495499]
p,regensburgDom,[12.098302580:49.019728805]

Please ensure to provide valid data to prevent inconsistent databases.

You can find the file here: http://www.apps-madeingermany.de/exampleData.txt
To directly import this file just type that link in the "Import data from URL" and click import.

Best regards,
appsmadeingermany

Offline

#2 2015-06-11 12:07:00

fieps
Member
Registered: 2015-06-11
Posts: 12

Re: Export / Import Positions and Routes

Quick and dirty solution for position list converting from iitc export of portals (eg with Faction List Plugin):

Input Format (München):

[{"longitude":11.574524,"latitude":48.155279,"name":"Salo"},{"longitude":11.575313,"latitude":48.154919,"name":"Donuts and Candies"},{"longitude":11.575474,"latitude":48.155204,"name":"Hirsch am Haus"}]

(Format is used by THEGAME and can be produced with IITC Tampermonkey Plugin "Waypoints" https://gist.github.com/d3zorg/080bc3139e05e8ab7599 )


First result position list:

p,Salo,[48.155279:11.574524]
p,DonutsandCandies,[48.154919:11.575313]
p,HirschamHaus,[48.155204:11.575474]

Second result is route:

r,ROUTENNAME,[48.155279:11.574524;48.154919:11.575313;48.155204:11.575474]


Just copy result to your fav. text editor, change "ROUTENNAME" and import it


Maybe it helps.
Hint: You have to use "Switch longi/Lati" Mode in Spoofer to import

Here quick&dirty php solution without any html  - but it works:

<?php

$json = $_POST["nachricht"];
echo('
<form action="test.php" method="post">Eingabe:<br><textarea name="nachricht" cols="80" rows="30"></textarea><br><br><input type="submit" value="Umwandeln"></form>');

if($json!="") {

$aUmlaute = array( "ü" => "ue", "Ü" => "Ue",
                   "ä" => "ae", "Ä" => "Ae",
                   "ö" => "oe", "Ö" => "Oe",
                   "ß" => "ss" );
                   
foreach( $aUmlaute as $sSonderZeichen=>$sReplace ) {
    $json = str_replace( $sSonderzeichen, $sReplace, $json );
    $json = str_replace(" ","",$json);
};


$json = utf8_encode($json);
   
$a = json_decode($json, true);


// Ausgabe der Liste als Places
echo("Places:<br><br>");

foreach ($a as $nr => $inhalt)
{
echo("p,");

$text= $inhalt['name'];

$text = preg_replace ( '/[^a-z0-9 ]/i', '', $text );
echo( $text.",[" );
echo( $inhalt['latitude'].":" );
echo( $inhalt['longitude']."]<br>" );

}


// Ausgabe der Liste als Route

echo("<br><br>Route:<br><br>");
echo("r,ROUTENNAME,[");

foreach ($a as $nr => $inhalt)
{


$text= $inhalt['name'];

$text = preg_replace ( '/[^a-z0-9 ]/i', '', $text );

echo( $inhalt['latitude'].":" );
echo( $inhalt['longitude'].";" );

}
echo("]");


};

?>

Last edited by fieps (2015-06-11 17:48:13)

Offline

#3 2016-07-20 02:01:12

ChrisKader
Member
Registered: 2016-07-20
Posts: 2

Re: Export / Import Positions and Routes

When importing routes from google and using an https:// link, the app adds another http:// in front of the https:// to give something like this: http://https://

Any fix for this or am I doing this incorrectly? I assumed that I set a route on google maps and then import said map into the app.

Offline

#4 2016-07-23 12:36:51

Appsmadeingermany
Administrator
Registered: 2014-10-26
Posts: 256

Re: Export / Import Positions and Routes

I tested it and it works just fine. Take a link like this:
https://www.google.de/maps/dir/49.01015 … m2!4m1!3e2
and paste it into the "Import Route from Google Maps" dialog and click import.

Offline

#5 2016-09-27 21:26:22

kandor
Member
Registered: 2016-09-27
Posts: 2

Re: Export / Import Positions and Routes

Quick Konverter from "old" Route-Format (Gan*ss-Tool) into new Routformat with (Delay)

Php //

// Konverter zum Umformatieren bestehender GPS Fake Location Routen
// nach Update wurden Lat/Long Vertauscht und ein dritter Parameter für Pause in ms eingeführt

$filename = "ZentrumNord.txt";
$filename_new = substr($filename,0, strpos($filename,"."))."_nf.txt";

$route = trim(file_get_contents($filename));
$route_new = "";

$time_pause = "10000";

if ($route != false){

    echo $filename . "<br/>";
    echo $filename_new . "<br/><br/>";
    echo "Route wurde geladen...<br/>";

    // alte Route auseinandernehmen
    
    $route_new = substr($route,0,strpos($route,"[")+1);
    $data = substr($route, strpos($route,"[")+1, strlen($route)-strlen($route_new)-1);
    
    echo $data;
    
    $koordinaten = explode(";", $data);

    foreach ($koordinaten as $koord){
        $latlongtime = explode(":", $koord);
        $new_koord = $latlongtime[1] . ":" . $latlongtime[0] . ":" . $time_pause . ";";
        $route_new .= $new_koord;
    }

    // remove Last ";"
    $route_new = substr($route_new,0, strlen($route_new)-1);
    $route_new .= "]";
}
    echo "<br/>Neue Route<br/><br/>";
    echo $route_new;
 
    file_put_contents($filename_new, $route_new);
 
    echo "Neue Route wurde geschrieben...<br/>";

Offline

Board footer

Powered by FluxBB