Skip to content

Commit 587c9ea

Browse files
authored
Merge pull request #12437 from rouault/restore_gsbg
Restore GSBG (Golden Software Surfer Binary Grid 6.0) support
2 parents 6dbbb9c + 5ab331e commit 587c9ea

File tree

12 files changed

+1128
-2
lines changed

12 files changed

+1128
-2
lines changed

.github/workflows/ubuntu_24.04/expected_gdalinfo_formats.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Supported Formats: (ro:read-only, rw:read-write, +:write from scratch, u:update,
5858
WMS -raster- (rwvs): OGC Web Map Service
5959
MSGN -raster- (rov): EUMETSAT Archive native (.nat) (*.nat)
6060
RST -raster- (rw+v): Idrisi Raster A.1 (*.rst)
61+
GSBG -raster- (rw+v): Golden Software Binary Grid (.grd) (*.grd)
6162
GS7BG -raster- (rw+v): Golden Software 7 Binary Grid (.grd) (*.grd)
6263
COSAR -raster- (rov): COSAR Annotated Binary Matrix (TerraSAR-X)
6364
TSX -raster- (rov): TerraSAR-X Product

.github/workflows/windows_conda_expected_gdalinfo_formats.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Supported Formats: (ro:read-only, rw:read-write, +:write from scratch, u:update,
5959
MSGN -raster- (rov): EUMETSAT Archive native (.nat) (*.nat)
6060
MSG -raster- (ro): MSG HRIT Data
6161
RST -raster- (rw+v): Idrisi Raster A.1 (*.rst)
62+
GSBG -raster- (rw+v): Golden Software Binary Grid (.grd) (*.grd)
6263
GS7BG -raster- (rw+v): Golden Software 7 Binary Grid (.grd) (*.grd)
6364
COSAR -raster- (rov): COSAR Annotated Binary Matrix (TerraSAR-X)
6465
TSX -raster- (rov): TerraSAR-X Product
1.62 KB
Binary file not shown.

autotest/gdrivers/gsg.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,36 @@
1818
# Perform simple read tests.
1919

2020

21+
def test_gsg_1():
22+
23+
tst = gdaltest.GDALTest("gsbg", "gsg/gsg_binary.grd", 1, 4672)
24+
tst.testOpen(check_gt=(440720, 60, 0, 3751320, 0, -60))
25+
26+
2127
def test_gsg_3():
2228

2329
tst = gdaltest.GDALTest("gs7bg", "gsg/gsg_7binary.grd", 1, 4672)
2430
tst.testOpen(check_gt=(440720, 60, 0, 3751320, 0, -60))
2531

2632

33+
###############################################################################
34+
# Create simple copy and check.
35+
36+
37+
def test_gsg_4():
38+
39+
tst = gdaltest.GDALTest("gsbg", "gsg/gsg_binary.grd", 1, 4672)
40+
41+
tst.testCreateCopy(check_gt=1)
42+
43+
44+
def test_gsg_6():
45+
46+
tst = gdaltest.GDALTest("gsbg", "gsg/gsg_binary.grd", 1, 4672)
47+
48+
tst.testCreate(out_bands=1)
49+
50+
2751
def test_gsg_7():
2852

2953
tst = gdaltest.GDALTest("gs7bg", "gsg/gsg_7binary.grd", 1, 4672)

doc/source/drivers/raster/gs7bg.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ GS7BG -- Golden Software Surfer 7 Binary Grid File Format
1010

1111
This is the binary (non-human-readable) version of one of the raster
1212
formats used by Golden Software products (such as the Surfer series).
13+
This format differs from the :ref:`raster.gsbg` format (also known as
14+
Surfer 6 binary grid format), it is more complicated and flexible.
1315

1416
NOTE: Implemented as :source_file:`frmts/gsg/gs7bgdataset.cpp`.
1517

doc/source/drivers/raster/gsbg.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.. _raster.gsbg:
2+
3+
================================================================================
4+
GSBG -- Golden Software Binary Grid File Format
5+
================================================================================
6+
7+
.. shortname:: GSBG
8+
9+
.. built_in_by_default::
10+
11+
This is the binary (non-human-readable) version of one of the raster
12+
formats used by Golden Software products (such as the Surfer series).
13+
This format is supported for both reading and
14+
writing (including create, delete, and copy). Currently the associated
15+
formats for color, metadata, and shapes are not supported.
16+
17+
Surfer 8 uses a fixed nodata value at 1.701410009187828e+38. When writing a
18+
GSBG dataset, GDAL remaps the user-specified input nodata value to 1.701410009187828e+38.
19+
20+
NOTE: Implemented as :source_file:`frmts/gsg/gsbgdataset.cpp`.
21+
22+
Driver capabilities
23+
-------------------
24+
25+
.. supports_createcopy::
26+
27+
.. supports_create::
28+
29+
.. supports_georeferencing::
30+
31+
.. supports_virtualio::

doc/source/drivers/raster/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Raster drivers
1616

1717
The following drivers have been removed in GDAL 3.5: BPG, E00GRID, EPSILON, IGNFHeightASCIIGrid, NTv1
1818

19-
The following drivers have been removed in GDAL 3.11: BLX, BT, CTable2, FIT, GSAG (Golden Software ASCII grid), GSBG (Golden Software 6.0 binary grid), JP2Lura, OZI, Rasterlite (v1), R object data store (.rda), RDB, SDTS, SGI, XPM
19+
The following drivers have been removed in GDAL 3.11: BLX, BT, CTable2, FIT, GSAG (Golden Software ASCII grid), JP2Lura, OZI, Rasterlite (v1), R object data store (.rda), RDB, SDTS, SGI, XPM
2020

2121
Write support for the following formats has been removed in GDAL 3.11: ADRG, BYN, ELAS, LAN, MFF, MFF2/HKV, ISIS2, PAux, USGSDEM
2222

@@ -71,6 +71,7 @@ Raster drivers
7171
grassasciigrid
7272
grib
7373
gs7bg
74+
gsbg
7475
gsc
7576
gdalg
7677
gta

frmts/drivers.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ WMS
8181
MSGN
8282
MSG
8383
RST
84+
GSBG
8485
GS7BG
8586
COSAR
8687
TSX

frmts/gdalallregister.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ void CPL_STDCALL GDALAllRegister()
550550
#endif
551551

552552
#ifdef FRMT_gsg
553+
GDALRegister_GSBG();
553554
GDALRegister_GS7BG();
554555
#endif
555556

frmts/gsg/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
add_gdal_driver(
22
TARGET gdal_GSG
3-
SOURCES gs7bgdataset.cpp
3+
SOURCES gs7bgdataset.cpp gsbgdataset.cpp
44
BUILTIN)
55
# FIXME should be 'PLUGIN_CAPABLE NO_DEPS' but requires some code to glue the registration of the 3 drivers
66
gdal_standard_includes(gdal_GSG)

0 commit comments

Comments
 (0)