[gdal-dev] How do I re-size a BSB (KAP) file?

Christopher Barker Chris.Barker at noaa.gov
Thu Oct 9 14:51:59 EDT 2008


NOTE: your original reply went only to me, you have to hit "reply all" 
for it to go to the list.

ValiSystem wrote:
> BSB support is very minimal.

I've noticed ;-)

I'd like to improve it, but I really have no idea where to start.

> What i do is warping the file before trying to do anything file the 
> file, to remove the gcps and have a pixel based transform for geo metadata.

what do you mean by a pixel based transform? you mean a geo-transform? 
If so, then I see your point -- mercator is not a linear projection, it 
cannot be represented exactly by an affine transform.

> But there is a big issue: gcps are expected to be in the projection 
> unit, which is not the case in BSB files : gcp are in lat/lon on a 
> mercator projected image.

well, as gcp are lat/lon, the projection is irrelevantly, I suppose.

> That means that for high scales, the approximation between mercator and 
> lat lon becomes visible, and your maps are not correct.

I'm still confused, the GCPs are accurate. I suspect if you use a 
polynomial or thin plate spline, you'd get awfully close. But anyway, 
it's also possible to get the parameters of the mercator projection by 
fitting to the GPS, even if you don't extract that data form the header 
(though you do need to know it is mercator, which most, but I don't 
think all, NOAA charts are).

> One way to solve 
> that is to extract bsb's gcps lat/lon coords, translate it to target 
> projection (generally WGS84/Mercator - EPSG:3395) and use the results 
> has -gcp parameter for gdal_translate.

I'm not sure I get this -- you mean pass in the new set of gcps to 
gdal_translate? Don't you still lose the information about the 
projection? It seems if I can pass in the projection definition and the 
scale, gdal_translate should be able to do the right thing without even 
using the gcps. I need a little prod in the right direction to get 
started though.

Thanks for your help,

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the gdal-dev mailing list