Hello everyone,
I'm experiencing a weird behaviour for the EPSG database management in Geoserver. I've compiled gt trunk (2.4 snapshot) and Geoserver trunk today with a jdk 1.5.0_10.
I have a coverage that is defined to use the code EPSG:41001.
In Geoserver version 1.6alpha2 (the current trunk), when I define my coverage, the code EPSG:41001 is found in the "SRS List" menu. So the SRS request and the SRS response are defined with this value.
So I send a WCS request like this : http://localhost:8080/geoserver1-6/wcs?bbox=-19981848.60,-13817347.59,20037508.34,13817347.59&format=jpeg&service=wcs&version=1.0.0&request=GetCoverage&coverage=geom:OA_20050518_1&crs=EPSG:41001&width=720&height=499.
But I get this error (the full stack trace in the attachement of this mail, I translate in english here) :
org.vfny.geoserver.wcs.WcsException: org.opengis.referencing.NoSuchAuthorityCodeException: No "EPSG:41001" code for the authority "European Petroleum Survey Group" was found for an object like "CoordinateReferenceSystem".
I know that the EPSG code 41001 is in the jar "gt2-epsg-extension-2.4-SNAPSHOT.jar" and is not present in the epsg-hsql jar at the same version of Geotools.
So the question I want to ask is : Is Geoserver parsing the epsg-extension jar when the URL request is sent, as when I define my coverage ?
When I use epsg-wkt it works well ...
Cheers,
Cédric B.
error trace.txt (4.6 KB)
Le mardi 20 février 2007 à 17:14 +0100, Cédric Briançon a écrit :
So the question I want to ask is : Is Geoserver parsing the
epsg-extension jar when the URL request is sent, as when I define my
coverage ?
org.vfny.geoserver.wcs.WcsException: org.opengis.referencing.NoSuchAuthorityCodeException:
Aucun code "EPSG:41001" de l'autorit "European Petroleum Survey Group" n'a t trouvé pour un objet de type "CoordinateReferenceSystem".
at org.vfny.geoserver.wcs.responses.CoverageResponse.execute(CoverageResponse.java:258)
at org.vfny.geoserver.wcs.responses.CoverageResponse.execute(CoverageResponse.java:184)
[...snip...]
Caused by: org.opengis.referencing.NoSuchAuthorityCodeException:
Aucun code "EPSG:41001" de l'autorit "European Petroleum Survey Group" n'a t trouvé pour un objet de type "CoordinateReferenceSystem".
at org.geotools.referencing.factory.AbstractAuthorityFactory.noSuchAuthorityCode(AbstractAuthorityFactory.java:917)
at org.geotools.referencing.factory.epsg.FactoryUsingSQL.createCoordinateReferenceSystem(FactoryUsingSQL.java:1956)
The fact that the "caused by" exception stack trace starts with
FactoryUsingSQL give me the impression that Geoserver code is querying
directly the EPSG factory, instead of using the code that delegate to
all available factories. I suggest to search if some code in either
Geoserver or Geotools raster modules contain the following:
new Hints(Hints.CRS_AUTHORITY_FACTORY, DefaultFactory.class);
This hint was maybe used at the time were "epsg-wkt" and "epsg-hsql" was
together on the classpath, in order to explicitly ask for the epsg-hsql
implementation. If "epsg-wkt" is no longer on the classpath, this hint
should be completly removed, since it may prevent the use of alternative
factories like "epsg-extension".
Martin
I know that the EPSG code 41001 is in the jar
"gt2-epsg-extension-2.4-SNAPSHOT.jar" and is not present in the
epsg-hsql jar at the same version of Geotools.
So the question I want to ask is : Is Geoserver parsing the
epsg-extension jar when the URL request is sent, as when I define my
coverage ?
Hi Cedric:
Isn't this jar ("gt2-epsg-extension-2.4-SNAPSHOT.jar") reading a
.properties file somewhere in the geoserver data directory? I am going
by the info on the wiki (thanks Andrea!!):
http://docs.codehaus.org/display/GEOSDOC/Custom+projection+definition+in+Geoserver+1.5.0+(onwards)
Alex
Martin Desruisseaux ha scritto:
Le mardi 20 février 2007 à 17:14 +0100, Cédric Briançon a écrit :
So the question I want to ask is : Is Geoserver parsing the epsg-extension jar when the URL request is sent, as when I define my coverage ?
org.vfny.geoserver.wcs.WcsException: org.opengis.referencing.NoSuchAuthorityCodeException:
Aucun code "EPSG:41001" de l'autorit "European Petroleum Survey Group" n'a t trouvé pour un objet de type "CoordinateReferenceSystem".
at org.vfny.geoserver.wcs.responses.CoverageResponse.execute(CoverageResponse.java:258)
at org.vfny.geoserver.wcs.responses.CoverageResponse.execute(CoverageResponse.java:184)
[...snip...]
Caused by: org.opengis.referencing.NoSuchAuthorityCodeException:
Aucun code "EPSG:41001" de l'autorit "European Petroleum Survey Group" n'a t trouvé pour un objet de type "CoordinateReferenceSystem".
at org.geotools.referencing.factory.AbstractAuthorityFactory.noSuchAuthorityCode(AbstractAuthorityFactory.java:917)
at org.geotools.referencing.factory.epsg.FactoryUsingSQL.createCoordinateReferenceSystem(FactoryUsingSQL.java:1956)
The fact that the "caused by" exception stack trace starts with
FactoryUsingSQL give me the impression that Geoserver code is querying
directly the EPSG factory, instead of using the code that delegate to
all available factories. I suggest to search if some code in either
Geoserver or Geotools raster modules contain the following:
new Hints(Hints.CRS_AUTHORITY_FACTORY, DefaultFactory.class);
The only place were I can find that code like that in FactoryUsingWKT, copied from epsg-extensions:
/**
* Returns a factory of the given type.
*/
private static final AbstractAuthorityFactory /* T */ getFactory(
final Class /* <T extends AbstractAuthorityFactory> */ type) {
// TODO: use type.cast(...) when we will be allowed to compile for J2SE
// 1.5.
return (AbstractAuthorityFactory) FactoryFinder.getCRSAuthorityFactory("EPSG",
new Hints(Hints.CRS_AUTHORITY_FACTORY, type));
}
well, nothing seems to call it...
On the other side, there are still plenty of places that are not using
CRS, but do get factories with code like:
FactoryFinder.getCRSFactory(new Hints(
Hints.CRS_AUTHORITY_FACTORY, CRSAuthorityFactory.class));
Should I find and replace all of them with CRS calls?
Cheers
Andrea
Cédric Briançon ha scritto:
Hello everyone,
I know that the EPSG code 41001 is in the jar "gt2-epsg-extension-2.4-SNAPSHOT.jar" and is not present in the epsg-hsql jar at the same version of Geotools.
So the question I want to ask is : Is Geoserver parsing the epsg-extension jar when the URL request is sent, as when I define my coverage ?
Cédric, can I have some sample data?
Cheers
Andrea
Le mardi 20 février 2007 à 19:52 +0100, Andrea Aime a écrit :
On the other side, there are still plenty of places that are not using
CRS, but do get factories with code like:
FactoryFinder.getCRSFactory(new Hints(
Hints.CRS_AUTHORITY_FACTORY, CRSAuthorityFactory.class));
I really don't see what is the purpose of "CRSAuthorityFactory.class"
value for this hint. So we could drop the hints completly:
FactoryFinder.getCRSFactory(null);
Keep only the hints that are not CRS_AUTHORITY_FACTORY. I don't think
that we can substitute "CRS.decode(...)" here because the above code is
about CRSFactory, not CRSAuthorityFactory, and CRS provides no method
for that.
Martin