This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.
···
On 16 December 2013 13:26, Arunava Dey <thelastray@anonymised.com> wrote:
Hello,
I have tried with your sample file, but all in vain. I was wondering, how can I print only a single icon of any layer? I have passed the following json spec, hoping it will print only a single icon. Notice I have mentioned ICON=geomorphology%2C1. However it still prints the whole icon set, and consequently it is too small to read.
http://localhost:8080/geoserver/pdf/print.pdf?spec=
{
“units”: “degrees”,
“srs”: “EPSG:4326”,
“layout”: “A4 Landscape”,
“dpi”: 150,
“mapTitle”: “MP GeoPortal Map”,
“comment”: “This map is printed using MP GeoPortal.”,
“resourcesUrl”: “http://localhost/mpgeoportal/img”,
“layers”: [
{
“baseURL”: “http://localhost:8080/geoserver/mpgeoportal/wms”,
“opacity”: 1,
“singleTile”: true,
“type”: “WMS”,
“layers”: [“mpgeoportal:sagar_geomorphology”],
“format”: “image/png”,
“styles”: [“”],
“customParams”: {
“TRANSPARENT”: true
},
“legend”: true
}
],
“pages”: [{
“center”: [
78.800618943104,
23.871591352951
],
“scale”: 100000,
“rotation”: 0
}
],
“legends”: [
{
“name”: “Geomorphology”,
“classes”: [
{
“name” : “Bench”,
“iconBeforeName”: true,
“icon”: “http:///localhost:8080/geoserver/mpgeoportal/wms?version=1.1.1&transpaparent=true&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&ICON=geomorphology%2C1&FORMAT=image%2Fpng&MODE=legendicon”
}
]
}
]
}
Thanking you,
Arunava Dey
On Mon, Dec 16, 2013 at 4:59 PM, Jonathan Moules <jonathanmoules@anonymised.com> wrote:
Hi Arunava
This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.
The attached config.yaml works well for me and contains the legend element.
Note that I don’t use the GeoServer plugin but instead use the stand alone MapFish Print servelet - it’s considerably newer than the version used by the plugin so you may want to try that if you can’t resolve the issue.
Regards,
Jonathan
On 16 December 2013 05:44, Arunava Dey <thelastray@anonymised.com> wrote:
Hello,
I have already tried with iconMaxHeight and/or iconMaxWidth 0. But still getting the same result. This is my config file:
lastPage:
pageSize: A4
landscape: true
rotation: true
items:
- !columns
config:
borderWidth: 1
cells:
- borderColor: black
padding: 267
absoluteX: 20
absoluteY: 566
width: 800
height: 500
items:
- !text
text: ‘’
#Legend
- !columns
condition: legends
absoluteX: 24
absoluteY: 560
width: 250
config:
borderWidth: 1
cells:
- borderWidth: 1
borderColor: #555555
padding: 5
items:
- !legends
iconMaxWidth: 0
iconMaxHeight: 0
maxWidth: 250
layerFont: Helvetica
layerFontSize: 8
classSpace: 2
classIndentation: 5
classFont: Helvetica
classFontSize: 8
backgroundColor: white
inline:false
Thanking you,
Arunava Dey
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don’t have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
On Fri, Dec 13, 2013 at 7:40 PM, Mauro Bartolomeoli <mauro.bartolomeoli@anonymised.com> wrote:
Hi Arunava,
try to change the iconMaxWidth and/or iconMaxHeight to 0 (zero) in your config.yaml, in the legend block.
Mauro
2013/12/13 Arunava Dey <thelastray@anonymised.com>
Hello,
I know this weird… Atlast got it to print the layer legend, but its too small to read. I am not getting what is going wrong. This what I am using:
{
“units”: “degrees”,
“srs”: “EPSG:4326”,
“layout”: “A4 Landscape”,
“dpi”: 150,
“mapTitle”: “MP GeoPortal Map”,
“comment”: “This map is printed using MP GeoPortal.”,
“resourcesUrl”: “http://localhost/mpgeoportal/img”,
“layers”: [
{
“baseURL”: “http://localhost:8080/geoserver/mpgeoportal/wms”,
“opacity”: 1,
“singleTile”: true,
“type”: “WMS”,
“layers”: [“mpgeoportal:sagar_geomorphology”],
“format”: “image/png”,
“styles”: [“”],
“customParams”: {
“TRANSPARENT”: true
}
}
],
“pages”: [{
“center”: [
78.800618943104,
23.871591352951
],
“scale”: 100000,
“rotation”: 0
}
],
“legends”: [
{
“name”: “Geomorphology”,
“classes”: [
{
“name” : “”,
“iconBeforeName”: true,
“icon”: “http%3A%2F%2Framtech-311%3A8080%2Fgeoserver%2Fmpgeoportal%2Fwms%3Fversion%3D1.3.0%26transpaparent%3Dtrue%26REQUEST%3DGetLegendGraphic%26EXCEPTIONS%3Dapplication%2Fvnd.ogc.se_xml%26ICON%3Dgeomorphology%26FORMAT%3Dimage%2Fpng%26MODE%3Dlegendicon%26layer%3Dmpgeoportal%3Asagar_geomorphology”
}
]
}
]
}
And this is what it is producing.
@Mauro Bartolomeoli My spec file is based on the following page https://github.com/mapfish/mapfish-print/issues/96. I am not very much sure about its contents. I have also checked with “icons” with square brackets. It is still giving the same result. Can you provide me a sample spec file with legend definition for geoserver.
Thanking you,
Arunava Dey
–
Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
On Fri, Dec 13, 2013 at 1:39 PM, Mauro Bartolomeoli <mauro.bartolomeoli@anonymised.com> wrote:
–
Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
2013/12/13 Arunava Dey <thelastray@anonymised.com>
Hello,
I am still struggling to print my map layer legends. Following is my spec file, encoded URL for icons as suggested by Mauro:
{
“units” : “degrees”,
“srs” : “EPSG:4326”,
“layout” : “A4 Landscape”,
“dpi” : 150,
“mapTitle” : “MP GeoPortal Map”,
“comment” : “This map is printed using MP GeoPortal.”,
“resourcesUrl” : “http://localhost/mpgeoportal/img”,
“layers” : [{
“baseURL” : “http://localhost:8080/geoserver/mpgeoportal/wms”,
“opacity” : 1,
“singleTile” : true,
“type” : “WMS”,
“layers” : [“mpgeoportal:sagar_geomorphology”],
“format” : “image/png”,
“styles” : [“”],
“customParams” : {
“TRANSPARENT” : true
}
}
],
“pages” : [{
“center” : [78.800618943104, 23.871591352951],
“scale” : 100000,
“rotation” : 0
}
],
“legends” : [{
“name” : “Geomorphology”,
“classes” : [{
“name” : “”,
“icons” : “http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fmpgeoportal%2Fwms%3Fversion%3D1.3.0%26TRANSPARENT%3DTRUE%26SERVICE%3DWMS%26REQUEST%3DGetLegendGraphic%26EXCEPTIONS%3Dapplication%2Fvnd.ogc.se_xml%26LAYER%3Dmpgeompgeoportal%3Asagar_geomorphology%26FORMAT%3Dimage%2Fpng”
}
]
}
]
}
I can see one more inconsistency: from the documentation examples (http://www.mapfish.org/doc/print/protocol.html#print-pdf) the “icons” property should be an array, so it should be written “icons”: [“…”].
I am having doubts about the name and icons block in legend definition. Is it for individual classes in my layer or it is for the entire layer? For example, for my geomorphology layer, I have, say 15 classes, namely g1, g2, g3 and so on. What should be the content for name block within classes. I am leaving it blank. Also the URL in icons gives the legend graphic for the entire layer (g1, g2…).
It depends on how you organize your layers/styles. From what I have seen, you have a single GetLegendGraphic call that is giving you back a set of icons (one for each Rule in the style) in a single image. In this use case you have one layer (Geomorphology) and only one class for the entire layer (rules are managed server side by GeoServer). This class has only one icon and no name (the rule names are also contained in the icons image).
Mapfish-print allows you also to build your legend client side, by having a layer with many classes, each with a label on a side (before or after the icons) and a set of icons, each with its url.
Regards,
Mauro Bartolomeoli