Locus Map - forum

Content & Tools => Tools => Topic started by: InfX on March 23, 2011, 00:21:12

Title: Batch converting ozfx files to locus
Post by: InfX on March 23, 2011, 00:21:12
I've made a little bat file to convert multiple ozfx files to locus tar files without user interaction and though it may be useful for others as well, so i've decided to post it here. Let me know if posting something like this is considered wrong for whatever reason.

Tools used:
 * ozf2img v1.1
 * imagemagick convert v 6.6.8-5 (Q8), renamed to imconvert.exe
 * tar (unknown version, whatever runs under my win32)

Usage:
 * Make sure the tools mentioned above are accessible on your %path%
 * Copy the ozfx files together with the corresponding map files into a separate directory
 * Execute the bat below from inside this directory

Bat file code:
@echo off

:: run on all map files and convert those
for %%i in (*.map) do (
    call :convert %%i
    if errorlevel 1 echo Error !
    if errorlevel 1 exit /b 1
)
goto :eof

:: single map conversion function
:convert
    :: params
    set mapfile=%1
    set mapdir=%~n1
    set tarfile=%mapdir%.tar

    :: convert the map image into png
    echo Extracting image from %mapfile%...
    ozf2img.exe -i%mapfile% > NUL || exit /b 1
   
    :: crop the image into tiles, erase the big image
    echo Generating %mapdir% tiles...
    mkdir %mapdir% || exit /b 1
    imconvert *.png -crop 250x250 -set filename:fn "%%[fx:page.x/250+1000]_%%[fx:page.y/250+1000]" +repage %mapdir%%%[filename:fn].png
    if errorlevel 1 exit /b 1
    del *.png || exit /b 1
   
    :: rename the tiles
    cd %mapdir%
    for %%n in (????_????.png) do call :rename %%n || exit /b 1
    cd ..

    :: tar tiles and map, kill the tiles dir
    echo Packing %tarfile%...
    tar -c %mapfile% %mapdir%/* > %tarfile% || exit /b 1
    rmdir /q /s %mapdir% || exit /b 1
goto :eof

:rename
set fn=%1
ren %1 %fn:~1,3%_%fn:~6,3%.%fn:~10,3% || exit /b 1
goto :eof
Title: Re: Batch converting ozfx files to locus
Post by: Menion on March 23, 2011, 22:12:24
Hmm very nice. I moved you topic into "Tools". Just count that TAR maps are not much supported and it's a long time since I really test them with all Locus functionality!
Title: Re: Batch converting ozfx files to locus
Post by: InfX on March 23, 2011, 23:06:50
The tar format is what i've found on this forum while searching for a way to use ozi maps with locus. What is the format that is fully supported and how do you recommend to convert the ozi maps into it ?
Title: Re: Batch converting ozfx files to locus
Post by: Menion on March 23, 2011, 23:14:57
Yes, I used TAR as only format until cca november 2010. Then I completely rewrote Locus to support SQLite format. But to be true, I'm not using Ozi Maps so I don't even know method how to convert them into SQLite format. Anyway TAR should be still function so if it works, than fine. Leave it :)
Title: Re: Batch converting ozfx files to locus
Post by: maquinna123 on July 03, 2011, 02:04:47
I bought your program Locus Pro but unless your program will handle  Geotiffs and DRGS, it is not really a Pro program. I have been trying to find a conversion program that will
convert OziExplorer .ozfx3 or ozfx2 files to tar format or SQLite. Basically if OziExplorer can load a satellite image, topographical map,  air chart or marine chart
 it can convert it to .ozfx3 or ozfx2 format. The formats include .tif, .bsb, .bmp, .png, .jpg, .ecw,  and .sid.
 Other formats can be converted to one of these format by using GlobalMapper. TerrainInCognita will capture images from Internet Mapping servers and save them in .tar format.
But Search and Rescue, oil and gas industry, mining industry, forestry industry etc. use geotiff topographical maps, known as DRGs in the USA.
Google Terrain mapping is good but it does not have the detail of a good topographical map.
Probably the best conversion program for mapping is GlobalMapper but it does not output the .tar or SQlite format.
Your program has great features pertaining to street level mapping but to compete with other mapping programs
coming on the market you should add the basic mapping formats to your product.
Title: Re: Batch converting ozfx files to locus
Post by: locuspro on October 14, 2011, 13:53:54
Is there any solution until now to convert ecw/geotiff to a LOCUS-Format ?
What ist ther resaon that ecw and geotiff  is not supported?

supported formats of globalmatter: http://www.globalmapper.com/product/formats.htm (http://www.globalmapper.com/product/formats.htm)
NO WAY to use LOCUS therfore - why?
Title: Re: Batch converting ozfx files to locus
Post by: Menion on October 14, 2011, 14:08:16
for most map format conversion should be working mapc2mapc program. So check it (also have some free version), if it works as you need
Title: Re: Batch converting ozfx files to locus
Post by: cantece on October 31, 2011, 15:20:56
Hello,
I checked MAPC2MAPC free. Works fine (ozi to Locus) but I still have the white margins of the map. Do you have an idea how to remove them?
Title: Re: Batch converting ozfx files to locus
Post by: gynta on November 01, 2011, 01:00:37
I have the same problem and i wait for a answere from the MAPC2MAPC-author now...

(//http://www.scf.at/brigitte/downloads/handout/locus/1.jpg) -> (//http://www.scf.at/brigitte/downloads/handout/locus/2.jpg)
Title: Re: Batch converting ozfx files to locus
Post by: gynta on November 01, 2011, 17:07:26
good news & bad news:

Hi,
In the current version of the program, only the formats with individual tiles are made transparent.
I will change the next version (469) to do the same for SQLITE tile stores. I will Email you when it is ready - this week I hope.
But Locus may not understand transparency!
Regards,
John


@ menion:
 is there plan for the future to fix this?
 or is this not possible?
Title: Re: Batch converting ozfx files to locus
Post by: Menion on November 02, 2011, 10:24:12
Hi,
  I don't think that transparency change something here. Tiles are precisely defined areas (256x256) pixels, and I'm loading them one next to other. No overlays aren't allowed. So even if transparency will be working, there will still be white space below transparent pixels. This can only change if some overlay will be working in Locus (which was already requested here on forum but denied due to memory limitations of android devices ... but I'm not saying it's not solvable)
Title: work
Post by: garrymoore on November 07, 2011, 06:52:40
hi  to all   forum.asamm.czers  this is my frst post and thought i would say  a big hello to yous  -  
 regards speak again  soon  
 g moore