[Geoserver-devel] Improvements in PDF and SVG rendering

Hi,
today I landed on GeoTools Milton Jonathan vector
rendering improvements.
What do they do? Well, they allow marks and SVG graphics
to get in their vector form down to the last bit of the
graphics pipeline, allowing them to be preserved in
vector form when the format can get a benefit from it.

I've activated the new code path for the PDF and SVG outputs,
here you can see results:
http://sigma.openplans.org/~aaime/states-hatch.pdf
http://sigma.openplans.org/~aaime/flags.pdf

If you're wondering where the improvement is, try
to generate the same with an older version of GS and
then zoom in... you'll notice the fill will start to
pixellate, since before the patch what you had inside
the polygons what a bitmap.
The same goes for the little flags in the second PDF.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

I tried to take a closer look at this in my 2.0.1 (nightly from 2/1/2010).

I can get the states shapefile and pophatch style to draw OK in OpenLayers:
http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:states&styles=pophatch&bbox=-124.731,24.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=application/openlayers

but generating the PDF drops the hatching:

http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:states&styles=pophatch&bbox=-124.731,24.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=application/pdf

I can generate PDF from other layers with fills (but they are a different kind of fill).

I'd try the flags example, but I'm not sure which shapefile and style belong to that one. I have a flags.xml with no flags.sld in the styles dir.

Possibly when you activated the new code path it hasn't yet made it into the version I'm trying?

It sounds like this is a great addition to the "what's new" list to our users when we upgrade, but I should take a look and zoom in as you suggest.

-----Original Message-----
From: geoserver-devel-bounces@lists.sourceforge.net [mailto:geoserver-devel-bounces@lists.sourceforge.net] On Behalf Of Andrea Aime
Sent: Friday, January 29, 2010 1:16 PM
To: Geoserver-devel
Subject: [Geoserver-devel] Improvements in PDF and SVG rendering

Hi,
today I landed on GeoTools Milton Jonathan vector rendering improvements.
What do they do? Well, they allow marks and SVG graphics to get in their vector form down to the last bit of the graphics pipeline, allowing them to be preserved in vector form when the format can get a benefit from it.

I've activated the new code path for the PDF and SVG outputs, here you can see results:
http://sigma.openplans.org/~aaime/states-hatch.pdf
http://sigma.openplans.org/~aaime/flags.pdf

If you're wondering where the improvement is, try to generate the same with an older version of GS and then zoom in... you'll notice the fill will start to pixellate, since before the patch what you had inside the polygons what a bitmap.
The same goes for the little flags in the second PDF.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Freeman, Aleda (EEA) ha scritto:

I tried to take a closer look at this in my 2.0.1 (nightly from
2/1/2010).

I can get the states shapefile and pophatch style to draw OK in
OpenLayers: http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:states&styles=pophatch&bbox=-124.731,24.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=application/openlayers

but generating the PDF drops the hatching:

http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:states&styles=pophatch&bbox=-124.731,24.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=application/pdf

Odd? I've just tried with my local version and hatches are generated
just fine? See attached PDF.

I can generate PDF from other layers with fills (but they are a
different kind of fill).

I'd try the flags example, but I'm not sure which shapefile and style
belong to that one. I have a flags.xml with no flags.sld in the
styles dir.

The flags style in my release configuration is actually called "burg"
(might mean flag in some language, I don't know... :wink: )
I've attached the sld and the svg

Possibly when you activated the new code path it hasn't yet made it
into the version I'm trying?

Maybe your nightly is a little old? Not sure

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

(attachments)

statesHatched.pdf (101 KB)
burg.sld (1.09 KB)
burg02.svg

OK, I got the burg style working:

http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:archsites&styles=burg&bbox=589860.0,4914479.0,608355.0,4926490.0&width=512&height=332&srs=EPSG:26713&format=application/openlayers

and the PDF generates, but the flags don't look that great

http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:archsites&styles=burg&bbox=589860.0,4914479.0,608355.0,4926490.0&width=512&height=332&srs=EPSG:26713&format=application/pdf

so I think I need to get a fresher nightly to see the improvements. Hopefully that will take care of the missing hatches too.
Will let you know!

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Tuesday, February 09, 2010 10:07 AM
To: Freeman, Aleda (EEA)
Cc: Geoserver-devel
Subject: Re: [Geoserver-devel] Improvements in PDF and SVG rendering

Freeman, Aleda (EEA) ha scritto:

I tried to take a closer look at this in my 2.0.1 (nightly from
2/1/2010).

I can get the states shapefile and pophatch style to draw OK in
OpenLayers:
http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.
0&request=GetMap&layers=massgis:states&styles=pophatch&bbox=-124.731,2
4.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=applicat
ion/openlayers

but generating the PDF drops the hatching:

http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.
0&request=GetMap&layers=massgis:states&styles=pophatch&bbox=-124.731,2
4.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=applicat
ion/pdf

Odd? I've just tried with my local version and hatches are generated just fine? See attached PDF.

I can generate PDF from other layers with fills (but they are a
different kind of fill).

I'd try the flags example, but I'm not sure which shapefile and style
belong to that one. I have a flags.xml with no flags.sld in the
styles dir.

The flags style in my release configuration is actually called "burg"
(might mean flag in some language, I don't know... :wink: ) I've attached the sld and the svg

Possibly when you activated the new code path it hasn't yet made it
into the version I'm trying?

Maybe your nightly is a little old? Not sure

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

I updated to a GeoServer nightly downloaded just now.
But I still see pixelly flags, not as nice as your output.
This is probably an obvious question, but do I need to go to the GeoTools site and get an updated version of one ore more jars there as well?
(Hatches still disappear from PDF output too)

-----Original Message-----
From: geoserver-devel-bounces@lists.sourceforge.net [mailto:geoserver-devel-bounces@lists.sourceforge.net] On Behalf Of Freeman, Aleda (EEA)
Sent: Tuesday, February 09, 2010 10:40 AM
To: 'Andrea Aime'
Cc: Geoserver-devel
Subject: Re: [Geoserver-devel] Improvements in PDF and SVG rendering

OK, I got the burg style working:

http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:archsites&styles=burg&bbox=589860.0,4914479.0,608355.0,4926490.0&width=512&height=332&srs=EPSG:26713&format=application/openlayers

and the PDF generates, but the flags don't look that great

http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:archsites&styles=burg&bbox=589860.0,4914479.0,608355.0,4926490.0&width=512&height=332&srs=EPSG:26713&format=application/pdf

so I think I need to get a fresher nightly to see the improvements. Hopefully that will take care of the missing hatches too.
Will let you know!

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Tuesday, February 09, 2010 10:07 AM
To: Freeman, Aleda (EEA)
Cc: Geoserver-devel
Subject: Re: [Geoserver-devel] Improvements in PDF and SVG rendering

Freeman, Aleda (EEA) ha scritto:

I tried to take a closer look at this in my 2.0.1 (nightly from
2/1/2010).

I can get the states shapefile and pophatch style to draw OK in
OpenLayers:
http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.
0&request=GetMap&layers=massgis:states&styles=pophatch&bbox=-124.731,2
4.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=applicat
ion/openlayers

but generating the PDF drops the hatching:

http://maps.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.
0&request=GetMap&layers=massgis:states&styles=pophatch&bbox=-124.731,2
4.956,-66.97,49.372&width=780&height=330&srs=EPSG:4326&format=applicat
ion/pdf

Odd? I've just tried with my local version and hatches are generated just fine? See attached PDF.

I can generate PDF from other layers with fills (but they are a
different kind of fill).

I'd try the flags example, but I'm not sure which shapefile and style
belong to that one. I have a flags.xml with no flags.sld in the
styles dir.

The flags style in my release configuration is actually called "burg"
(might mean flag in some language, I don't know... :wink: ) I've attached the sld and the svg

Possibly when you activated the new code path it hasn't yet made it
into the version I'm trying?

Maybe your nightly is a little old? Not sure

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Freeman, Aleda (EEA) ha scritto:

I updated to a GeoServer nightly downloaded just now. But I still see
pixelly flags, not as nice as your output. This is probably an
obvious question, but do I need to go to the GeoTools site and get an
updated version of one ore more jars there as well? (Hatches still
disappear from PDF output too)

I've just downloaded this file:
http://gridlock.openplans.org/geoserver/2.0.x/geoserver-2.0.x-latest-bin.zip

Unpacked, run, tried to make PDF after wiping out my browser cache,
and they do contain vector flags and vector hatches.

I can see that on your server they don't. But I have no idea why...

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

I'm going for the .war: http://gridlock.openplans.org/geoserver/2.0.x/geoserver-2.0.x-latest-war.zip
Then I also grab a bunch of extensions from here: http://gridlock.openplans.org/geoserver/2.0.x/ext-latest/
(arcsde, charts, excel, geosearch, imagemap, restconfig).

Is it possible that that war and the zip are not in sync?

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Tuesday, February 09, 2010 12:54 PM
To: Freeman, Aleda (EEA)
Cc: Geoserver-devel
Subject: Re: [Geoserver-devel] Improvements in PDF and SVG rendering

Freeman, Aleda (EEA) ha scritto:

I updated to a GeoServer nightly downloaded just now. But I still see
pixelly flags, not as nice as your output. This is probably an obvious
question, but do I need to go to the GeoTools site and get an updated
version of one ore more jars there as well? (Hatches still disappear
from PDF output too)

I've just downloaded this file:
http://gridlock.openplans.org/geoserver/2.0.x/geoserver-2.0.x-latest-bin.zip

Unpacked, run, tried to make PDF after wiping out my browser cache, and they do contain vector flags and vector hatches.

I can see that on your server they don't. But I have no idea why...

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Freeman, Aleda (EEA) ha scritto:

I'm going for the .war: http://gridlock.openplans.org/geoserver/2.0.x/geoserver-2.0.x-latest-war.zip
Then I also grab a bunch of extensions from here: http://gridlock.openplans.org/geoserver/2.0.x/ext-latest/
(arcsde, charts, excel, geosearch, imagemap, restconfig).

I did not add the extensions, but I downloaded the war, deployed in tomcat 6.0.18, started, used a command line utility to grab the
output to make super sure the browser was not playing caching tricks
on me, the output is still vector.

I guess someone else will have to try out, I cannot reproduce.
Out of curiosity, are you sure your browser is not caching the PDF?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

I just cleared the cache, and I also tried in a different type of browser and changed the width and height and bounding box a little too...

My tomcat is 6.0.20.

Let me try some other variations, I can put the .war on my PC, try there.

What command line utility did you use? wget?

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Tuesday, February 09, 2010 1:17 PM
To: Freeman, Aleda (EEA)
Cc: Geoserver-devel
Subject: Re: [Geoserver-devel] Improvements in PDF and SVG rendering

Freeman, Aleda (EEA) ha scritto:

I'm going for the .war:
http://gridlock.openplans.org/geoserver/2.0.x/geoserver-2.0.x-latest-w
ar.zip Then I also grab a bunch of extensions from here:
http://gridlock.openplans.org/geoserver/2.0.x/ext-latest/
(arcsde, charts, excel, geosearch, imagemap, restconfig).

I did not add the extensions, but I downloaded the war, deployed in tomcat 6.0.18, started, used a command line utility to grab the output to make super sure the browser was not playing caching tricks on me, the output is still vector.

I guess someone else will have to try out, I cannot reproduce.
Out of curiosity, are you sure your browser is not caching the PDF?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Freeman, Aleda (EEA) ha scritto:

I just cleared the cache, and I also tried in a different type of
browser and changed the width and height and bounding box a little
too...

My tomcat is 6.0.20.

Let me try some other variations, I can put the .war on my PC, try
there.

What command line utility did you use? wget?

I used curl, but wget will do as well.

Maybe what is being cached is the GeoServer .war or .bin instead?
(that would happen if you're accessing the internet via a quite
  eagerly caching proxy)
What if you try with one that has a date in the name instead?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

I just tried a whole bunch of things, finally trying the simplest:

I downloaded this again: http://gridlock.openplans.org/geoserver/2.0.x/geoserver-2.0.x-latest-war.zip
I unzipped it.
I took the geoserver.war - without any modification or extensions - and I threw it into my XP PC's tomcat (5.5).
I tried various ways of asking for a PDF including via URL, via posting an XML request with wget and a via URL with wget. For example:

wget "http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:states&styles=pophatch&bbox=-123.73142200000001,24.955967,-66.969849,49.371735&width=780&height=330&srs=EPSG:4326&format=application/pdf" -O states_hatch2.pdf

I tried application/pdf and application/PDF
This is the third different server I've tried.
I tried renaming the war on the PC as well.
I upgraded my Adobe Reader to 9.3 just in case, but that didn't make a difference.

The PDFs always have no hatches (states + pophatch) and pixelly flags (archsites + burg)

I can't think of anything else to try right now and my brain is tired!

Should I ask on the users list and see if anyone else would be willing to try a nightly war?

On Tue, Feb 9, 2010 at 4:58 PM, Freeman, Aleda (EEA)
<Aleda.Freeman@anonymised.com> wrote:

I just tried a whole bunch of things, finally trying the simplest:

I downloaded this again: http://gridlock.openplans.org/geoserver/2.0.x/geoserver-2.0.x-latest-war.zip
I unzipped it.

....

Should I ask on the users list and see if anyone else would be willing to try a nightly war?

I just tried this on my Windows XP laptop - tomcat 5.5.23, nightly war
from above and I get no hatching and pixelated flags.

I'll try to run it on the Vista machine tomorrow if the snow is not too deep.

Ian

--
Ian Turton

(attachments)

states.pdf (58.2 KB)
archsites-2.pdf (34.7 KB)

I just tried that same war and no hatches at all.
Mac OS X Snow Leopard, Tomcat 6.0.20, JDK 1.6.0_17

Cheers,
Gabriel
Ian Turton wrote:

On Tue, Feb 9, 2010 at 4:58 PM, Freeman, Aleda (EEA)
<Aleda.Freeman@anonymised.com> wrote:

I just tried a whole bunch of things, finally trying the simplest:

I downloaded this again: http://gridlock.openplans.org/geoserver/2.0.x/geoserver-2.0.x-latest-war.zip
I unzipped it.

....

Should I ask on the users list and see if anyone else would be willing to try a nightly war?

I just tried this on my Windows XP laptop - tomcat 5.5.23, nightly war
from above and I get no hatching and pixelated flags.

I'll try to run it on the Vista machine tomorrow if the snow is not too deep.

Ian

------------------------------------------------------------------------

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev

------------------------------------------------------------------------

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Gabriel Roldan wrote:

I just tried that same war and no hatches at all.
Mac OS X Snow Leopard, Tomcat 6.0.20, JDK 1.6.0_17

Ok, I've tried it on a different computer and I see no
hatches either.
I have no idea why. My main computer must be haunted...
Anyways, I have the desktop where it works, the notebook
where it does not, I have to make some detective work to
find out where the difference is

Cheers
Andrea

Andrea Aime ha scritto:

Gabriel Roldan wrote:

I just tried that same war and no hatches at all.
Mac OS X Snow Leopard, Tomcat 6.0.20, JDK 1.6.0_17

Ok, I've tried it on a different computer and I see no
hatches either.
I have no idea why. My main computer must be haunted...
Anyways, I have the desktop where it works, the notebook
where it does not, I have to make some detective work to
find out where the difference is

Ok, found where the difference is. On my computer I had the
"advanced projection handling" flag enabled (something that I'll
have to document when I have a bit of time, basically it allows
to get a Google Maps like map, wrapped around the dateline),
and with that hatches worked.
But with it disabled, it did not, due to
http://jira.codehaus.org/browse/GEOT-2955

Fixed it, tomorrow's nightly should produce hatches on your
computer too :slight_smile:

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Does this fix will also make the SVG flags look smooth in PDF output?

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Tuesday, February 16, 2010 9:57 AM
To: Gabriel Roldan
Cc: Geoserver-devel; Ian Turton; Freeman, Aleda (EEA)
Subject: Re: [Geoserver-devel] Improvements in PDF and SVG rendering

Andrea Aime ha scritto:

Gabriel Roldan wrote:

I just tried that same war and no hatches at all.
Mac OS X Snow Leopard, Tomcat 6.0.20, JDK 1.6.0_17

Ok, I've tried it on a different computer and I see no hatches either.
I have no idea why. My main computer must be haunted...
Anyways, I have the desktop where it works, the notebook where it does
not, I have to make some detective work to find out where the
difference is

Ok, found where the difference is. On my computer I had the "advanced projection handling" flag enabled (something that I'll have to document when I have a bit of time, basically it allows to get a Google Maps like map, wrapped around the dateline), and with that hatches worked.
But with it disabled, it did not, due to
http://jira.codehaus.org/browse/GEOT-2955

Fixed it, tomorrow's nightly should produce hatches on your computer too :slight_smile:

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Freeman, Aleda (EEA) ha scritto:

Does this fix will also make the SVG flags look smooth in PDF output?

That is something I could not reproduce on any of my machines.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

I *DO* see the hatches in the PDF now using a nightly I just downloaded (2/17/2010)