Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - atomicdryad

#1
Quote from: eldron on March 27, 2014, 12:33:36
Yes i am using Android 2.3.6, as the android 4.x version available for my phone is not very stable. So it would be great if the memory problems could be fixed, as I am surely not the only one using android 2.x and locus ;-)
Do you have root? If so, in /system/build.prop take a look at dalvik.vm.heapsize. Increasing it from 24m to 32m eliminated memory issues in Locus for me. (cm7 with 512m total mem)
#2
Unfortunately there are serious roadblocks when it comes to making this available offline; wikipedia's geolocation has 1.6 million entries...wikilocation's on database, on it's own is 80 megs which isn't big, but that only contains article titles. It's closer to 800 megs (ish) with article snippets, to say nothing about images.

Carving that up by region / country / state would help, colorado has around 7000 georeffed articles for example. But doing that entails an entirely different sort of pain; the article snippets are hosted on wikipedia and referenced by numeric ids in the wikilocation database, which means a script that either abuses the heck out of their api or downloading the entire wikipedia database (and still that doesn't include images).

I'll probably do the latter just to experiment, but there's one last pitfall; I'm not sure locus can handle hundreds of thousands of pois. If exported to .kml it would try to render them all, and be limited to 5.5 megs unless imported. I've experience issues importing lots of stuff into the waypoints database (the app crashed when selecting a category with 13k entries), and the database doesn't have a spatial index so selecting by range would be troublesome.

#3
POI's / [KML/netlink] Panoramio automagically
March 28, 2014, 15:36:22
It appears Locus's .kml support handles this well, though there is some lag as it's downloading the thumbnails (the poi icons will be blue dots then turn into images).

This can't be imported, stick it in /sdcard/Locus/mapItems and activate via 'data' -> 'items'.



<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns="http://earth.google.com/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
        <Document>
                <name>Panoramio</name>
                <open>1</open>

            <NetworkLink>
                <name>Panoramio</name>
                <flyToView>0</flyToView>
                <Link>
                    <href>http://www.panoramio.com/kml/</href>
                    <viewFormat>BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]</viewFormat>
                    <viewRefreshMode>onStop</viewRefreshMode>
                </Link>
            </NetworkLink>
        </Document>
</kml>
#4
Note: This is a .cgi script meant to run on a personal webserver, from a device with root access (see below for alternatives)...technically it's not an addon, however it improves upon Locus functionality in the following ways:

* The Wikipedia search function will return a descriptive POI with the article's first paragraphs, and the article's thumbnail. In addition, the rather frequent "List of ..." duplicate articles are prefixed with (L)
* Searching with the 'EO' locale will query the geonames.org datebase. Unlike the builtin geonames search, this is based on coordinates.
* Searching with the 'GL' locale will query geonames and return OSM POIs, based on coordinates.



install (server)

This requires a webserver that can run perl .cgi scripts. perl needs the LWP and JSON modules. The server must direct queries to http://api.wikilocation.org/articles . With apache, this means setting up a virtual host, or .htaccess rules like:

  RewriteCond %{HTTP_HOST} ^api\.wikilocation\.org$
  RewriteCond %{REQUEST_URI} articles
  RewriteCond %{QUERY_STRING} (.*)
  RewriteRule ^articles$ /wikiloc.cgi [L]


setup (android)

Unfortunately, since there's no functionality to change the search URLs in locus directly, one needs to redirect traffic to api.wikilocation.org. If you have root on your device, this is a simple matter of editing /system/etc/hosts and adding
123.123.123.123 api.wikilocation.org
where "123.123.123.123" is the ip address of your webserver.
If you don't have root, it's possible to make this work over wifi by fiddling with your router's DNS. Modifying the Locus .apk is another alternative (however, I'm new and this is the dev's forum, so I won't assist in that).

Once done, simply search wikipedia, you should see descriptive text. If there's an error, it will return one POI titled "A script error has occurred", with debugging output in it's description.

final note if you plan to use geonames you'll want to change this config variable:
our $geonamesUsername="demo";
The "demo" user is always past it's quota. You can obtain a username at http://geonames.org



If you know perl, extending this script should be easy. To replace a locale with a function, see the following config mapping:

our %localeOverride = (
  'eo' => sub { snag_geonames('default'); }, # EO: geonames spatial search
  'gl' => sub { snag_geonames('osm' ); },    # GL: osm poi search
);



POIs are sent to Locus as so:

{articles:
  [
    {"id":0,
     "lat":123.456,
     "lng":-78.90123,
     "distance":9001,
     "title":"Distance is in meters",
     "type":"<blink>I am a description</blink><br><img src=\"http://www.infinitecat.com/cute-cats/suspension-bridge.jpg\">",
     "url":"http://www.presentcat.com/"
    },
    {"id":123,
     .......(etc)
    },
  ]
}


Quick howto: replace wikipedia for the russian locale with a POI over george w bush's house:
Add to %localeOverride:
  'ru' => sub { dummy_function(); },
Then:

sub dummy_function {
  push @{$data->{articles}}, mkentry(123,29.75786,-95.46454,0,"Uhm..","Hey wait this isn't $param{lat} $param{lng}...","http://xda-developers.com");
  $out = encode_json($data);
}