KMZ/KML POI improvements

Started by Ferretty, July 23, 2011, 22:09:40

0 Members and 3 Guests are viewing this topic.

Ferretty

#15
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:

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  ;)
  •  

Menion

#16
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 :)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Ferretty

#17
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...
  •  

Menion

#18
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)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Ferretty

#19
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)?
  •  

estein

#20
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.
  •  

estein

#21
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 ;))
  •  

Menion

#22
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?
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Ferretty

#23
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.
  •  

Menion

#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)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Ferretty

#25
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:
  •  

Menion

#26
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
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Ferretty

#27
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)?
  •  

Menion

#28
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.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Ferretty

#29
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.
  •