Locus Map - forum

Support => Troubles & Questions => Topic started by: courdi95 on March 14, 2011, 07:32:08

Title: How to import ecw maps ?
Post by: courdi95 on March 14, 2011, 07:32:08
Hello,

I wolud like to import .ecw maps that i have on my pc into locus ....

How to do that ?
Title: Re: How to import ecw maps ?
Post by: berkley on March 14, 2011, 08:47:21
Hi,

have you tried GPS Babel? http://www.gpsbabel.org/ (http://www.gpsbabel.org/)
It's a translation tool for map files...

Or simply have a look right here: viewtopic.php?f=21&t=4 (http://forum.asamm.cz/viewtopic.php?f=21&t=4)  :P

Greetz
Title: Re: How to import ecw maps ?
Post by: courdi95 on March 14, 2011, 09:08:08
"GPSBabel converts waypoints, tracks, and routes" ..... :-(

.ecw file are raster maps compressed using wavelet technology (as JPEG2000) and with headers comprising calibration and projection data (see http://www.gdal.org/ (http://www.gdal.org/) or http://www.erdas.com/Homepage.aspx (http://www.erdas.com/Homepage.aspx))

so what I need is a tool to convert my .ecw files into "rmap SQLite" or "trekbuddy tared" as indicated in the LOCUS tutorial ....

where can I find clear description of  "rmap SQLite" or "trekbuddy tared" file description ?
Title: Re: How to import ecw maps ?
Post by: Menion on March 14, 2011, 11:09:59
Hi,
  i don't know :) I also don't know this map format. You have to find any way ho to get raster images into png files or database. Structure of database and tar files is simple. Just create some map in locus and examine.
Title: Re: How to import ecw maps ?
Post by: courdi95 on March 14, 2011, 11:42:27
Reverse engineering of LOCUS database and folders may be a good solution .... however, as little document describing the structure would be better for me  ....

Please, do you do have any written description of your file formats and database format ? I have made some googling about this, but did not find so much clear information ....
Title: Re: How to import ecw maps ?
Post by: Menion on March 14, 2011, 12:04:43
There is no need for some complex reverse engineering. Just create small SQLite map in locus, download SQLite Database Browser software and look how this database looklike. With TAR format it's even simplier. It's just compressed tar file that containt images 256x256px big and one xml file with parametres.
Title: Re: How to import ecw maps ?
Post by: courdi95 on March 14, 2011, 12:08:01
okay .... I will try that ... but however it would be fine to have that description... I will post one if you are OK .
Title: Re: How to import ecw maps ?
Post by: Menion on March 14, 2011, 12:09:28
every description that should be useful to any other user, is more then welcome!
Title: Re: How to import ecw maps ?
Post by: courdi95 on March 14, 2011, 12:46:54
OK ....

Structure of sqlite locus file :

- the database comprises 3 files : tiles, android_metadata, info
- "tiles" file structure :
ROWID
x INTEGER PRIMARY KEY
y INTEGER PRIMARY KEY
z INTEGER PRIMARY KEY
s INTEGER PRIMARY KEY
image BYTE (PNG IMAGE)
SQL : CREATE TABLE tiles (x INTEGER, Y INTEGER, z INTEGER, s INTEGER, image BYTE, PRIMARY KEY (x,y,z,s))
- "info" file structure :
ROWID
minzoom INTEGER
maxzoom INTEGER
SQL : CREATE TABLE info (minzoom INTEGER, maxzoom INTEGER)
- "android_metadata" file structure
ROWID
locale TEXT
SQL : CREATE TABLE "android_metadata" (locale TEXT)

so .... the structure of the database is OK now, but I have QUESTIONS :
- are x/y/z corresponding to MERCARTOR Google-like projection ?????? (as depicted here: http://www.maptiler.org/google-maps-coo ... rojection/ (http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/))
- what is the meaning of "s" in "tiles" ?
- in "android_metada" : locale = "fr_FR"  (only one record)
- "info" is empty ????
- I have not found tared files on my sdcard ... is the description similar ?
Title: Re: How to import ecw maps ?
Post by: Menion on March 14, 2011, 12:57:12
so,
 - are x/y/z corresponding to MERCARTOR Google-like projection ?????? (as depicted here: http://www.maptiler.org/google-maps-coo (http://www.maptiler.org/google-maps-coo) ... rojection/)
yes. Only z in database is a little weird. I think it's "17 - z", so zoom 0 on Gmaps == 17 in database

- what is the meaning of "s" in "tiles" ?
I don't know too, so I'm using it for storing day since 1.1.2011 (for some future map updates)

- in "android_metada" : locale = "fr_FR" (only one record)
It's created automatically by system

- "info" is empty ????
was, since today version isn't. Contain provider index (from which map is created) and zooms in String separated with ";"

- I have not found tared files on my sdcard ... is the description similar ?
similar? hmm create TAR map and look. How to? On screen where are you selecting zooms to download, change type by middle bottom button

SQLite format I'm using is taken from RMaps and Backcountry nav application or any of them. I did this to remain "compatible". Anyway I actually updated info table, but i'm sure it will not have any impact on other software using map from Locus
Title: Re: How to import ecw maps ?
Post by: courdi95 on March 14, 2011, 13:45:04
Quote from: "menion"I think it's "17 - z", so zoom 0 on Gmaps == 17 in database

I confirm z in Locus is equal to  z-17  from Gmaps

Quote from: "menion"hmm create TAR map and look. How to? On screen where are you selecting zooms to download, change type by middle bottom button

I will try ........ but not today.
Title: Re: How to import ecw maps ?
Post by: cseu on March 14, 2011, 15:12:05
Hi courdi95... have a look at this post : viewtopic.php?f=13&t=280#p1107 (http://forum.asamm.cz/viewtopic.php?f=13&t=280#p1107)
Let me know if you need any help.
Cheers.
Title: Re: How to import ecw maps ?
Post by: courdi95 on March 14, 2011, 15:50:11
I forgot to tell you that I found the solution ....

Using MapTiler (www.maptiler.org (http://www.maptiler.org)) you can create tiles corresponding to Google projection (x/y/z) from an .ECW file !

As output, you get a structured folder  :  <zoom>/<x>/<y>.jpg (with y numbering that you have to shift to get the Google Maps ...the Maptiler is compliant TMS "y" numbering,  but it not so difficult to convert using 2^zoom-y)

Then the second step is to build the SQLite database for Locus by integrating all these images taking into account the "z" translation  (17-z), using a small PC SW.
Title: Re: How to import ecw maps ?
Post by: cseu on March 14, 2011, 18:23:18
Courdi95 can you explain the "second step" more in details please... thanks.
Title: Re: How to import ecw maps ?
Post by: courdi95 on March 14, 2011, 22:45:50
To do the second step, you have to build a sqlite database that will contain the 3 files presented before and integrate the data and the map tiles. This operation should be done with a little pcsw containing a sqlite driver for the database creation and edition.
For me, i will use windev framework to do that.
Title: Re: How to import ecw maps ?
Post by: Menion on March 16, 2011, 12:41:05
.. moved to Questions category