Jesse Eichar a écrit :
> I was wondering if there is a way that already exists where
> MathTransforms and CRS objects can be cached. I did some profiling
> and found that loading MathTransforms and CRSs is very expensive. I
> was wondering if there is a way that they can be cached so the
> FactoryFinders and so on will be hit less hard.
It depends if CRS are created from CRSFactory or CRSAuthorityFactory. I assume
that we are talking
about the later (e.g. creating a CRS from an EPSG code). Yes, CRS are cached if
created from
epsg-access, epsg-hsql or epsg-postgresql factories. But they are not cached
(as far as I know) when
created from epsg-wkt.
MathTransform (as returned by CRS.findMathTransform) are not cached right now.
Simone added a class
for that on trunk recently. This class need some minor tweaking, but should be
ready on trunk soon.
I didn't cached MathTransform because I usually don't rely on
CRS.findMathTransform for that. I
think that caching at this level is not yet as efficient as it could be. This
is because caching at
the CRS.findMathTransform level requires testing both the sourceCRS and
targetCRS. In typical
application, at least on of those is almost frozen. For example in a renderer,
sourceCRS may changes
because the data come from variety of sources, but the targetCRS is the same
for everyone (until the
user change the objective CRS). So a more efficient caching can be done at the
renderer level. This
is what J2D-renderer did. This is also what the GO-1 replacement already do
(org.geotools.go.canvas.ReferencedCanvas2D).
> I'm on 2.2.x right now but hope that there is already something
> there. If there isn't anything on 2.2.x but there is on trunk, can
> we back port it?
If you use epsg-hsql, you should already have the CRS caching (math transform
is an other story). If
you use epsg-wkt and can't switch to epsg-hsql, it may require work in the
epsg-wkt module itself.
The question is whatever it is worth to put time in the epsg-wkt module, since
(in my vision)
epsg-wkt will be replaced by epsg-hsql + epsg-ext (espg-ext will be commited to
trunk). After the
addition of epsg-ext on trunk, the epsg-wkt module should be fully replaceable
and could be deprecated.
Martin.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel