Did you find this code Patrick? I've put it in CVS, but don't have the
means to test it right. It's in
org.vfny.geoserver.responses.map.JAIMapResponse. You can try the code
in cvs. Let me know if it works. I also put in the fix to for the
request to read the transparency.
Chris
----- Original Message -----
From: "Ian Turton" <I.J.Turton@anonymised.com>
To: <patrick@anonymised.com>; <geoserver-devel@lists.sourceforge.net>
Sent: Thursday, September 16, 2004 3:23 PM
Subject: RE: [Geoserver-devel] TRANSPARENT=true
Sorry - I had a jira task on this a while ago but I'm still trying to
get geoserver to build (and I've been busy).
You need add code like this in the code that sets up the graphic the
render draws on:
BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB);
LOGGER.fine("setting up renderer");
java.awt.Graphics g = image.getGraphics();
if (!transparent) {
g.setColor(bgcolor);
g.fillRect(0, 0, width, height);
}else{
int type = AlphaComposite.SRC_OVER;
((Graphics2D)g).setComposite(AlphaComposite.getInstance(type, 0));
}
renderer = new LiteRenderer(map);
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/
First of all, thanks for fixing it
Used the verison in CVS, but seems not to be working.
Have a look again to:
http://patrick.schlaepfer.com/qwms/quick001.htm
The transparancy is set correctly
493917 [FEIN] org.vfny.geoserver.responses.wms.map.JAIMapResponse - setting to transparent
Might be that this JavaScript thing is wrong, that the layers are
not transparent. Probably, because JPEGS/PNGS are not transparent.
Would need gif, could this be the problem?
Thanks
Pat
cholmes@anonymised.com writes:
Did you find this code Patrick? I've put it in CVS, but don't have the
means to test it right. It's in
org.vfny.geoserver.responses.map.JAIMapResponse. You can try the code
in cvs. Let me know if it works. I also put in the fix to for the
request to read the transparency.
Chris
----- Original Message -----
From: "Ian Turton" <I.J.Turton@anonymised.com>
To: <patrick@anonymised.com>; <geoserver-devel@lists.sourceforge.net>
Sent: Thursday, September 16, 2004 3:23 PM
Subject: RE: [Geoserver-devel] TRANSPARENT=true
Sorry - I had a jira task on this a while ago but I'm still trying to
get geoserver to build (and I've been busy).
You need add code like this in the code that sets up the graphic the
render draws on:
BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB);
LOGGER.fine("setting up renderer");
java.awt.Graphics g = image.getGraphics();
if (!transparent) {
g.setColor(bgcolor);
g.fillRect(0, 0, width, height);
}else{
int type = AlphaComposite.SRC_OVER;
((Graphics2D)g).setComposite(AlphaComposite.getInstance(type, 0));
}
renderer = new LiteRenderer(map);
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/
patrick@anonymised.com wrote:
First of all, thanks for fixing it
Used the verison in CVS, but seems not to be working.
Have a look again to:
http://patrick.schlaepfer.com/qwms/quick001.htm
The transparancy is set correctly
493917 [FEIN] org.vfny.geoserver.responses.wms.map.JAIMapResponse - setting to transparent
Might be that this JavaScript thing is wrong, that the layers are
not transparent. Probably, because JPEGS/PNGS are not transparent.
Would need gif, could this be the problem?
Thanks
Pat
Jpegs are not transparents. Png's are, but if you are using
Internet Explorer, the transparency is not supported by the browser.
So either change the browser or use GIF's...
Best regards
Andrea Aime
Ok, but geoserver can't produce GIFs as far as I know.
Anyone having a WEB client, that uses transparent layers?
Not as a Java Applet, something like jsp, javascript.
Thanks
Pat
Andrea Aime writes:
patrick@anonymised.com wrote:
First of all, thanks for fixing it
Used the verison in CVS, but seems not to be working.
Have a look again to:
http://patrick.schlaepfer.com/qwms/quick001.htm
The transparancy is set correctly
493917 [FEIN] org.vfny.geoserver.responses.wms.map.JAIMapResponse - setting to transparent
Might be that this JavaScript thing is wrong, that the layers are
not transparent. Probably, because JPEGS/PNGS are not transparent.
Would need gif, could this be the problem?
Thanks
Pat
Jpegs are not transparents. Png's are, but if you are using
Internet Explorer, the transparency is not supported by the browser.
So either change the browser or use GIF's...
Best regards
Andrea Aime
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
Another observation
Think TRANSPARENT is an optional parameter
So if it doesn't exist in the request, the CVS version
will throw an exception, no?
So there should be a try {..} catch thing like:
private void parseOptionalParameters(GetFeatureInfoRequest request) {
String crs = getValue("SRS");
String transparent = null;
try {
transparent = getValue("TRANSPARENT").toLowerCase();
} catch (Exception e) {
// DO NOTHING
}
if (crs != null) {
request.setCrs(crs);
}
if (transparent != null) {
boolean bTransparent = new Boolean(transparent).booleanValue();
if (bTransparent == true)
request.setTransparent(true);
if (bTransparent == false)
request.setTransparent(false);
}
}
Andrea Aime writes:
patrick@anonymised.com wrote:
First of all, thanks for fixing it
Used the verison in CVS, but seems not to be working.
Have a look again to:
http://patrick.schlaepfer.com/qwms/quick001.htm
The transparancy is set correctly
493917 [FEIN] org.vfny.geoserver.responses.wms.map.JAIMapResponse - setting to transparent
Might be that this JavaScript thing is wrong, that the layers are
not transparent. Probably, because JPEGS/PNGS are not transparent.
Would need gif, could this be the problem?
Thanks
Pat
Jpegs are not transparents. Png's are, but if you are using
Internet Explorer, the transparency is not supported by the browser.
So either change the browser or use GIF's...
Best regards
Andrea Aime
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
Quoting patrick@anonymised.com:
Another observation
Think TRANSPARENT is an optional parameter
So if it doesn't exist in the request, the CVS version
will throw an exception, no?
Did you test it out? Does it throw an exception? In my testing it
doesn't, getValue just returns null if there's not a value. When I
coded I wasn't sure if the Boolean.getValue() would throw a parse
exception if it wasn't true/false, but it doesn't, it just parses to
false, which I think is a reasonable behaviour (though perhaps the wms
spec says it should throw an exception...I'll look into it).
As for transparency support in various formats, I'm not too sure,
hopefully Ian will tell us what format he uses to get transparency
working. GeoServer does not support gif creation, because Java
Advanced Imaging does not support it, I think because it is
proprietary.
Chris
So there should be a try {..} catch thing like:
private void parseOptionalParameters(GetFeatureInfoRequest request) {
String crs = getValue("SRS");
String transparent = null;
try {
transparent = getValue("TRANSPARENT").toLowerCase();
} catch (Exception e) {
// DO NOTHING
}
if (crs != null) {
request.setCrs(crs);
}
if (transparent != null) {
boolean bTransparent = new Boolean(transparent).booleanValue();
if (bTransparent == true)
request.setTransparent(true);
if (bTransparent == false)
request.setTransparent(false);
}
}
Andrea Aime writes:
> patrick@anonymised.com wrote:
>> First of all, thanks for fixing it
>> Used the verison in CVS, but seems not to be working.
>> Have a look again to:
>> http://patrick.schlaepfer.com/qwms/quick001.htm
>> The transparancy is set correctly
>> 493917 [FEIN] org.vfny.geoserver.responses.wms.map.JAIMapResponse
-
>> setting to transparent
>> Might be that this JavaScript thing is wrong, that the layers are
>> not transparent. Probably, because JPEGS/PNGS are not transparent.
>> Would need gif, could this be the problem?
>> Thanks
>> Pat
>
> Jpegs are not transparents. Png's are, but if you are using
> Internet Explorer, the transparency is not supported by the
browser.
> So either change the browser or use GIF's...
>
> Best regards
> Andrea Aime
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your
judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement
on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/
Was my mistake, had some code which was .toLower() and this
didn't work (=exception) when TRANSPARENT was not around.
So think CVS version is ok.
I'm about to implement a gif output module, have no idea
if it will reach production state...
cholmes@anonymised.com writes:
Quoting patrick@anonymised.com:
Another observation
Think TRANSPARENT is an optional parameter
So if it doesn't exist in the request, the CVS version
will throw an exception, no?
Did you test it out? Does it throw an exception? In my testing it
doesn't, getValue just returns null if there's not a value. When I
coded I wasn't sure if the Boolean.getValue() would throw a parse
exception if it wasn't true/false, but it doesn't, it just parses to
false, which I think is a reasonable behaviour (though perhaps the wms
spec says it should throw an exception...I'll look into it).
As for transparency support in various formats, I'm not too sure,
hopefully Ian will tell us what format he uses to get transparency
working. GeoServer does not support gif creation, because Java
Advanced Imaging does not support it, I think because it is
proprietary.
Chris
So there should be a try {..} catch thing like:
private void parseOptionalParameters(GetFeatureInfoRequest request) {
String crs = getValue("SRS");
String transparent = null;
try {
transparent = getValue("TRANSPARENT").toLowerCase();
} catch (Exception e) {
// DO NOTHING
}
if (crs != null) {
request.setCrs(crs);
}
if (transparent != null) {
boolean bTransparent = new Boolean(transparent).booleanValue();
if (bTransparent == true)
request.setTransparent(true);
if (bTransparent == false)
request.setTransparent(false);
}
}
Andrea Aime writes:
> patrick@anonymised.com wrote:
>> First of all, thanks for fixing it
>> Used the verison in CVS, but seems not to be working.
>> Have a look again to:
>> http://patrick.schlaepfer.com/qwms/quick001.htm
>> The transparancy is set correctly
>> 493917 [FEIN] org.vfny.geoserver.responses.wms.map.JAIMapResponse
-
>> setting to transparent
>> Might be that this JavaScript thing is wrong, that the layers are
>> not transparent. Probably, because JPEGS/PNGS are not transparent.
>> Would need gif, could this be the problem?
>> Thanks
>> Pat
>
> Jpegs are not transparents. Png's are, but if you are using
> Internet Explorer, the transparency is not supported by the
browser.
> So either change the browser or use GIF's...
>
> Best regards
> Andrea Aime
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your
judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement
on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel