Closed GoogleCodeExporter closed 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
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
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
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
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
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
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
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
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
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
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
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
Original issue reported on code.google.com by
arabi.gh...@gmail.com
on 14 Jan 2014 at 12:00