[Geoserver-devel] Stop outputting the CRS's WKT in WMS getcaps

It's there since 2008: WMS 1.1.1 GetCapabilities documents include one
full CRS WKT definition per layer, inside a comment, like in the
example bellow.
Now, getcaps docs are already large enough as to have this overhead.
The code says something about being nice to people looking at the
getcaps doc. My opinion is it's unnecessary overhead.
So, can we just get rid of it? or at least replace it by something like:
<!--WKT definition of this CRS:
http://spatialreference.org/ref/epsg/4326/prettywkt -->

Comments/opinions?

This is how it bloats a wms layer right now:

      <Layer queryable="1">
        <Name>topp:states</Name>
        <Title>USA Population</Title>
        <Abstract>This is some census data on the states.</Abstract>
        <KeywordList>
          <Keyword>census</Keyword>
          <Keyword>united</Keyword>
          <Keyword>boundaries</Keyword>
          <Keyword>state</Keyword>
          <Keyword>states</Keyword>
        </KeywordList>
        <SRS>EPSG:26986</SRS>
        <!--WKT definition of this CRS:
PROJCS["NAD83 / Massachusetts Mainland",
  GEOGCS["NAD83",
    DATUM["North American Datum 1983",
      SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]],
      TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
      AUTHORITY["EPSG","6269"]],
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
    UNIT["degree", 0.017453292519943295],
    AXIS["Geodetic longitude", EAST],
    AXIS["Geodetic latitude", NORTH],
    AUTHORITY["EPSG","4269"]],
  PROJECTION["Lambert_Conformal_Conic_2SP", AUTHORITY["EPSG","9802"]],
  PARAMETER["central_meridian", -71.5],
  PARAMETER["latitude_of_origin", 41.0],
  PARAMETER["standard_parallel_1", 42.68333333333334],
  PARAMETER["false_easting", 200000.0],
  PARAMETER["false_northing", 750000.0],
  PARAMETER["scale_factor", 1.0],
  PARAMETER["standard_parallel_2", 41.71666666666667],
  UNIT["m", 1.0],
  AXIS["Easting", EAST],
  AXIS["Northing", NORTH],
  AUTHORITY["EPSG","26986"]]-->
        <LatLonBoundingBox minx="-73.653" miny="34.245" maxx="-73.652"
maxy="34.245"/>

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

On Wed, Jul 13, 2011 at 9:26 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

It's there since 2008: WMS 1.1.1 GetCapabilities documents include one
full CRS WKT definition per layer, inside a comment, like in the
example bellow.
Now, getcaps docs are already large enough as to have this overhead.
The code says something about being nice to people looking at the
getcaps doc. My opinion is it's unnecessary overhead.
So, can we just get rid of it? or at least replace it by something like:
<!--WKT definition of this CRS:
http://spatialreference.org/ref/epsg/4326/prettywkt -->

Comments/opinions?

Definitely don't link to spatial reference, they might not have all the codes
we support and they are stuck in lon/lat order, but for WMS 1.3 we should
be reporting the opposite.

Building a simple rest service in GeoServer that gives you the WKT for
a layer should be easy, I guess you could back reference to that.
Or just make a WMS extension and stick it there.

Another option would be to back reference to the GUI for the SRS list,
the pages are bookmarkable, but many people hide the GUI under
a proxy or un-install it completely, so that might not be the best
choice.

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

On Wed, Jul 13, 2011 at 4:37 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

On Wed, Jul 13, 2011 at 9:26 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

It's there since 2008: WMS 1.1.1 GetCapabilities documents include one
full CRS WKT definition per layer, inside a comment, like in the
example bellow.
Now, getcaps docs are already large enough as to have this overhead.
The code says something about being nice to people looking at the
getcaps doc. My opinion is it's unnecessary overhead.
So, can we just get rid of it? or at least replace it by something like:
<!--WKT definition of this CRS:
http://spatialreference.org/ref/epsg/4326/prettywkt -->

Comments/opinions?

Definitely don't link to spatial reference, they might not have all the codes
we support and they are stuck in lon/lat order, but for WMS 1.3 we should
be reporting the opposite.

Building a simple rest service in GeoServer that gives you the WKT for
a layer should be easy, I guess you could back reference to that.
Or just make a WMS extension and stick it there.

Another option would be to back reference to the GUI for the SRS list,
the pages are bookmarkable, but many people hide the GUI under
a proxy or un-install it completely, so that might not be the best
choice.

Guess that means having the CRS WKT in the getcaps doc is a wanted
feature, either as WKT or as a link?
I was hoping the answer being to just get rid of it. Don't quite get
why it should be there at all.
btw, a simple REST end point would be easy, though it'd suffer from
the same auth issue than any other REST endpoint that just needs to be
public right? like in it should be outside /rest

Cheers,
Gabriel

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

On Wed, Jul 13, 2011 at 9:42 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Guess that means having the CRS WKT in the getcaps doc is a wanted
feature, either as WKT or as a link?
I was hoping the answer being to just get rid of it. Don't quite get
why it should be there at all.

I'm always weary of undoing work just because I don't understand why
the code is there in the first place. I guess you're too, otherwise you
would not be asking on the mailing list.

The comment in the code is:

            // DJB: I want to be nice to the people reading the capabilities
            // file - I'm going to get the
            // human readable name and stick it in the capabilities file
            // NOTE: this isnt well done because "comment()" isnt in the
            // ContentHandler interface...
            try {
                CoordinateReferenceSystem crs = layer.getResource().getCRS();
                String desc = "WKT definition of this CRS:\n" + crs;
                comment(desc);
            } catch (Exception e) {
                if (LOGGER.isLoggable(Level.WARNING)) {
                    LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
                }
            }

Indeed it seems like a single handed decision. Yet, we don't know, it has
been there for years and I would not be surprised if some custom
app is using it, it can be used to avoid having a full EPSG database
in the client for example.

We could have an option to show it or turn it off, or have that simple rest
service outside the /rest paths, that would certainly come in handy too
(it might grow into being a prj2epsg.org replacement for example)

Anyways, I'm just talking in general... if nobody cares about it on the
devel list, maybe ask on the user list, if nobody answers there either, I guess
you have a pretty good case for just killing it.
Personally, I don't use it, but I can't speak for others.

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

Hey, resuming this old thread.

All the JavaScript types at OpenGeo are in favor of stop outputting
the CRS WKT as it's a lot of overhead when loading capabilities
documents.
Now, I don't really have time nor a mandate to do this in a way that
preserves backwards compatibility with any possible awkward client
that might be relying on these comments (which would speak badly about
the client anyways).
So out of interest in making the client side developers and users
happy, may we just stop writing the CRS WKT at least on trunk? Looks
like we already determined writing those comments was an unilateral
decision of the developer that put them there anyways.

TIA,
Gabriel
On Wed, Jul 13, 2011 at 5:32 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

On Wed, Jul 13, 2011 at 9:42 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Guess that means having the CRS WKT in the getcaps doc is a wanted
feature, either as WKT or as a link?
I was hoping the answer being to just get rid of it. Don't quite get
why it should be there at all.

I'm always weary of undoing work just because I don't understand why
the code is there in the first place. I guess you're too, otherwise you
would not be asking on the mailing list.

The comment in the code is:

       // DJB: I want to be nice to the people reading the capabilities
       // file \- I&#39;m going to get the
       // human readable name and stick it in the capabilities file
       // NOTE: this isnt well done because &quot;comment\(\)&quot; isnt in the
       // ContentHandler interface\.\.\.
       try \{
           CoordinateReferenceSystem crs = layer\.getResource\(\)\.getCRS\(\);
           String desc = &quot;WKT definition of this CRS:\\n&quot; \+ crs;
           comment\(desc\);
       \} catch \(Exception e\) \{
           if \(LOGGER\.isLoggable\(Level\.WARNING\)\) \{
               LOGGER\.log\(Level\.WARNING, e\.getLocalizedMessage\(\), e\);
           \}
       \}

Indeed it seems like a single handed decision. Yet, we don't know, it has
been there for years and I would not be surprised if some custom
app is using it, it can be used to avoid having a full EPSG database
in the client for example.

We could have an option to show it or turn it off, or have that simple rest
service outside the /rest paths, that would certainly come in handy too
(it might grow into being a prj2epsg.org replacement for example)

Anyways, I'm just talking in general... if nobody cares about it on the
devel list, maybe ask on the user list, if nobody answers there either, I guess
you have a pretty good case for just killing it.
Personally, I don't use it, but I can't speak for others.

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

On Thu, Mar 8, 2012 at 3:16 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hey, resuming this old thread.

All the JavaScript types at OpenGeo are in favor of stop outputting
the CRS WKT as it's a lot of overhead when loading capabilities
documents.
Now, I don't really have time nor a mandate to do this in a way that
preserves backwards compatibility with any possible awkward client
that might be relying on these comments (which would speak badly about
the client anyways).
So out of interest in making the client side developers and users
happy, may we just stop writing the CRS WKT at least on trunk? Looks
like we already determined writing those comments was an unilateral
decision of the developer that put them there anyways.

A safe path may be to guard that code with a system variable, off
by default but can be re-enabled if someone really really needs it.

Alternatively I guess we could expose some rest service that does not require
authorization that allows to gather the codes and the wkt representation, if
you really need it you can go and grab the wkt there

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------