I find WCS tricky to use, did you use the WCS Request Builder to produce your curl command?
One thing I could not determine from your curl example is what what target coverage layout is being used (which is probably what your question is about). I am not sure if WCS 2 allows you to specify that manually or not. Given your raster contains both shifted pixels and one additional row than anticipated by gdal. This may be a difference between sampling at the grid locations defined (WCS), rather that defining a grid of pixels and sampling in the middle of each pixel defined (gdal)? Jody On Mon, Apr 3, 2023 at 5:48 AM Pham Huu Bang <a09...@gmail.com> wrote: > Hello, > > I've a hard time understanding which one should be the correct result by > gdal_translate or GeoServer. > > My system (Ubuntu 22.04) has: > - GDAL 3.4.1 > - Geoserver 2.22 running on Tomcat on port 9090 > > I have a small tiff file (link to download at the bottom of this thread) > in EPSG:4326, then I wanted to have a small subset on Lat and Long axes > from it by running: > > - gdal_translate -projwin 137.915315044103 -36.51629558851893 > 154.64770004642423 -40.081875882617666 test.tif gdal.tif > > > - curl ' > http://localhost:9090/geoserver/wcs?service=WCS&version=2.0.1&request=GetCoverage&format=image/tiff&coverageId=test_raster:output&subset=Lat(-40.081875882617666,-36.51629558851893)&subset=Long(137.915315044103,154.64770004642423)' > -o geoserver.tiff > > - Then gdalinfo gdal.tif returns: > > Size is 17, 4 > > and gdalinfo geoserver.tif returns > > Size is 17, 3 > > - Also the geo bbox of gdal.tif and geoserver.tif are different. > First file gives: > > Upper Left ( 136.9750000, -35.9750000) > > Second file gives: > > Upper Left ( 137.9750000, -36.9750000) > > > More importantly, the pixels are shifted from gdal.tif at the top to > geoserver.tif at the bottom which you can see from this image: > https://imgur.com/a/L0vKvYk > > Here is the link to download test.tif, gdal.tif and geoserver.tif > https://drive.google.com/file/d/1dawCy38FMwx4J7OQsky-gAHHOXsMuDcy/view?usp=sharing > > Please share your opinion which result (gdal.tif or geoserver.tif) should > be correct? > > Thanks, > > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users > -- -- Jody Garnett
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users