[MANUAL] - converting OZFX maps to Locus

Started by Menion, October 04, 2010, 12:08:21

0 Members and 62 Guests are viewing this topic.

Menion

INFO: this tool is almost 2 years old and need few improvements. If you want to help, want to use OZFX or other raster maps and know Java at least a little, look here!

needed version - 0.3.0 and higher

1. suggest you have two files, *.ozfx3 (map file) or *.ozfx2 (older map file format) and *.map (map definition map file). Both place into same directory.
For this example, I'll use imaginary files world.ozfx3, world.map!

2. download attached ozfx to locus.zip file. Extract all. First step is to convert map file into basic image. So, run from command line
ozf2img -iworld.map- path to file can also point on directory (for batch convert)
- 'iworld.map' is not a mistake, so take care '-i' and 'map' on end
- this should create file world.png (with almost same size as world.ozfx3)

3. run imageCutter.bat. It's java program that I wrote "long" time ago. Need some improvements also, but this is not a priority now.
- click on Select and choose png file
- in Output directory select place, where to create new map
- in Tile size choose ideal size values. These values are generated from png image by dividing '2'. Ideal values are around 250 x 250. Bigger then 1000 aren't suggested (possibility to out of memory error on Android).
- check Compress tiles into TAR (this will compress all data into one TAR file
- check Attach Projection file and select world.map file. This will pack this required configuration file into TAR file also.

then click OK and just wait for your map

created map upload to /sdcard/Locus/maps into your android phone.

[attachment=1:1vntv3gf]imageCutter.PNG[/attachment:1vntv3gf]
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

netimen

#1
Hi, Menion!Can I convert OZFX to the new SQLite map format?
  •  

Menion

#2
hi netimen,
  whole think around converting older ozfx maps or trekbuddy tarred maps into Locus isn't excellent. This tools only allow to convert them into tar anyway not all tar maps works fine. I'll work on this later because this is not actually my priority. If you want to see ozfx maps in locus, I suggest some specialized ozfx viewer like Androizic.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

netimen

#3
OK, I see. I hope you fix that issue some day, though I also think this is not the most important problem :)
  •  

Menion

#4
yes me too :) There is also need for some volunteer to create some desktop tool that convert ozfx to tar maps. Tool I created works fine for someone but not excellent. So now is opensourced and expect new better developer ;)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#5
Quote from: "menion"yes me too :) There is also need for some volunteer to create some desktop tool that convert ozfx to tar maps. Tool I created works fine for someone but not excellent. So now is opensourced and expect new better developer ;)


Hi,
is there any progress on Imagecutter v0.1?
The LocifyCutter works well but only with small png files (25 MB). With larger ones (> 1 GB)  the program does absolute nothing and hangs forever :-(

It would be more simply for us to use ozfx3 maps direct within Locus and you have not to fight with very large png files.


Error message:
Read image: G:OziExplorertemp11Deutsche Alpen_8bit.png
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: width
*height > Integer.MAX_VALUE!
        at javax.imageio.ImageReader.getDestination(Unknown Source)
        at com.sun.imageio.plugins.png.PNGImageReader.readImage(Unknown Source)
        at com.sun.imageio.plugins.png.PNGImageReader.read(Unknown Source)
        at javax.imageio.ImageIO.read(Unknown Source)
        at javax.imageio.ImageIO.read(Unknown Source)
        at imageCutter.ImageManipulator.<init>(ImageManipulator.java:58)
        at imageCutter.MainFrame.jButton_imageSetActionPerformed(MainFrame.java:
242)
        at imageCutter.MainFrame.access$000(MainFrame.java:31)
        at imageCutter.MainFrame$1.actionPerformed(MainFrame.java:110)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Read image: G:OziExplorertemp11Deutsche Alpen_8bit.png
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: width
*height > Integer.MAX_VALUE!
        at javax.imageio.ImageReader.getDestination(Unknown Source)
        at com.sun.imageio.plugins.png.PNGImageReader.readImage(Unknown Source)
        at com.sun.imageio.plugins.png.PNGImageReader.read(Unknown Source)
        at javax.imageio.ImageIO.read(Unknown Source)
        at javax.imageio.ImageIO.read(Unknown Source)
        at imageCutter.ImageManipulator.<init>(ImageManipulator.java:58)
        at imageCutter.MainFrame.jButton_imageSetActionPerformed(MainFrame.java:
242)
        at imageCutter.MainFrame.access$000(MainFrame.java:31)
        at imageCutter.MainFrame$1.actionPerformed(MainFrame.java:110)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

Menion

#6
hmm file bigger then 1GB ... this is really big. I will not work on this tool, so if anyone want

there exist nice tool to convert map files to Locus called MAPC2MAPC

and about native support for Ozfx ... if you find legal way and some code or documentation how to do it, then it's not a problem ;) (btw. there is no legal way to use Ozfx files as I know)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#7
Quote from: "menion"hmm file bigger then 1GB ... this is really big. I will not work on this tool, so if anyone want

there exist nice tool to convert map files to Locus called MAPC2MAPC

and about native support for Ozfx ... if you find legal way and some code or documentation how to do it, then it's not a problem ;) (btw. there is no legal way to use Ozfx files as I know)


Thank you,
the trial version mapc2mapc has problems too with large files.

I spent many days to find a way to convert oziexplorer maps to locus without any success.


The app Androzic works with ozfx3 files (only the old ones made with img2ozf.exe version <= 3.03!!), but this app is very rudimentary, almost unusable.

URL app              http://code.google.com/p/androzic/
necessary library http://code.google.com/p/swampex/
old img2ozf         http://code.google.com/p/androzic/downl ... up_208.zip

Market link         http://www.androidpit.de/de/android/mar ... c/Androzic


That is all what I found (without really understanding, I am 69 old).
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

Menion

#8
Thanks tramp,
  I know about Androzic, but as I discovered a long time they use illegal method to display Ozfx2 files. As I know, you have only one simple alternative, that is beta version of OziExplorer here http://www.oziexplorer3.com/android/ozi ... droid.html

  I'm not familiar with desktop OziExplorer but isn't there any possibility to cut whole map into two or more pieces? Then you should use mapc2mapc program or any other.

  Anyway I appreciate your enthusiasm to use Ozi maps in Locus, but in this I can't really help you. maybe anyone other?

EDIT: and to use even in illegal way ozfx2 files thanks to Swapex library, i have to release Locus also as open source project, what I don't want ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#9
Quote from: "menion"I'm not familiar with desktop OziExplorer but isn't there any possibility to cut whole map into two or more pieces? Then you should use mapc2mapc program or any other.

 


Sorry, no possibility.
Oziexplorer imports only the Kompass map and makes a simple .map file (with some coordinates, map projection). The real work of making a png file makes img2ozf without to cut the map.
I tried even Globalmapper where i can select a small part of my map to be converted but the result is 3 times bigger :-(

Anyway thank you for your answers.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

TSellers

#10
Quotethey use illegal method to display Ozfx2 files

I noted the above post where it is stated it is illegal to use Ozi files that are created with earlier versions of the ozf2 program. I have both licensed versions of Ozi Desktop and CE, and have been using it for probably a decade or more. All my local map files were created using that earlier version of ozf. Where I live in Canada, it is not illegal to use these files in another program such as Androizic, and I have already done so. I do not believe that I am breaking any laws in so doing. While it may be illegal for someone to do the conversions if they do not have a license to use Ozi, I cannot see how it is illegal to use the files if they were created by a licensed version of Ozi.

However, I just purchased Locus in order to use the Ozi files I have, but I cannot figure out how to get started. My first hurdel is trying to figure out how to tell Locus where I store my offline maps on my SD Card. Could you point me in the right direction?

Thanks, Tom
  •  

tramp20

#11
Quote from: "TSellers"
Quotethey use illegal method to display Ozfx2 files

However, I just purchased Locus in order to use the Ozi files I have, but I cannot figure out how to get started. My first hurdel is trying to figure out how to tell Locus where I store my offline maps on my SD Card. Could you point me in the right direction?

Thanks, Tom

Hi,
that is the simplest part: put the maps in sdcardlocusmaps.
But Locus cannot read this format, it is encrypted only to use in allowed hardware :-(
I converted all my my maps with MOBAC.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

TSellers

#12
tramp,

Thanks for that. The friend that recommended Locus noted that it would be best to use if for vector maps, and leave the bitmaps to Androzic, so that's probably the best method. As I noted, the main reason I started on that path was simply because I have all the topos for our Mountain National Parks where I live and work already in bitmaps, perhaps it's time to progress and move on. And as he also noted, it's not necessary to have one program that does everything, so there's no reason not to use one program for vector maps and anotther for bitmaps. Hopefully that makes sense, and Locus and Androzic can co-exist on my device.

So BTW, is 'sdcardlocusmaps' already the default map repository that haas been created on my device, or is there somewhere I define the default location? Hope that does not sound like a really dumb question as I just got started and could not seem to find anywhere to define the default map folder in the setup screens.
  •  

Menion

#13
hi,
  I'll just post some info ... you may also try to use mapc2mapc program that convert ozi maps to locus format. I don't want to talk against androizic, but this program seems like not anymore developed and I think that usability of locus is much higher if you figure out how it all works.

  about default folder, there is no settings for defining some other directory. If you want to place locus into internal memory, just move whole folder there and try if this will work
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

TSellers

#14
Thanks,

When looking at the mapc2mapc program I do not see any option to 'write Locus Map'. Is there another way to do it?
  •