Author Topic: KMZ/KML POI improvements  (Read 8296 times)

Offline Ferretty

  • More than Newbie
  • *
  • Posts: 47
    • View Profile
Re: KMZ/KML POI improvements
« Reply #15 on: July 28, 2011, 08:15:43 »
100% agreed. I'll keep my mind busy to think of an easy approach. Would it e.g. be possible to search the descriptions for the existing images? Just using some pseudo-code here:

Code: [Select]
foreach (image in /data/import/*) {
  SQL(SELECT...WHERE description LIKE '%image%')
  IF no_data_found rm -f image
}

So user could run this routine for a cleanup. Not 100% exact -- but if the image is mentioned nowhere in the desc, the connected POI must have been deleted (but if it is mentioned, it is not sure to be the IMG ref -- except when the SQL is modified correspondingly to match on something like "SRC='%image%'"). Or I have missed some other point where it could have been stored, not sure. It's just a raw idea to maybe keep in mind for later  ;)
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11302
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: KMZ/KML POI improvements
« Reply #16 on: July 28, 2011, 08:32:52 »
something like this should be done later anyway it will be really slow. I store description data not directly as text in database but as a byte array in more complex structure, so I firstly need to load whole data, create from them object I need and then grab only description and search it. That's also reason why it takes so long to do full text search in locus. On second side it bring me much advantage so I decided for this method.

  Anyway we'll see :)
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Ferretty

  • More than Newbie
  • *
  • Posts: 47
    • View Profile
Re: KMZ/KML POI improvements
« Reply #17 on: July 28, 2011, 08:52:43 »
Yepp -- didn't mean to hurry you up  :D Maybe that could go to some "cleanup" button later. Better think it thoroughly and wait a bit longer than to have to do it twice  :lol:

Thanx a lot! I love this. During the next days I'll play a bit with my KMZ files and see to make some "special Locus versions" out of them. Just reworked the sample I sent you, as it used a 2-column table with the image next to the description, which is not quite optimal to be displayed on a mobile phone (one has to scroll horizontally and vertically). Now I placed the image inside the desc. Need to check this later today...
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11302
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: KMZ/KML POI improvements
« Reply #18 on: July 28, 2011, 09:01:10 »
perfect! I'm looking forward to your work :). And when you do some simple description how to create such KMZ files, it would be more then welcome! (and absolutely agree with removing second column and place images directly into text)
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Ferretty

  • More than Newbie
  • *
  • Posts: 47
    • View Profile
Re: KMZ/KML POI improvements
« Reply #19 on: July 28, 2011, 09:47:38 »
Sure! I just had to leave for work, and my test device has no SIM in it and thus no network, so I cannot continue on this before I'm back home. I will check the new KMZ this evening and, if it looks OK, attach it to the other thread (were I already placed the original one) for everybody to check. If people like it and want more, I'll go over my collection  :D

concerning the "How to create...": Sure, I can write something down. Question is: There are multiple ways to do that. Easiest ist of course using Google Earth (plus some HTML template for the description), which is what I do. Guess I'll use this way for the Howto (in the appropriate forum section, of course)?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline estein

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: KMZ/KML POI improvements
« Reply #20 on: July 29, 2011, 15:06:51 »
I've tested the 1.9.4.2. Thanks for your work!

Loading the Munich example KMZ von Ferretty and some much simplier self created (only text and a <img src="...">)
=> everything works great!

But after a while the import of new KMZ failed. No pictures are loaded an even the already imported disappeared.

I found out that the folder "import" wasn't there any more! And the strangest thing is that even the manual
creation of it with Root-Explorer failed! (Locus was not running any more, checked with Taskmanager).

After a reboot, the manual creation of the "import" folder was possible again, but Locus is stil failing.
New KMZs are imported, but without pictures ...

All other function seems running and the parallel installed Locus Pro is also working.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline estein

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: KMZ/KML POI improvements
« Reply #21 on: July 30, 2011, 20:36:59 »
I think I found my problem: In the section <Style id ...> were still icons with a "http://..." reference.
After replacing them with local images it works!  

Thanks Ferretty for the manual which gave me the hint ...
And thanks Menion for the update  of the Pro Version!
(perhaps you could make the import a little bit more tolerant ;))
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11302
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: KMZ/KML POI improvements
« Reply #22 on: July 30, 2011, 21:44:27 »
hmm this is really weird, because http in style tag is also supported!! Don't you still have your old file that you can send me for test?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Ferretty

  • More than Newbie
  • *
  • Posts: 47
    • View Profile
Re: KMZ/KML POI improvements
« Reply #23 on: July 30, 2011, 22:04:02 »
It should make no difference if you mix them (http and local), right? But as for your "weird": there is one case which would lead exactly to that behaviour: If estein was OFFLINE when trying the POIs (i.e. having no data connection), the http: images could not work (no network connection to retrieve them). And I guess that's what was meant.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11302
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: KMZ/KML POI improvements
« Reply #24 on: July 31, 2011, 07:24:24 »
yes that's probably ... but just to let you know - online url to images are cached. If is http in style attribute, I cache image into cache/images directory. If this http is in description, it should be cached by http browser (that is used to display POI info)
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Ferretty

  • More than Newbie
  • *
  • Posts: 47
    • View Profile
Re: KMZ/KML POI improvements
« Reply #25 on: July 31, 2011, 10:40:56 »
Sure -- but is that done on import, or when you display a given POI? In the first case, the problem should not have appeared. In the latter, when I import a KMZ containing 1.000 POIs, I'd have to click them each one on my own in order to get them cached -- the ones I miss won't be cached. And even when done on import: If one is offline at that time, there's no way to cache anything  :lol:
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11302
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: KMZ/KML POI improvements
« Reply #26 on: July 31, 2011, 18:02:17 »
it's done during import, so if you have internet connection during import, all http request that are in 'style' tag, should be cached. If you don't have internet connection, you have then click manually on every unique poi. Hmm as I think ... all http images should be loaded again when you display POI category with these images, so not a big problem
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Ferretty

  • More than Newbie
  • *
  • Posts: 47
    • View Profile
Re: KMZ/KML POI improvements
« Reply #27 on: July 31, 2011, 18:06:56 »
Just to make sure: External images in descriptions get cached on import already? Or when the corresponding description is displayed (on click on the icon in the map)?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11302
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: KMZ/KML POI improvements
« Reply #28 on: July 31, 2011, 18:16:33 »
only when displayed. It work in way that: when you click on any POI on map, screen you see is small web browser, so images are downloaded only when needed. Also they aren't stored in same cache directory of locus but in phone memory. This small browser have own cache that I cannot handle with. So if you have some POIs with http in description, you cannot be sure, that image will be still cached for example after few days. It's same (problem) with listing of geocache. You can have it full offline (so also with images) only when you display this listing.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Ferretty

  • More than Newbie
  • *
  • Posts: 47
    • View Profile
Re: KMZ/KML POI improvements
« Reply #29 on: July 31, 2011, 18:28:08 »
OK -- thanks for this explanation! I was just confused, since otherwise why should I rework my POI collection to include the images  :shock: So now it looks like an additional feature: Local files probably won't be cached (I hope?) and thus don't eat precious internal (phone) memory.
« Last Edit: January 01, 1970, 01:00:00 by Guest »