Opened 7 years ago

Closed 6 years ago

#5763 closed enhancement (fixed)

[PATCH] VICAR file format addition

Reported by: swalter75 Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords: vicar hrsc
Cc:

Description (last modified by swalter75)

VICAR is a file format similar to the PDS format. It is used by the VICAR software for many space missions.

http://www-mipl.jpl.nasa.gov/external/vicar.html

Vicar is not openly available, although there were efforts to make it Open Source by JPL in the last years.

The driver is tested for HRSC images, sample image here: http://hrscview.fu-berlin.de/mex4/5273/h5273_0000.nd4.50.bz2

It should work also for other missions, but probably meta-data handling has to be adapted. If you want a mission-specific file to be added, feel free to contact me, mailto:sebastian.walter@…

I wasn't able to commit via svn, so this is the diff to existing files:

Index: frmts/gdalallregister.cpp
===================================================================
--- frmts/gdalallregister.cpp	(revision 28072)
+++ frmts/gdalallregister.cpp	(working copy)
@@ -231,6 +231,7 @@
     GDALRegister_ISIS3();
     GDALRegister_ISIS2();
     GDALRegister_PDS();
+    GDALRegister_VICAR();
 #endif
 
 #ifdef FRMT_til
Index: frmts/pds/GNUmakefile
===================================================================
--- frmts/pds/GNUmakefile	(revision 28072)
+++ frmts/pds/GNUmakefile	(working copy)
@@ -1,13 +1,13 @@
 
 include ../../GDALmake.opt
 
-OBJ	=	pdsdataset.o isis2dataset.o isis3dataset.o nasakeywordhandler.o
+OBJ	=	pdsdataset.o isis2dataset.o isis3dataset.o vicardataset.o nasakeywordhandler.o vicarkeywordhandler.o
 
-CPPFLAGS	:=	-I../raw  $(CPPFLAGS)
+CPPFLAGS	:=	-I../raw $(GDAL_INCLUDE) $(CPPFLAGS)
 
 default:	$(OBJ:.o=.$(OBJ_EXT))
 
-$(O_OBJ):       nasakeywordhandler.h ../raw/rawdataset.h
+$(O_OBJ):       nasakeywordhandler.h vicarkeywordhandler.h ../raw/rawdataset.h
 
 clean:
 	rm -f *.o $(O_OBJ)
Index: gcore/gdal_frmts.h
===================================================================
--- gcore/gdal_frmts.h	(revision 28072)
+++ gcore/gdal_frmts.h	(working copy)
@@ -120,6 +120,7 @@
 void CPL_DLL GDALRegister_ISIS3(void);
 void CPL_DLL GDALRegister_ISIS2(void);
 void CPL_DLL GDALRegister_PDS(void);
+void CPL_DLL GDALRegister_VICAR(void);
 void CPL_DLL GDALRegister_IDRISI(void);
 void CPL_DLL GDALRegister_Terragen(void);
 void CPL_DLL GDALRegister_WCS(void);

Attachments (3)

vicarkeywordhandler.h (2.3 KB) - added by swalter75 7 years ago.
vicardataset.cpp (31.4 KB) - added by swalter75 7 years ago.
vicarkeywordhandler.cpp (11.4 KB) - added by swalter75 7 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by swalter75

Description: modified (diff)

Changed 7 years ago by swalter75

Attachment: vicarkeywordhandler.h added

Changed 7 years ago by swalter75

Attachment: vicardataset.cpp added

Changed 7 years ago by swalter75

Attachment: vicarkeywordhandler.cpp added

comment:2 Changed 7 years ago by Even Rouault

Milestone: 2.0
Summary: VICAR file format addition[PATCH] VICAR file format addition

comment:3 Changed 7 years ago by Even Rouault

trunk r28786 "Add GDAL VICAR format, patch by Sebastian Walter + a few extra fixes (#5763)"

My changes consist in mentionning VICAR in format_list.html, removing some tab characters, making the Identify() test harder, fixing a Valgrind warning in VICARKeywordHandler::Ingest()

comment:4 Changed 7 years ago by Even Rouault

r28787 "Commit forgotten file"

comment:5 Changed 7 years ago by Even Rouault

r28789 "VICAR: fix Windows build (#5763)"

comment:6 Changed 7 years ago by Even Rouault

Sebastian,

I get random failures on the Travis continuous integration system on the simple test I've added. Those failures arise systematically apparently on Mac, but randomly on Ubuntu 12.04. I've never managed to reproduce them on my machine.

The error is the inversion of the sign of geotransform[3] (upper left northing)

For example https://api.travis-ci.org/jobs/56025518/log.txt?deansi=true

Running tests from gdrivers/vicar.py

TEST: vicar_1 ...

old = (-53960.0, 25.0, 0.0, -200830.0, 0.0, -25.0) new = (-53960.0, 25.0, 0.0, 200830.0, 0.0, -25.0) fail

It would be good if you could investigate what's happening. Nothing shows up under Valgrind...

r28792 "vicar.py: avoid test failure on Travis until we've found what's wrong... (#5763)"

comment:7 Changed 6 years ago by Even Rouault

Milestone: 2.0

Removing obsolete milestone

comment:8 Changed 6 years ago by Even Rouault

Resolution: fixed
Status: newclosed

Finally found the reason for the random failure: trunk r32030, branches/2.0 r32031 "pds.py: properly reset PDS_LineProjOffset_Mult so that running vicar.py afterwards doesn't faild (#5763)"

Note: See TracTickets for help on using tickets.