I've been trying to get continuous integration working on this project with GitHub actions, as I am learning it and this module looked like a good challenge.
I've come across an issue with extracting the SRID from an image, I've tracked it down to the command created here:
I rebuilt my local docker php command line to bullseye, and then added --single-line flag to the gdalsrsinfo command, this is incompatible with version 2 when I tested on Buster above. An error was returned instead.
One line is returned, but different info, and again the regular expression match fails:
T2: command=
gdalsrsinfo --single-line -o wkt /var/www/tests/php/RasterTest.tif
T3:GEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]]
T5: No match!!
I am not sure what the best solution is here, but I guess running likes of gdalsrsinfo --version and if it is > 2, add the --single-line flag. After that, the regular expression match would need changed to work in all cases
hi,
I've been trying to get continuous integration working on this project with GitHub actions, as I am learning it and this module looked like a good challenge.
I've come across an issue with extracting the SRID from an image, I've tracked it down to the command created here:
https://github.com/smindel/silverstripe-gis/blob/master/src/Model/Raster.php#L38
The output parsed by https://github.com/smindel/silverstripe-gis/blob/master/src/Model/Raster.php#L45 is a failure with newer versions of gdalsrsinfo
With added debug, I see the following:
Debian 10, Buster (works)
Ubuntu (latest), GitHub Actions (fails)
I think this is the latest LTS, should double check. However the output changes to a multi line structure
This fails the regular expression match.
Debian 11 (Bullseye, fails)
I rebuilt my local docker php command line to bullseye, and then added
--single-line
flag to the gdalsrsinfo command, this is incompatible with version 2 when I tested on Buster above. An error was returned instead.One line is returned, but different info, and again the regular expression match fails:
I am not sure what the best solution is here, but I guess running likes of
gdalsrsinfo --version
and if it is > 2, add the --single-line flag. After that, the regular expression match would need changed to work in all casesKind regards
Gordon