[gdal-dev] bsb/kap files

maitai at virtual-winds.com maitai at virtual-winds.com
Tue Aug 14 23:22:27 PDT 2012


Hello all, I am new to this list.

We have tried recently to use gdal for reading kap (bsb) files, and in many cases it seems that gdal is not able to convert image coordinates to lat/lon. For instance this file (a kap file from NOAA)

http://www.virtual-winds.com/maitai/14782_1.KAP


This map is correctly converted by bsbLib, but gdalInfo fails to find the coordinates of the corners. bsbLib uses WPx/WPy if present and it seems gdal does not.

I have submitted this problem to Franck Warmerdam, and here is an extract of his answer:

---------------------------------------------------------------------------------------

It may be helpful to raise the issue on the gdal-dev list where other
BSB users can also comment.

It's been a while since I did much work on the BSB/KAP driver, so my
answers may not be completely accurate.  The source is always the
final reference.

I see for the file you provided GDAL identies the reference points
(GCPs) properly, so that is good. And the gdalwarp utility should be
able to warp to WGS84 if needed using the GCPs.  Gdalinfo does not use
the GCPs to transform from pixel/line to georeferenced though it could
be improved to do so.

Later in the code (see ScanForGCPs()) we attempt to transform the GCPs
to the projection defined for the file in the KNP line (POLYCONIC in
this case) and then attempts to use the transformed GCPs to compute an
affine transformation (a GeoTransform in GDAL-speak).  It would appear
this fails - presumably because they aren't regular enough.

I've never tried using the WPX/WPY/PWX/PWY lines.  I gather they are
in fact the suggested coefficients for an affine transform between
pixel/line and POLYCONIC meters?  It might be interesting to try and
use these.

Best regards,
---------------------------------------------------------------------------------------

Maybe someone has already faced this issue or has a solution?

Thanks

Philippe.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120815/51467ea9/attachment.html>


More information about the gdal-dev mailing list