[Geoserver-devel] SRS Has no apparent effect in vector featuretype via KML

Hi, Can someone indicate whether the SRS code in the feature type
definition for a shapefile actually is used. I have a vector shape
file data that I register with geoserver. and enter the correct epsg
code (24200) which is in the data/user_projections/epsg.properties
file. It displays ok via the open layers map preview window. However
when I try and view it using the KML output, it points me half way
around the world from where it should be. Is the SRS code used to
reproject the vector data to 4326 for kml output, or is it ignored?
Probably I am really asking if the kml output can accomodate vector
data not in WGS84 projection.

On a related question, when I am using the featuretype editor and
click on the "Lookup SRS" button, the SRS input box comes back with
UNKNOWN always, even if I have a valid code in the box before I select
it. Also the SRS List link bring up the page not found
("http://localhost:8084/geoserver/config/data/srsHelp.do"\) error. Is
this link currently working. I am using Geoserver 1.6.4

John

John Preston ha scritto:

Hi, Can someone indicate whether the SRS code in the feature type
definition for a shapefile actually is used. I have a vector shape
file data that I register with geoserver. and enter the correct epsg
code (24200) which is in the data/user_projections/epsg.properties
file. It displays ok via the open layers map preview window. However
when I try and view it using the KML output, it points me half way
around the world from where it should be. Is the SRS code used to
reproject the vector data to 4326 for kml output, or is it ignored?

It is used.

Probably I am really asking if the kml output can accomodate vector
data not in WGS84 projection.

It should, but for the reprojection to be correct, your WKT definition
must match the actual data, if it does not, the output will be like
to the one you're seeing (data reprojected in the wrong
location).
As far as I can see, 24200 is an official EPSG code and GeoServer
supports it out of the box, so you should not need defining it
in epsg.properties. Actually, in this case, your custom definition
will be ignored since there is an official one:

PROJCS["JAD69 / Jamaica National Grid",
   GEOGCS["JAD69",
     DATUM["Jamaica 1969",
       SPHEROID["Clarke 1866", 6378206.4, 294.9786982138982, AUTHORITY["EPSG","7008"]],
       TOWGS84[-33.722, 153.789, 94.959, -8.581, 4.478, -4.54, 1.8460700159115124],
       AUTHORITY["EPSG","6242"]],
     PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
     UNIT["degree", 0.017453292519943295],
     AXIS["Geodetic longitude", EAST],
     AXIS["Geodetic latitude", NORTH],
     AUTHORITY["EPSG","4242"]],
   PROJECTION["Lambert Conic Conformal (1SP)", AUTHORITY["EPSG","9801"]],
   PARAMETER["central_meridian", -77.0],
   PARAMETER["latitude_of_origin", 18.0],
   PARAMETER["scale_factor", 1.0],
   PARAMETER["false_easting", 250000.0],
   PARAMETER["false_northing", 150000.0],
   UNIT["m", 1.0],
   AXIS["Easting", EAST],
   AXIS["Northing", NORTH],
   AUTHORITY["EPSG","24200"]]

If your 24200 is not equivalent to this one, you'll have to
create your own custom code, write the WKT in epsg.properties,
restart GeoServer and then use it in your feature type.

On a related question, when I am using the featuretype editor and
click on the "Lookup SRS" button, the SRS input box comes back with
UNKNOWN always, even if I have a valid code in the box before I select
it.

The lookup button will try to match the SRS embedded natively in your
data (if any) with an official EPSG code, it won't look up the code
you typed. UNKNOWN means your data source has no SRS information, or
the one it has does not exactly match any official EPSG code.

> Also the SRS List link bring up the page not found

("http://localhost:8084/geoserver/config/data/srsHelp.do"\) error. Is
this link currently working. I am using Geoserver 1.6.4

Yep, should be fixed in the next release:
http://jira.codehaus.org/browse/GEOS-1971

In the meantime, you can use the SRSList link appearing in the
GeoServer admin console home page, or just go to:
http://locahost:8080/geoserver/srsHelp.do
(eventually change the host and port to match your installation).

Cheers
Andrea

John Preston ha scritto:

Thanks for the explanation. It seems that the projection text in the
.prj file is not being recognised. It does not look wrong but the fact
that I keep getting UNKNOWN returned means that it does not understand
it. I'm gonna look deeper.

Nope, it does not mean it does not understand it, it means it's not
an exact match for an official EPSG code. It's actually quite common,
one parameter could be slightly different, or the ellipsoid name could
be different.

Forget about the contents of your prj, just check they actually do match
the 24200 definition (same projection, same parameters) and then type in
24200, don't press lookup, generate the bbox, and try again. If you get
your data in the wrong place of the globe again, it's actually quite likely your srs is not 24200 or there is a mismatch between the coordinates of your shapefile and the .prj contents (again, relatively
common, .prj files are very often completely off).

Cheers
Andrea