Hello, I am new here and coming from Community Support - GeoServer. I am working with Geoserver 2.24.2.1-CLOUD. I would like to understand how the reprojection works from EPSG: 4326 to EPSG: 3857. I had a look here: Layers — GeoServer 2.27.x User Manual. However, I was not able to find answers to the questions below:
Is a specific library used? Is it possible to know for example which resampling technique and pixel size is used during the reprojection?
The specific library is http://geotools.org which makes use of an EPSG database to setup the transforms shown in the tool above. There is a lot more detail in the GeoTools user guide, and of course the source code!
However because you are talking about pixel size perhaps you are thinking about WMS or WCS output? If so we could go through some more specific details.
For vector data geometry is simplified using the WMS pixel sized when being read out of the data store. This gives datastore like a PostGIS an an opportunity to use TWKB during transfer for example. And then the individual locations are transformed (data to world), and then transformed image locations for drawing the shape (world to image)
For raster data it goes in reverse, from an pixel location going back to world (image to world), and then back to the data location (world to data) and then into row col location (data sample).
For raster there is a “fast path” where no drawing step is taken, instead the output is made directly from the processing chain above
Hopefully the super high level summary is helpful?
Thank you for the warm welcome and the quick response. I will take some time to go through the links you provided.
Correct, I want to make the data available in a webapp via WMS. I reprojected my data once outside of GeoServer and published it. The same data I published as well using the reproject on the fly of GeoServer. I started to compare the responses at some test locations and got curious about how geoserver does the reprojection.
I love that you’re curious, have access to the core developers of GeoServer and GeoTools (and the source code) and that they give their time freely to the community. I hope that you learn as much as you choose to, and then pay it forward in this forum.
I, on the other hand, don’t have as strong a desire to know the intricate details of reprojection, and can simply trust that the GeoTools library has had many decades of a multitude of contributors scrutinising, refining and optimising the code and I can simply rely on it to do its job in GeoServer.