Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapfishapp - print spec does not contain the WMS version #511

Closed
fvanderbiest opened this issue Dec 5, 2013 · 16 comments
Closed

mapfishapp - print spec does not contain the WMS version #511

fvanderbiest opened this issue Dec 5, 2013 · 16 comments

Comments

@fvanderbiest
Copy link
Member

By default, the mapfish print module assumes WMS = 1.1.1

If the server supports only 1.3.0, the layer is not printed (eg: the French IGN's geoportail WMS layers).

@ghost ghost assigned fvanderbiest Dec 5, 2013
@fvanderbiest
Copy link
Member Author

See mapfish-print issue mapfish/mapfish-print#97

@fvanderbiest
Copy link
Member Author

I've hacked the client side so that it sends the WMS version parameter in the print spec, but this is not enough to get the GeoPortail layers printed.

Here are the relevant mapfish-print logs:

2013-12-12 17:12:07 PDFUtils [DEBUG] loading image: http://wxs.ign.fr/wnmz6nt68k09rw3f5vwaflk4/geoportail/r/wms?BBOX=646971.1%2C6974654.0%2C651887.75%2C6978154.0&HEIGHT=88&WIDTH=124&CRS=EPSG%3A2154&EXCEPTIONS=INIMAGE&TRANSPARENT=true&map_resolution=91&VERSION=1.3.0&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A91&LAYERS=BDPARCEL_PYR-PNG_WLD&REQUEST=GetMap&STYLES=normal&SRS=EPSG%3A2154
2013-12-12 17:12:07 header [DEBUG] >> "GET /wnmz6nt68k09rw3f5vwaflk4/geoportail/r/wms?BBOX=646971.1%2C6974654.0%2C651887.75%2C6978154.0&HEIGHT=88&WIDTH=124&CRS=EPSG%3A2154&EXCEPTIONS=INIMAGE&TRANSPARENT=true&map_resolution=91&VERSION=1.3.0&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A91&LAYERS=BDPARCEL_PYR-PNG_WLD&REQUEST=GetMap&STYLES=normal&SRS=EPSG%3A2154 HTTP/1.1[\r][\n]"
2013-12-12 17:12:07 header [DEBUG] >> "Referer: dev.geopicardie.fr[\r][\n]"
2013-12-12 17:12:07 header [DEBUG] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
2013-12-12 17:12:07 header [DEBUG] >> "Host: wxs.ign.fr[\r][\n]"
2013-12-12 17:12:07 header [DEBUG] >> "[\r][\n]"
2013-12-12 17:12:07 header [DEBUG] << "HTTP/1.1 403 Forbidden[\r][\n]"
2013-12-12 17:12:07 header [DEBUG] << "Server: nginx[\r][\n]"
2013-12-12 17:12:07 header [DEBUG] << "Date: Thu, 12 Dec 2013 16:12:07 GMT[\r][\n]"
2013-12-12 17:12:07 content [DEBUG] << "<ExceptionReport><Exception exceptionCode="MissingRights">Wrong referer</Exception></ExceptionReport>"5:20 PM

Looks like the referer that is sent by the module is not accepted by the remote server, which expects a valid URL like http://dev.geopicardie.fr/ rather than simply dev.geopicardie.fr

@fvanderbiest
Copy link
Member Author

@fvanderbiest
Copy link
Member Author

To be merged into mapfish-print first: mapfish/mapfish-print#102

@fvanderbiest
Copy link
Member Author

See also geoext/geoext#96

@fvanderbiest
Copy link
Member Author

Fixed with 021623c

@jesseeichar
Copy link
Member

4:05 PM) Francois Van Der Biest: it uses the parameter SRS, which is obsolete for WMS 1.3
(4:44:12 PM) Francois Van Der Biest: replaced by CRS
(4:44:35 PM) Francois Van Der Biest: 2013-12-19 16:41:03 PDFUtils [DEBUG] loading image: http://wxs.ign.fr/wnmz6nt68k09rw3f5vwaflk4/geoportail/r/wms?BBOX=639625.1%2C6969406.5%2C659233.9%2C6983401.5&HEIGHT=88&WIDT
H=124&EXCEPTIONS=INIMAGE&TRANSPARENT=true&map_resolution=91&VERSION=1.3.0&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A91&LAYERS=BDPARCEL_PYR-PNG_WLD&REQUEST=GetMap&STY
LES=normal&SRS=EPSG%3A2154
(4:44:57 PM) Jesse Eichar: so we need to reoopen that ticket

@jesseeichar jesseeichar reopened this Dec 19, 2013
@jesseeichar
Copy link
Member

@ghost ghost assigned jesseeichar Jan 7, 2014
@jesseeichar
Copy link
Member

A new snapshot is online and should be tested.

@fvanderbiest
Copy link
Member Author

Nice, testing right away !
Thanks Jesse.

@fvanderbiest
Copy link
Member Author

Does not work for this layer http://dev.geopicardie.fr/mapfishapp/?wmc=ws%2Fwmc%2Fgeodoc5363636713352030312.wmc on this platform.

In the logs:

2014-01-13 10:51:13 PDFUtils [DEBUG] Server returned an error for http://wxs.ign.fr/wnmz6nt68k09rw3f5vwaflk4/geoportail/r/wms?BBOX=647436.06%2C6975235.5%2C649872.94%2C6976986.
5&HEIGHT=89&WIDTH=124&EXCEPTIONS=INIMAGE&TRANSPARENT=true&map_resolution=91&VERSION=1.3.0&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A91&LAYERS=BDPARCEL_PYR-PNG_WLD&REQUEST=GetMap&STYLES=normal&SRS=EPSG%3A2154: <ServiceExceptionReport xmlns="http://www.opengis.net/ogc">
<ServiceException code="MissingParameterValue" >
  Parametre CRS absent.
</ServiceException>
</ServiceExceptionReport>

-> Missing CRS parameter

Here is the print spec mentionning version = 1.3.0:

{"units":"m","srs":"EPSG:2154","layout":"A4 landscape","dpi":91,"outputFilename":"geopicardie_print_${yyyy-MM-dd_hhmmss}","layers":[{"minScaleDenominator":267.857,"maxScaleDenominator":559082000,"baseURL":"http://wxs.ign.fr/wnmz6nt68k09rw3f5vwaflk4/geoportail/r/wms?","opacity":1,"type":"WMS","version":"1.3.0","layers":["BDPARCEL_PYR-PNG_WLD"],"format":"image/png","styles":["normal"],"singleTile":false,"customParams":{"TRANSPARENT":"true","EXCEPTIONS":"INIMAGE"}}],"pages":[{"center":[648654.48375049,6976111.0070327],"scale":1066,"rotation":0,"mapTitle":"","mapComments":"","copyright":"Source : wxs.ign.fr","scaleLbl":"Échelle : ","dateLbl":"Date : ","showOverview":true,"showNorth":true,"showScalebar":true,"showDate":true,"showLegend":true,"projection":"Projection : RGF-93/Lambert 93"}],"legends":[{"name":"BDParcellaire WM 039 20120905","classes":[{"name":"","icons":["http://gpp3-wxs.ign.fr/wnmz6nt68k09rw3f5vwaflk4/static/LEGENDES/NOLEGEND.JPG?FORMAT=image%2Fpng&LEGEND_OPTIONS=forceLabels%3Aon%3BfontAntiAliasing%3Atrue"]}]}]}

@jesseeichar
Copy link
Member

I found one bug which will hopefully fix your issue and uploaded it to both maven snapshots directory and to dev.mapfish.org maven repository.

Please try again and let me know if it works.

@fvanderbiest
Copy link
Member Author

I'm using the latest print lib:

d542f541e49830eddf3ee2c0aa228f0d  .m2/repository/org/mapfish/print/print-lib/2.0-SNAPSHOT/print-lib-2.0-SNAPSHOT.jar
d542f541e49830eddf3ee2c0aa228f0d  /path/to/tomcat/webapps/mapfishapp-private/WEB-INF/lib/print-lib-2.0-SNAPSHOT.jar

but the request still uses the old SRS parameter :-(

@jesseeichar
Copy link
Member

That does not seem to be the latest version:

ac22d95ae4ea00a29492f9c4a00e636d

is the md5 of the latest. See:

https://oss.sonatype.org/content/repositories/snapshots/org/mapfish/print/print-servlet/2.0-SNAPSHOT/

for the latest.

@fvanderbiest
Copy link
Member Author

OK, now I get something printed, but not the area I expected.

Expected:
capture du 2014-01-14 11 22 25

Got:
capture du 2014-01-14 11 23 49

The server requests this URL
http://wxs.ign.fr/wnmz6nt68k09rw3f5vwaflk4/geoportail/r/wms?BBOX=648532.6562%2C648776.3437999999%2C6976023.565794693%2C6976198.434205307&HEIGHT=588&WIDTH=819&EXCEPTIONS=INIMAGE&TRANSPARENT=true&CRS=EPSG%3A2154&map_resolution=91&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A91&LAYERS=BDPARCEL_PYR-PNG_WLD&REQUEST=GetMap&STYLES=normal&version=1.3.0

with the following print spec:

{"units":"m","srs":"EPSG:2154","layout":"A4 landscape","dpi":91,"outputFilename":"geopicardie_print_${yyyy-MM-dd_hhmmss}","layers":[{"minScaleDenominator":267.857,"maxScaleDenominator":559082000,"baseURL":"http://wxs.ign.fr/wnmz6nt68k09rw3f5vwaflk4/geoportail/r/wms?","opacity":1,"type":"WMS","version":"1.3.0","layers":["BDPARCEL_PYR-PNG_WLD"],"format":"image/png","styles":["normal"],"singleTile":false,"customParams":{"TRANSPARENT":"true","EXCEPTIONS":"INIMAGE"}}],"pages":[{"center":[648654.48375049,6976111.0070327],"scale":1066,"rotation":0,"mapTitle":"","mapComments":"","copyright":"Source : wxs.ign.fr","scaleLbl":"Échelle : ","dateLbl":"Date : ","showOverview":true,"showNorth":true,"showScalebar":true,"showDate":true,"showLegend":true,"projection":"Projection : RGF-93/Lambert 93"}],"legends":[{"name":"BDParcellaire WM 039 20120905","classes":[{"name":"","icons":["http://gpp3-wxs.ign.fr/wnmz6nt68k09rw3f5vwaflk4/static/LEGENDES/NOLEGEND.JPG?FORMAT=image%2Fpng&LEGEND_OPTIONS=forceLabels%3Aon%3BfontAntiAliasing%3Atrue"]}]}]}

@fvanderbiest
Copy link
Member Author

Fixed with the latest print release. Kudos to @jesseeichar for fixing that (and also for adding many tests to the mapfish print module).

You may have to remove your /home/build_user/.m2/repository/org/mapfish/print folder before building again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants