Hello Jukka,
Thanks for your answer. I guess I wanted to ask the opinion of the
community on how to proceed. I see at this point two options:
1) stick with the suggestion of the standard, and do not project 3D->2D.
(The easiest solution, what I already have).
2) allow reprojection 3D->2D and only prevent 2D->3D reprojection
(Andrea's suggestion). This will require quite a lot of further core
changes:
- modification of Query in geotools to allow reprojection per geometry
(with backwards compatibility for the current existing fields).
- modification of GetFeature implementation in geoserver so that without
srsName specified, the 'right' geometries are being reprojected to the
right CRS.
Kind Regards
Niels
On 09/10/2021 15:00, Rahkonen Jukka (MML) wrote:
Hi,
If I understand right your message and the standard, WFS 2.0 does not have any
support for reprojecting both 2D and 3D geometries with a single request
because srsName can appear only once in GetFeature. So if srsName is some 2D
crs then 3D geometry is not projected and if srsName is some 3D crs then the 2D
geometry is not projected. That feels suboptimal.
I agree that transforming 3D CRS into 2D when there is no srsName in GetFeature
request is clearly unwanted behaviour. Otherwise I think that WFS 2.0 does not
feel ready for handling reprojection of multiple geometries in different native
CRS. The solution could to make it possible in WFS to give a separate srsName
for each geometry. It seems that the problem will be the same with OGC API
Features. The core says that features may have several geometries but the crs
extension supports only one crs in the items request.
It may be impossible to do this with so that it is both right according to the
standards and reasonable for the users but I wish you a good luck.
-Jukka Rahkonen-
-----Alkuperäinen viesti-----
Lähettäjä: Niels Charlier via Geoserver-devel
<geoserver-devel@lists.sourceforge.net>
Lähetetty: lauantai 9. lokakuuta 2021 15.05
Vastaanottaja: Geotools-Devel list <geotools-de...@lists.sourceforge.net>;
Geoserver-devel <geoserver-devel@lists.sourceforge.net>
Aihe: [Geoserver-devel] reprojections and multiple geometries
D-
Hello Everyone,
I am sending this email to both geotools and geoserver lists because the matter
concerns both.
I recently made a PR to improve geotools/geoserver behaviour with respect to
multiple geometries that have different CRS.
(https://github.com/geotools/geotools/pull/3642) One of the matters that is
being discussed between Andrea and me is the expected behaviour on reprojection.
I attempted to follow the instructions and examples given for the "srsName"
parameter specified by the OCR WFS2.0 specs
(https://docs.opengeospatial.org/is/09-025r2/09-025r2.html#95
<https://docs.opengeospatial.org/is/09-025r2/09-025r2.html#95>) These seem to
suggest that geometries that have a 'incompatible' CRS are simply not reprojected,
without failure. The only example given for 'incompatibility' is having a different
dimension. Andrea noted that transformation only fails in the direction 2D->3D while
it works the other way around, so that it should still be reprojected in that case.
However, the example given in the specs suggests explicitely that a 3D geometry
would not be converted to a 2D srsName. This seems to be what is expected in my
use case as well.
The problem is complicated further by the fact that in geoserver, the
implementation of GetFeature sometimes explicitly specifies a reprojection CRS
in the query, even if there was no srsName in the http request (the reason has
something to do with how different wfs versions handle crs encoding and axis
order. ) What would happen then is that even when no srsName is specified, the
3D CRS is always being transformed to 2D, which is clearly unwanted behaviour.
Inspire schemas often require feature types with a (primary) 2D geometry and a
(secondary) 3D geometry.
Kind Regards
Niels
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel