Opened 9 years ago

Closed 6 years ago

#3380 closed enhancement (fixed)

OziExplorer .MAP file should be useable with all file formats, not only GIF

Reported by: jcrepetto Owned by: warmerdam
Priority: normal Milestone: 1.10.0
Component: GDAL_Raster Version: 1.7.0
Severity: normal Keywords:
Cc: dron, Even Rouault

Description

OziExplorer? can read many standard and proprietary file formats : TIFF, BMP, JPG, PNG, BSB, BSB 4, BSB 5, ECW, MrSID, OZF2, OZFX3, Maptech Terrain Navigator maps (.024,.100,.250) and Maptech Aeronautical charts (.AER), RIK, Kompass

Not all of these formats are supported by GDAL, but it should be possible to use .MAP files with other formats than GIF.

Attachments (3)

ozi2vrt.py (9.4 KB) - added by vadp 9 years ago.
a script to convert .MAP file into .VRT
ozi2gdal.py (11.2 KB) - added by vadp 9 years ago.
an enhanced version of the script to convert .MAP file into .VRT
gdal-ozimap.patch.gz (6.7 KB) - added by jcrepetto 6 years ago.
OziExplorer? .MAP driver

Download all attachments as: .zip

Change History (13)

comment:1 Changed 9 years ago by jcrepetto

Version: unspecified1.7.0

comment:2 Changed 9 years ago by Even Rouault

Cc: dron added

Quoting Frank on http://lists.osgeo.org/pipermail/gdal-dev/2010-January/023328.html :

Jean-Claude,

I see that there is a GDALReadOziMapFile() function that could be
utilized in other drivers too.  I presume in 1.7 Andrey implemented
use of it in the GIF driver because that is where he needed it.

I'm hesitant to spread all the possible supporting information formats
(.aux, world files, ozi map files, mapinfo files) in all drivers.  One
reason is the amount of code involved, which we could reduce by some
more generic mechanism to lookup supporting information.  The other reason
is that probing for so many supporting files may have noticable effects
on performance in some cases.

I am however open to improvements in consistency and approach if there is
broad support.

comment:3 in reply to:  2 Changed 9 years ago by dron

Replying to rouault:

I see that there is a GDALReadOziMapFile() function that could be

utilized in other drivers too. I presume in 1.7 Andrey implemented use of it in the GIF driver because that is where he needed it.

That is true. I needed it for GIF files, also I've seen its usage with JPEG and BMP files, so these ones could be added first.

I am agree that some consistency is needed in this area. In first of all we need to secure an order of external georeferencing lookup to ensure that all drivers will read external files in the same way. What about adding the special function GDALReadExternalGeoref() which in turn will call functions to read world files, mapinfo and ozi files? Individual drivers will call that function instead of sequence of GDALReadWorldFile(), GDALReadTabFile() etc. That function can take the list of possible external georeferencing file formats to search, so we can avoid reading everything if we don't want to. Something like:

GDALReadExternalGeoref(int nGeoFormats)

where nGeoFormats is a combination of flags
READ_ALL --- try all possible external formats,
READ_WORLD --- read world file only,
READ_MAPINFO_TAB --- read Mapinfo .TAB file only,
READ_OZI --- read Ozi Explorer .MAP file.

Performance issue remains though.

comment:4 in reply to:  description Changed 9 years ago by vadp

Replying to jcrepetto:

it should be possible to use .MAP files with other formats than GIF.

I think there is another way of getting this functionality. You may think of .MAP file as another virtual format, something like .VRT. It contains a link to an image file, projection, datum, so why not.

I've made a sample script for converting .MAP into .VRT. Perhaps someone would be interested to have a look, so I'll attach it here.

BTW: It seems there is a bug with a current implementation of .MAP projections. At least for Mercator it produces +k=0 by default, then the PROJ is not happy about it.

comment:5 Changed 9 years ago by hamish

Hi,

with python 2.4.4 I get this error from ozi2vtr.py:

  File "./ozi2vrt.py", line 30
    return out[0] if out else default
                   ^
SyntaxError: invalid syntax

?

thanks, Hamish

comment:6 in reply to:  5 Changed 9 years ago by vadp

Replying to hamish:

Hi,

with python 2.4.4 I get this error from ozi2vtr.py:

  File "./ozi2vrt.py", line 30
    return out[0] if out else default
                   ^
SyntaxError: invalid syntax

Hi! That was fine with python 2.6.4, but hdr_subparm() were not needed at all as it was mere leftover from my kap2vrt.py script. I'll upload a "trimmed" version

Changed 9 years ago by vadp

Attachment: ozi2vrt.py added

a script to convert .MAP file into .VRT

comment:7 Changed 9 years ago by vadp

Hello, I'm posting a newer version of my ozi reader script. It supports more projections/datums, so have a look if interested.

Changed 9 years ago by vadp

Attachment: ozi2gdal.py added

an enhanced version of the script to convert .MAP file into .VRT

comment:8 Changed 9 years ago by vadp

for ones interested in, the latest version of the ozi2gdal.py can be found here http://talk.maemo.org/showthread.php?t=57469

Changed 6 years ago by jcrepetto

Attachment: gdal-ozimap.patch.gz added

OziExplorer? .MAP driver

comment:9 Changed 6 years ago by jcrepetto

Cc: Even Rouault added

To fix this ticket, I am submitting a new driver for OziExplorer? .MAP files. With this driver, every image file format supported by GDAL will be supported in .map files. It won't be necessary to add a new autotest script, because the current OZI driver test will test both OZF2 files and MAP files.

comment:10 Changed 6 years ago by Even Rouault

Component: defaultGDAL_Raster
Milestone: 1.10.0
Resolution: fixed
Status: newclosed

Committed in r25287 (with a few minor fixes). Thanks

Note: See TracTickets for help on using tickets.