Does it work if you separate -geoloc and -te in two commands?
– AndreJJul 14 '15 at 9:24

Do you mean run gdalwarp with -geoloc first then run with -te again? Haven't tried it yet.
– userJul 14 '15 at 9:41

1

From my answer here gis.stackexchange.com/questions/128040/… I guess that gdalwarp -geoloc -of GTIFF -t_srs EPSG:4326 -te ... should run. But you have to use the right values for te, taken from the metadata as reported by gdalinfo.
– AndreJJul 14 '15 at 10:23

I have tried this with HDF4 files and it worked but when the format became HDF5 it showed that error above.
– userJul 14 '15 at 11:35

The <metadata> should be removed too, or closed before the new section. The lon.vrt and lat.vrt get no GEOLOCATION, only the chlor.vrt.
– AndreJJul 20 '15 at 5:19

I want the output pixel size to be 2488 2141 because later on I'm gonna be using the gdal_calc which requires the image to have the same dimension. How will I do it? Where should I insert the -ts in gdalwarp?
– userJul 14 '15 at 23:03

You can automate the process by building the vrt files with python code, but I can't help you out on that. Since the swath images are rotated, the size will be different for every flight and day.
– AndreJJul 15 '15 at 4:17

Does that mean it isn't possible with batch process? Can I reduce the output pixel size by just adding -ts in gdalwarp?
– userJul 16 '15 at 0:49

I don't think you can write the GCP substitution into a batch file. For the -ts, just try it. You might need to add -srcnodata as well.
– AndreJJul 16 '15 at 3:54