aviroez / osmbonuspack

Automatically exported from code.google.com/p/osmbonuspack
0 stars 0 forks source link

not loading high volume kml file #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.create a project to load kml file
2.
3.

What is the expected output? What do you see instead?
the app loads low kmls but dose not load high volume kml file forexample 40mb.

What version of the product are you using?
osmbonuspack_v4.2.4

Please provide any additional information below.

i test this project on device with android 2.3.6 and 4.1.2
also i still have my previous problem (issues 48)

Original issue reported on code.google.com by arabi.gh...@gmail.com on 14 Jan 2014 at 12:00

GoogleCodeExporter commented 9 years ago
You are probably reaching the limits of what we can do with a Java SAX parser 
on Android... 

What is the error raised?

If you share your high volume file on a Google drive, I can have a look and see 
if we can do something. 

Original comment by mathieu....@gmail.com on 14 Jan 2014 at 9:25

GoogleCodeExporter commented 9 years ago
Thank you for your reply,

I shared my kml file on Google drive . this is the link :

https://drive.google.com/file/d/0B7qFrybbrcM6RUgyR2NhZmJyZ3M/edit?usp=sharing

also i attached the LogCat file .

your help is greatly appreciated

Original comment by arabi.gh...@gmail.com on 15 Jan 2014 at 1:39

GoogleCodeExporter commented 9 years ago
OutOfMemory exception. 

I made experiments by stripping your file down progressively (removing large 
parts of content). Here are the results: 
- OutOfMemory occurs first inside parseFile, due to amount of KML data loaded 
in memory heap. 
- Then, when the file is smaller (5Mb), OutOfMemory occurs in buildOverlays, 
due to the number of overlays created in memory heap. 
- Then (at 2Mb), parsing and building are OK, but OutOfMemory exceptions occur 
when panning/zooming, due to tiles loading => osmdroid also requires memory 
heap to work. 

Android provides a very small memory heap to each application. Apparently 
around 40Mb. 

I don't see a simple solution to reduce the memory usage of KML and overlays in 
the lib. 

My conclusion is that a reasonable maximum size for KML files seems to be 
around 1Mb. Maybe a little bit more on 4.x devices. 

Depending on what you want to do, you will have either to split your KML 
content in smaller files (smaller areas?), or move to a totally different 
solution. Mapsforge? 

Original comment by mathieu....@gmail.com on 17 Jan 2014 at 10:23

GoogleCodeExporter commented 9 years ago
Thank you so much for helping,

Did you reduced the volume of the road.kml file to 5mb or 2mb ? if so could
you please send me the 2mb kml file.

I checked the Mapsforge . if I�m right it is just a map viewer . it doesn't
have any  feature for routing .i think the only way for me is that split
the kml file.

Thank you  for your support.

 Best regards,

Original comment by arabi.gh...@gmail.com on 18 Jan 2014 at 2:40

GoogleCodeExporter commented 9 years ago
I made this reduction by removing massively sections of the file with a text 
editor - nothing magic. 
The 2Mb one is here: 
https://drive.google.com/file/d/0B_8VOmRyW664UDViUkZvQWltUk0/edit?usp=sharing

Mapsforge: really depends on what you want to do. They have a compact file 
format to store paths and points - and the Android viewer optimized to display 
huge files in this format (100Mb). 

Original comment by mathieu....@gmail.com on 18 Jan 2014 at 11:10

GoogleCodeExporter commented 9 years ago
got it.thank you for the 2mb kml file .
I think splitting the kml file(country to province) is better for my
project . i really need to use OSMBonusPack because it has more useful
classes.
Thank you so much for your time and the guidance.

Original comment by arabi.gh...@gmail.com on 20 Jan 2014 at 11:46

GoogleCodeExporter commented 9 years ago
Dear mathieu,
I have a question again .is it posible to load kmz files on map?kmz files
are smaller than kml files.when i convert my shape file to kmz the volume
getting more smaller than when i change it to kmls.when 20mb shape file is
converted to kml the volume would be 50mb but when it is converted to kmz
it would be 10mb so it is easier to split .
Thank you again for helping
Regards
در 2014 1 20 15:15، "ghazaleh arabi" <arabi.ghazaleh@gmail.com> نوشت:

project . i really need to use OSMBonusPack because it has more useful
classes.

kml file

text editor - nothing magic.

https://drive.google.com/file/d/0B_8VOmRyW664UDViUkZvQWltUk0/edit?usp=sharing

file format to store paths and points - and the Android viewer optimized to
display huge files in this format (100Mb).

Original comment by arabi.gh...@gmail.com on 21 Jan 2014 at 7:12

GoogleCodeExporter commented 9 years ago
kmz is a zip compression of the KML file. It must be unziped to be used 
(parsed). 
So no gain in memory to expect. 

Original comment by mathieu....@gmail.com on 21 Jan 2014 at 9:26

GoogleCodeExporter commented 9 years ago
Ah ok .thank you so much for supporting.
در 2014 1 22 00:56، <osmbonuspack@googlecode.com> نوشت:

Original comment by arabi.gh...@gmail.com on 21 Jan 2014 at 9:37

GoogleCodeExporter commented 9 years ago
Hi Arabi, 
A possible improvement: 
From API level 11, you can ask for more memory heap in your manifest, this way:
android:largeHeap="true"

Original comment by mathieu....@gmail.com on 23 Jan 2014 at 9:04

GoogleCodeExporter commented 9 years ago
Hi Mathieu,
Many thanks for your guidance, it helps.but still i have to split the kml
into max size 6mb.more than 6mb is not loaded .
thanks a lot for your attention to this matter.

Original comment by arabi.gh...@gmail.com on 27 Jan 2014 at 10:35

GoogleCodeExporter commented 9 years ago
The main conclusions from this exchange have been added in the Wiki: memory 
limits, largeHeap hint. 
I think we can close this issue now. 

Original comment by mathieu....@gmail.com on 12 Mar 2014 at 11:56