Ticket #3380 (closed enhancement: fixed)

Opened 3 years ago

Last modified 7 months ago

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, 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

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

Change History

  Changed 3 years ago by jcrepetto

  • version changed from unspecified to 1.7.0

follow-up: ↓ 3   Changed 3 years ago by 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.

in reply to: ↑ 2   Changed 3 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.

in reply to: ↑ description   Changed 3 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.

follow-up: ↓ 6   Changed 3 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

in reply to: ↑ 5   Changed 3 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 3 years ago by vadp

a script to convert .MAP file into .VRT

  Changed 3 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 3 years ago by vadp

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

  Changed 3 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 7 months ago by jcrepetto

OziExplorer? .MAP driver

  Changed 7 months ago by jcrepetto

  • cc 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.

  Changed 7 months ago by rouault

  • status changed from new to closed
  • resolution set to fixed
  • component changed from default to GDAL_Raster
  • milestone set to 1.10.0

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

Note: See TracTickets for help on using tickets.