Hi all,
I just had an interesting talk with Alessio about the SRS
handling we have now in Geoserver, in particular how
to handle the (possible) difference between the declared
SRS and the actual one.
When I say data in the following, I mean both vector and
grid coverage data.
We have three possible cases:
1) data contains a CRS and a correspondent EPSG number is found
automatically (this happens, thought not in the same way, in
both vector and raster data)
2) data does not contain a CRS indication, the user declares one
3) data contains a CRS indication, but no matching EPSG number
can be found because the CRS is not in the EPSG database.
Case 1) is the happy one, no extra work is needed.
Case 2) is badly handled now. The user could add SRS information
in his data to solve it, but we know few users are good enough
to do that. Besides, he already declared an SRS, no?
Unforunately the declared SRS is used for computing the lat/lon envelope, and for declaring the SRS in GML2 responses,
but the web map rendering subsystem just ignores it,
and ignores any kind of reprojection. So, if the original data
did not have an SRS, it's not possible to reproject data.
To solve this, we need to put inside the map context a feature
source that forces the crs into the feature type (the renderer
uses the CRS attached to the GeometryAttributeType).
This is not hard, I'll handle it soon (GEOS-894)
Case 3) is a festival of approaches.
Envelope computation:
FeatureType envelope computation just ignores the original
CRS. Coverage instead assumes the original CRS is the right
one, thus computes the envelope in that CRS, and then
back projects it into 4326. Since coverages do declare an
envelope in the declared SRS, the envelope is then projected
in the declared system. (original -> 4326 -> declared).
I think the coverage one is the right approach.
On the rendering side, WMS will always use the declared CRS
anyways. On the WFS 1.0 side, we're in trouble, since we're
outputting coordinates in the original CRS, but declaring
a different one. We should be reprojecting instead IMHO,
something that is again easy to do, since we already have a
ReprojectFeatureReader.
Of course it would be nice to have a way to tell the user
about lacks and mismatches, and automatically register new CRSs
in the database, but I guess this is a bit beyond our scope
for 1.5.0. The changes proposed above are not big, and I would like to include them in both 1.5.0 and 1.4.1.
Opinions?
Cheers
Andrea
PS: btw Justin, how does WFS 1.1 deal with cases 2 and 3?