|
|
|
stutte
|
Some javascript/style in this post has been disabled (why?)
Dear list,for who me remember: after a "short" parenthesis, I am back on the track. For all others: See the archive :-D . As we have to put in production a system with ECW support, I took a look at the old code I contributed nearly 2 years ago, and decided to do a revision. It addresses the following topics: 1) Update to latest ECW library Though erdas (formaly ermapper) does not provide a Java SDK any more, the open source community provides an alternate JNI wrapper for the ECW C/C++ SDK from erdas. You find it here: https://gvsig.org/web/ as part of this desktop GIS (I never tried, I must admit). Just download the windows installer of the desktop version and after installation find the following files inside its folder: 30/07/2009 13.39 26.647 jecw-0.0.7.jar 22/07/2009 08.46 24.576 jecw.dll 05/02/2009 13.21 57.379 NCScnet.dll 05/02/2009 13.21 1.052.706 NCSEcw.dll 05/02/2009 13.21 69.667 NCSEcwC.dll 05/02/2009 13.21 135.203 NCSUtil.dll Replace all the NCSxxx dlls of deegree, add the jecw dll to your library path and the jecw jar to WEB-INF/lib. Do not forget to remove the ermapper.jar. The replacement works out of the box, as they kept compatible the interfaces. The new version of the library seems to be muche more stable and less memory consuming, but a bit slower. In any case I recommend updating. 2) Update of ECW file caching strategies Mainly I reviewed the code and cleaned it up, adding also some configuration parameters to be set in a properties file. The file is named "ecwcache.properties", situated in WEB-INF/classes and contains the following parameter: expirationPeriodMs=5000 I will send with a seperate mail the new versions of ECWReader and ECWFileCache. A side note: We experience temporary blocking of the server if put under heavy load (very easy to do with open layers or other AJAX frameworks). It seems, that many http tile requests have been canceled (closed connection) by the web browser client, but WMSHandler.writeImage tries to send the image data anyway and waits for a timeout (and after getting the exception, it tries to send an XML error message over the same line, waiting for another timeout). In case of a low worker thread number, this may lead to long blocks (low means with 100 threads a single client can reach the limit). Afterwords everything turns working without need for shutdown. I wonder, if there is no method to check the connection status prior to send the response (I should refresh my memory on HttpServletRequest/Responses...). 3) Correction of a Bug in org.deegree.graphics.displayelements.RasterDisplayElement In our application we have a large ECW layer with EPSG:32633. In some zoom levels, we noticed a missing pixel coloumn at the right of each tile (we use Open layers). After some testing, I could definitely exclude that the ECW loading went wrong, so I had to investigate further. Reverse-inspecting the processing chain, I found this piece of code in RasterDisplayElements (from the trunk in svn): public void paint( Graphics g, GeoTransform projection, double scale ) {
synchronized ( symbolizer ) {
try {
if ( doesScaleConstraintApply( scale ) ) {
Envelope env = gc.getEnvelope();
int minx = (int) ( projection.getDestX( env.getMin().getX() ) );
int maxy = (int) ( projection.getDestY( env.getMin().getY() ) );
int maxx = (int) ( projection.getDestX( env.getMax().getX() ) );
int miny = (int) ( projection.getDestY( env.getMax().getY() ) );
....
} catch ( Exception e ) {
LOG.logError( e.getMessage(), e );
throw new RuntimeException( e.getMessage(), e );
}
}
}
Adding a debug output revealed, that missing rounding in some cases
leads to maxx of 255 rather than 256 (all requested tiles in our use
case have the same size, so testing was easier). I resolved the problem
like this:// ----------------------------------------------------------------- // Jens Stutte (Planetek Italia s.r.l) 16/09/2009 // BUGFIX: Added Math.round to avoid blank pixels in some // scaling factors of (ECW) coverages. // Prior to this changes, for example a request for a 256x256 tile // could result in some cases in a stretched painting into a // 255x256 rectangle. // TODO: Check if there are no side effects of this change ! int minx = (int) Math.round( ( projection.getDestX( env.getMin().getX() ) ) ); int maxy = (int) Math.round( ( projection.getDestY( env.getMin().getY() ) ) ); int maxx = (int) Math.round( ( projection.getDestX( env.getMax().getX() ) ) ); int miny = (int) Math.round( ( projection.getDestY( env.getMax().getY() ) ) ); LOG.logDebug("paint (minx,miny,maxx,maxy) : (" + minx + "," + miny + "," + maxx + "," + maxy + ")"); Afterwards I saw, that in the svn 2.2_testing branch, there is slightly different code. Hence I would recommend to review this code in order to definitely assure the right fix of this problem (the "whitespace line" comment in the last commit in 2.2_testing sounds familiar, though, and probably the solution you adopted there has some rational I do not know and is better than the above "round-fix" - but I did not test this variant of the code, yet, so by now I'll stick with mine). I will send with a seperate mail this bugfix. Glad if I could help someone struggling with ECW, Jens Stutte ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ deegree-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/deegree-devel |
||||||||||||||||
|
Andreas Poth
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Hi Jens, thanx, for your work. Because of Intergeo next week it will take some time to test and integrate your code. Also we must check license conditions of required libraries ... but I hope we will integrate everything (if licenses are not critical) within the next three weeks. best regards ANDREAS stutte schrieb: > Dear list, > > for who me remember: after a "short" parenthesis, I am back on the > track. For all others: See the archive :-D . > > As we have to put in production a system with ECW support, I took a look > at the old code I contributed nearly 2 years ago, and decided to do a > revision. It addresses the following topics: > > *1) Update to latest ECW library* > Though erdas (formaly ermapper) does not provide a Java SDK any more, > the open source community provides an alternate JNI wrapper for the ECW > C/C++ SDK from erdas. You find it here: https://gvsig.org/web/ as part > of this desktop GIS (I never tried, I must admit). Just download the > windows installer of the desktop version and after installation find the > following files inside its folder: > > 30/07/2009 13.39 26.647 jecw-0.0.7.jar > 22/07/2009 08.46 24.576 jecw.dll > 05/02/2009 13.21 57.379 NCScnet.dll > 05/02/2009 13.21 1.052.706 NCSEcw.dll > 05/02/2009 13.21 69.667 NCSEcwC.dll > 05/02/2009 13.21 135.203 NCSUtil.dll > > Replace all the NCSxxx dlls of deegree, add the jecw dll to your library > path and the jecw jar to WEB-INF/lib. Do not forget to remove the > ermapper.jar. The replacement works out of the box, as they kept > compatible the interfaces. > The new version of the library seems to be muche more stable and less > memory consuming, but a bit slower. In any case I recommend updating. > > *2) Update of ECW file caching strategies* > Mainly I reviewed the code and cleaned it up, adding also some > configuration parameters to be set in a properties file. The file is > named "ecwcache.properties", situated in WEB-INF/classes and contains > the following parameter: > expirationPeriodMs=5000 > I will send with a seperate mail the new versions of ECWReader and > ECWFileCache. > *A side note:* We experience temporary blocking of the server if put > under heavy load (very easy to do with open layers or other AJAX > frameworks). > It seems, that many http tile requests have been canceled (closed > connection) by the web browser client, but WMSHandler.writeImage tries > to send the image data anyway and waits for a timeout (and after getting > the exception, it tries to send an XML error message over the same line, > waiting for another timeout). In case of a low worker thread number, > this may lead to long blocks (low means with 100 threads a single client > can reach the limit). Afterwords everything turns working without need > for shutdown. I wonder, if there is no method to check the connection > status prior to send the response (I should refresh my memory on > HttpServletRequest/Responses...). > > *3) Correction of a Bug in > org.deegree.graphics.displayelements.RasterDisplayElement* > In our application we have a large ECW layer with EPSG:32633. In some > zoom levels, we noticed a missing pixel coloumn at the right of each > tile (we use Open layers). After some testing, I could definitely > exclude that the ECW loading went wrong, so I had to investigate > further. Reverse-inspecting the processing chain, I found this piece of > code in RasterDisplayElements (from the trunk in svn): > > public void paint( Graphics g, GeoTransform projection, double scale ) { > synchronized ( symbolizer ) { > try { > if ( doesScaleConstraintApply( scale ) ) { > Envelope env = gc.getEnvelope(); > int minx = (int) ( projection.getDestX( env.getMin().getX() ) ); > int maxy = (int) ( projection.getDestY( env.getMin().getY() ) ); > int maxx = (int) ( projection.getDestX( env.getMax().getX() ) ); > int miny = (int) ( projection.getDestY( env.getMax().getY() ) ); > > .... > > } catch ( Exception e ) { > LOG.logError( e.getMessage(), e ); > throw new RuntimeException( e.getMessage(), e ); > } > } > } > > Adding a debug output revealed, that missing rounding in some cases > leads to maxx of 255 rather than 256 (all requested tiles in our use > case have the same size, so testing was easier). I resolved the problem > like this: > > // > ----------------------------------------------------------------- > // Jens Stutte (Planetek Italia s.r.l) 16/09/2009 > // BUGFIX: Added Math.round to avoid blank pixels in some > // scaling factors of (ECW) coverages. > // Prior to this changes, for example a request for a > 256x256 tile > // could result in some cases in a stretched painting into a > // 255x256 rectangle. > // TODO: Check if there are no side effects of this change ! > int minx = (int) Math.round( ( projection.getDestX( > env.getMin().getX() ) ) ); > int maxy = (int) Math.round( ( projection.getDestY( > env.getMin().getY() ) ) ); > int maxx = (int) Math.round( ( projection.getDestX( > env.getMax().getX() ) ) ); > int miny = (int) Math.round( ( projection.getDestY( > env.getMax().getY() ) ) ); > LOG.logDebug("paint (minx,miny,maxx,maxy) : (" + minx + "," > + miny + "," + maxx + "," + maxy + ")"); > > Afterwards I saw, that in the svn 2.2_testing branch, there is slightly > different code. Hence I would recommend to review this code in order to > definitely assure the right fix of this problem (the "whitespace line" > comment in the last commit in 2.2_testing sounds familiar, though, and > probably the solution you adopted there has some rational I do not know > and is better than the above "round-fix" - but I did not test this > variant of the code, yet, so by now I'll stick with mine). > I will send with a seperate mail this bugfix. > > Glad if I could help someone struggling with ECW, > > Jens Stutte > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > > > ------------------------------------------------------------------------ > > _______________________________________________ > deegree-devel mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/deegree-devel - -- Dr. Andreas Poth l a t / l o n GmbH Aennchenstrasse 19 53177 Bonn, Germany phone ++49 +228 18496-0 fax ++49 +228 18496-29 http://www.lat-lon.de http://www.deegree.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJKs0fXAAoJEFkfq+114rKIoG4IAI6O5v9O/69SyqbAUwZcPQhw cOy6qbgyMwMq1evzSZaK8Auw9wv9oV5d1zgZpOx/CmeUhZY39xk4D39qwLJTMYzG pgw7IsMTiVx8UeLgTQog6HbLpA7X0L5MDpeXIPoSnCIgDQEhzsnk5wG1w4UqshEB p/UVyHjx812hlGRMlvKqCAKmPPTZ5ZrV69AwN404BTBStMt+R78YV1ylyNDNkf4V LMSIiJeotxljiARyOmnG+iwyEoXM2h3RXIDY5tqIaAalE24tx+aXfia8gMosTwMo oLd6cocaIVI2G4AdTdqa+CbolScNignoPc/C4RsYSZMSgcLAuyWoVnzQw+DHZTA= =RYsc -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ deegree-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/deegree-devel |
|
aaime
|
Andreas Poth ha scritto:
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Jens, > > thanx, for your work. Because of Intergeo next week it will take some > time to test and integrate your code. Also we must check license > conditions of required libraries ... but I hope we will integrate > everything (if licenses are not critical) within the next three weeks. Hi Andreas, in GeoServer land we have the same issue and Erdas told us directly, on the developer mailing list, that we cannot ship the libraries along with GeoServer because it's a server side app: http://www.nabble.com/ECW-license-changed--td25010814.html (see Richard Orchard response). This is most annoying. Did you hear otherwise? Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ deegree-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/deegree-devel |
||||||||||||||||
|
stutte
|
Some javascript/style in this post has been disabled (why?)
Hi Andrea,the license problem mentioned by Andreas concerns about the (real) GPL license of the JNI ECW wrapper from gvSig, not the shipping of the ECW libs itself. On this behalf I am trying to get clarifications, too, especially on the "No more restrictions on the distribution of 'Server Software' under the GPL-style Public Use License Agreement" statement from Erdas web site, which seem to be not so simple. See here for example: http://www.nabble.com/ECW-license-changed--td25010814.html Conclusion: "You can include ECW in your open source project, as long as it is not used for anything except non-profits or teaching.". That would mean, the responsibility for licensing is on the end-users side. Jens -------- Original Message -------- Subject: Re: [deegree-devel] ECW support update From: Andrea Aime [hidden email] To: [hidden email] Date: Mercoledì 23 Settembre 2009 15.13.07 Andreas Poth ha scritto: ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ deegree-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/deegree-devel |
||||||||||||||||
|
stutte
|
Some javascript/style in this post has been disabled (why?)
Uhmm, that was your same link. So in two we have two different
interpretations - and we are not even lawyers...-------- Original Message -------- Subject: Re: [deegree-devel] ECW support update From: stutte [hidden email] To: [hidden email] Date: Mercoledì 23 Settembre 2009 17.29.39 Hi Andrea, ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ deegree-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/deegree-devel |
||||||||||||||||
|
Andreas Poth
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Hi, two days ago I discussed this with some people at the intergeo in Karlsruhe. They all shared interpretation of Andrea. To avoid problems we will not offer ECW libraries anymore if we update our code with classes written by Jens. Since we already have this situation for Oracle and ArcSDE I do not think this is really a problem. But it will require some further changes in deegree code base to be able to compile deegree without ECW libraries. I will discuss this topic next days with other members of deegree PSC. best regards ANDREAS stutte schrieb: > Uhmm, that was your same link. So in two we have two different > interpretations - and we are not even lawyers... > > -------- Original Message -------- > Subject: Re: [deegree-devel] ECW support update > From: stutte <[hidden email]> <mailto:[hidden email]> > To: [hidden email] > <mailto:[hidden email]> > Date: Mercoledì 23 Settembre 2009 17.29.39 >> Hi Andrea, >> >> the license problem mentioned by Andreas concerns about the (real) GPL >> license of the JNI ECW wrapper from gvSig, not the shipping of the ECW >> libs itself. On this behalf I am trying to get clarifications, too, >> especially on the "No more restrictions on the distribution of 'Server >> Software' under the GPL-style Public Use License Agreement" statement >> from Erdas web site, which seem to be not so simple. See here for example: >> http://www.nabble.com/ECW-license-changed--td25010814.html >> Conclusion: "You can include ECW in your open source project, as long >> as it is not used for anything except non-profits or teaching.". That >> would mean, the responsibility for licensing is on the end-users side. >> >> Jens >> >> -------- Original Message -------- >> Subject: Re: [deegree-devel] ECW support update >> From: Andrea Aime <[hidden email]> <mailto:[hidden email]> >> To: [hidden email] >> <mailto:[hidden email]> >> Date: Mercoledì 23 Settembre 2009 15.13.07 >>> Andreas Poth ha scritto: >>> >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Hi Jens, >>>> >>>> thanx, for your work. Because of Intergeo next week it will take some >>>> time to test and integrate your code. Also we must check license >>>> conditions of required libraries ... but I hope we will integrate >>>> everything (if licenses are not critical) within the next three weeks. >>>> >>> Hi Andreas, >>> in GeoServer land we have the same issue and Erdas told us directly, >>> on the developer mailing list, that we cannot ship the libraries >>> along with GeoServer because it's a server side app: >>> http://www.nabble.com/ECW-license-changed--td25010814.html >>> (see Richard Orchard response). >>> >>> This is most annoying. Did you hear otherwise? >>> Cheers >>> Andrea >>> >>> >> >> >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry® Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9-12, 2009. Register now! >> http://p.sf.net/sfu/devconf >> >> _______________________________________________ >> deegree-devel mailing list >> [hidden email] <mailto:[hidden email]> >> https://lists.sourceforge.net/lists/listinfo/deegree-devel >> > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > > > ------------------------------------------------------------------------ > > _______________________________________________ > deegree-devel mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/deegree-devel - -- Dr. Andreas Poth l a t / l o n GmbH Aennchenstrasse 19 53177 Bonn, Germany phone ++49 +228 18496-0 fax ++49 +228 18496-29 http://www.lat-lon.de http://www.deegree.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJKvHbyAAoJEFkfq+114rKInu4IAIXTDs4llyU7HZsmCV0kMKvd EICc3N+fMaVMlAqWrzEysYDNjLI239ef245JSzsL8wEEC4BjEb0p9+pPDrh9Gpm0 RphQ2NHXCenlAvZKxtsp180ata85mpR+eqW3TT8msTH8cUhM3Aflg+gtcv/Xs7TG yWxjMu8NES1myogWrvhGCYadFqEXeU8S/YAKFzzUsgKhNza5IkcIa0pFFM6chGzw UmxASpbovalWGTCyi9o+3MLXUgIKdQ5G1yMvyUJB+T3lla9roN683X7x5zLJOKqQ qrgKAkLipl1AsTrHGB5mu+4790GUoXrlLjb4Y2tSi0EQpjnDMwqvgf13jOI+zg0= =QLlo -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ deegree-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/deegree-devel |
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |