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

MFP 2 requests/shows wrong TMS tiles #68

Closed
jonathan-wcc opened this issue Jun 11, 2013 · 43 comments
Closed

MFP 2 requests/shows wrong TMS tiles #68

jonathan-wcc opened this issue Jun 11, 2013 · 43 comments

Comments

@jonathan-wcc
Copy link

See attached. MFP seems to be showing the wrong tiles.

I've never seen this client side which is calling the same GeoServer, so I'm fairly sure GeoServer isn't the problem.

The request sent to MFP is:

{"units":"m","srs":"EPSG:27700","layout":"A4 Portrait","dpi":300,"mapTitle":"Printed with Compass","mapComment":"","mapFooter":"","layers":[{"baseURL":"http://compass:8082/geoserver/gwc/service/tms/","opacity":0.7,"singleTile":false,"type":"TMS","layer":"Warks_Full","maxExtent":[0,0,700000,1300000],"tileSize":[256,256],"resolutions":[2800,1400,700,350,175,84,42,21,11.2,5.6,2.8,1.4,0.7,0.35,0.14,0.07],"format":"png"}],"pages":[{"center":[430552.3,265431.9],"scale":75000,"rotation":0}]}

clipboard01

@jbjonesjr
Copy link
Contributor

Since I touched the TMS code last, I'll take a look at this. Do you have a link to a geoserver preview or something so I can see how it should look?

I take that back. It looks like this "compass" server is on an internal network. Do you have a publicly accessible tms layer that exhibits these same results?

@jonathan-wcc
Copy link
Author

Hi Jamie,
I'm afraid the GeoServer for this is internal only. You might have luck with a OSM TMS - https://wiki.openstreetmap.org/wiki/TMS
Although this was in EPSG:27700 - british national grid (which the OSM TMS' typically aren't). I don't know if maybe that'd be a possible cause.

@jbjonesjr
Copy link
Contributor

As an alternative, if you could give me the tiles that geoserver pulls when you do a preview of the map, that will give me some idea of the zoom level and tile location that it is supposed to be, and then i can see what mapfish pulls (even though it will fail to render them).

My hunch it is something to do with your coord system and how mapfish computes tile sizes, but i'll be able to explore more when i see your urls.

aka...
http://compass:8082/geoserver/gwc/service/tms/1.0/5.6/55/66.jpg
http://compass:8082/geoserver/gwc/service/tms/1.0/5.6/55/67.jpg
http://compass:8082/geoserver/gwc/service/tms/1.0/5.6/56/66.jpg
.......

@jonathan-wcc
Copy link
Author

Hopefully this is what you want. This is the complete DEBUG level log from mapfish for the given request.

2013-06-12 14:15:56,703 DEBUG [org.mapfish.print.servlet.BaseMapServlet] - Generating PDF for spec={"units":"m","srs":"EPSG:27700","layout":"A4 Portrait","dpi":300,"mapTitle":"Printed with Compass","mapComment":"","mapFooter":"","layers":[{"baseURL":"http://compass:8082/geoserver/gwc/service/tms/","opacity":0.7,"singleTile":false,"type":"TMS","layer":"Warks_Full","maxExtent":[0,0,700000,1300000],"tileSize":[256,256],"resolutions":[2800,1400,700,350,175,84,42,21,11.2,5.6,2.8,1.4,0.7,0.35,0.14,0.07],"format":"png"}],"pages":[{"center":[430552.3,265431.9],"scale":75000,"rotation":0}]}
2013-06-12 14:15:56,703 INFO [org.mapfish.print.servlet.BaseMapServlet] - Loading configuration file: C:\Tomcat_Compass\bin..\instances\print_instance\webapps\print2.0\config.yaml
2013-06-12 14:15:56,703 WARN [org.ho.yaml.CustomBeanWrapper] - Config: unknown field 'metaData' with value '{author=COMPASS, title=${mapTitle}, keywords=Web Map, COMPASS, Warwickshire, Warwickshire County Council, subject=${mapComment}, supportLegacyReader=false, creator=MapFish print module}'
2013-06-12 14:15:56,719 WARN [org.mapfish.print.output.OutputFactory] - OutputFormatFactory org.mapfish.print.output.FileCachingJaiMosaicOutputFactory is disabled: TIFF not supported by ImageIO
2013-06-12 14:15:56,719 INFO [org.mapfish.print.output.OutputFactory] - OutputFormat chosen for pdf is PdfOutputFactory
2013-06-12 14:15:56,719 DEBUG [org.mapfish.print.servlet.BaseMapServlet] - Using 'C:\Tomcat_Compass\instances\print_instance\work\Catalina\localhost\print2.0' as temporary directory
2013-06-12 14:15:56,719 WARN [org.mapfish.print.output.OutputFactory] - OutputFormatFactory org.mapfish.print.output.FileCachingJaiMosaicOutputFactory is disabled: TIFF not supported by ImageIO
2013-06-12 14:15:56,719 INFO [org.mapfish.print.output.OutputFactory] - OutputFormat chosen for pdf is PdfOutputFactory
2013-06-12 14:15:56,719 INFO [org.mapfish.print.output.PdfOutputFactory] - Starting 'PDF Creation' at 2013-06-12 14:15:56
2013-06-12 14:15:56,734 DEBUG [org.mapfish.print.config.InetHostMatcher] - Address not in the authorizeds: compass/10.76.14.138
2013-06-12 14:15:56,750 DEBUG [org.mapfish.print.config.Config] - URI [http://compass:8082/geoserver/gwc/service/tms/] accepted by: DnsHostMatcher{host='compass'}
2013-06-12 14:15:56,750 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,750 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.pvalsecc.concurrent.OrderedResultsExecutor] - Runner [tilesReader] started
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.map.readers.HTTPMapReader] - Default min geo x and y calculation used
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/47.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/47.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/47.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/48.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/47.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/48.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/48.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/47.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/47.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/48.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/48.png
2013-06-12 14:15:56,766 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/48.png
2013-06-12 14:15:56,781 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/48.png
2013-06-12 14:15:56,797 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/47.png
2013-06-12 14:15:56,797 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/49.png
2013-06-12 14:15:56,812 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/48.png
2013-06-12 14:15:56,812 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/49.png
2013-06-12 14:15:56,828 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/48.png
2013-06-12 14:15:56,844 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/49.png
2013-06-12 14:15:56,844 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/47.png
2013-06-12 14:15:56,859 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/49.png
2013-06-12 14:15:56,859 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/47.png
2013-06-12 14:15:56,875 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/49.png
2013-06-12 14:15:56,875 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/48.png
2013-06-12 14:15:56,890 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/49.png
2013-06-12 14:15:56,890 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/48.png
2013-06-12 14:15:56,906 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/49.png
2013-06-12 14:15:56,906 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/48.png
2013-06-12 14:15:56,922 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/49.png
2013-06-12 14:15:56,922 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/49.png
2013-06-12 14:15:56,937 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/49.png
2013-06-12 14:15:56,953 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/49.png
2013-06-12 14:15:56,953 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/49.png
2013-06-12 14:15:56,968 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/49.png
2013-06-12 14:15:56,968 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/49.png
2013-06-12 14:15:56,984 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/49.png
2013-06-12 14:15:56,984 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/49.png
2013-06-12 14:15:57,000 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/49.png
2013-06-12 14:15:57,000 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/49.png
2013-06-12 14:15:57,015 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/49.png
2013-06-12 14:15:57,015 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/50.png
2013-06-12 14:15:57,031 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/49.png
2013-06-12 14:15:57,031 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/50.png
2013-06-12 14:15:57,046 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/49.png
2013-06-12 14:15:57,062 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/50.png
2013-06-12 14:15:57,062 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/49.png
2013-06-12 14:15:57,078 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/50.png
2013-06-12 14:15:57,078 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/49.png
2013-06-12 14:15:57,093 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/50.png
2013-06-12 14:15:57,093 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/49.png
2013-06-12 14:15:57,109 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/50.png
2013-06-12 14:15:57,109 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/50.png
2013-06-12 14:15:57,124 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/50.png
2013-06-12 14:15:57,124 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/50.png
2013-06-12 14:15:57,140 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/50.png
2013-06-12 14:15:57,140 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/50.png
2013-06-12 14:15:57,156 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/50.png
2013-06-12 14:15:57,156 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/50.png
2013-06-12 14:15:57,171 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/50.png
2013-06-12 14:15:57,171 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/50.png
2013-06-12 14:15:57,187 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/50.png
2013-06-12 14:15:57,202 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/50.png
2013-06-12 14:15:57,202 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/50.png
2013-06-12 14:15:57,218 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/50.png
2013-06-12 14:15:57,218 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/50.png
2013-06-12 14:15:57,234 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/51.png
2013-06-12 14:15:57,234 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/50.png
2013-06-12 14:15:57,249 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/51.png
2013-06-12 14:15:57,249 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/51.png
2013-06-12 14:15:57,265 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/51.png
2013-06-12 14:15:57,265 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/50.png
2013-06-12 14:15:57,280 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/50.png
2013-06-12 14:15:57,280 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/51.png
2013-06-12 14:15:57,296 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/50.png
2013-06-12 14:15:57,296 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/51.png
2013-06-12 14:15:57,312 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/51.png
2013-06-12 14:15:57,327 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/51.png
2013-06-12 14:15:57,327 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/51.png
2013-06-12 14:15:57,343 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/80/51.png
2013-06-12 14:15:57,358 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/51.png
2013-06-12 14:15:57,374 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/51.png
2013-06-12 14:15:59,776 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/78/47.png
2013-06-12 14:15:59,792 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/79/47.png
2013-06-12 14:15:59,792 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/07/81/47.png
2013-06-12 14:15:59,839 DEBUG [org.mapfish.print.config.InetHostMatcher] - Address not in the authorizeds: compass/10.76.14.138
2013-06-12 14:15:59,839 DEBUG [org.mapfish.print.config.Config] - URI [http://compass:8082/geoserver/gwc/service/tms/] accepted by: DnsHostMatcher{host='compass'}
2013-06-12 14:15:59,839 DEBUG [org.mapfish.print.map.readers.HTTPMapReader] - Default min geo x and y calculation used
2013-06-12 14:15:59,839 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/03/4/2.png
2013-06-12 14:15:59,839 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/03/5/2.png
2013-06-12 14:15:59,839 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/03/4/3.png
2013-06-12 14:15:59,839 DEBUG [org.mapfish.print.PDFUtils] - loading image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/03/5/3.png
2013-06-12 14:15:59,870 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/03/5/3.png
2013-06-12 14:15:59,870 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/03/4/2.png
2013-06-12 14:15:59,886 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/03/5/2.png
2013-06-12 14:15:59,886 DEBUG [org.mapfish.print.PDFUtils] - loaded image: http://compass:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/03/4/3.png
2013-06-12 14:16:00,073 INFO [org.mapfish.print.output.PdfOutputFactory] - Finished 'PDF Creation' after 3354 ms
2013-06-12 14:16:00,073 INFO [org.mapfish.print.servlet.BaseMapServlet] - Loading configuration file: C:\Tomcat_Compass\bin..\instances\print_instance\webapps\print2.0\config.yaml
2013-06-12 14:16:00,073 WARN [org.ho.yaml.CustomBeanWrapper] - Config: unknown field 'metaData' with value '{author=COMPASS, title=${mapTitle}, keywords=Web Map, COMPASS, Warwickshire, Warwickshire County Council, subject=${mapComment}, supportLegacyReader=false, creator=MapFish print module}'
2013-06-12 14:16:00,400 DEBUG [org.mapfish.print.servlet.BaseMapServlet] - Deleting PDF file: mapfish-print4781891713765351423.pdf.printout

@jonathan-wcc
Copy link
Author

Commentary - It's clearly requesting the same tile several times, and without even waiting for a timeout.
I.e. /07/81/51.png - appears 4 times.
/07/81/50 - appears 8 times (so requested four times)!

Oh, and as it may be relevant, my YAML has this:

#These two settings let the print server open lots of connections to the source dataset.
globalParallelFetches: 12
perHostParallelFetches: 4

#Connection timeouts for connecting to the map servers in ms
connectionTimeout: 60000
socketTimeout: 360000

@jonathan-wcc
Copy link
Author

Something I've just encountered that I think is related (or maybe it's by design?). Often when I request a map at one scale, MFP often (but not always) prints TMS from the next zoomed in level (WMS is still treated properly though as far as I can tell).

So I send this request to MFP:
{"units":"m","srs":"EPSG:27700","layout":"A3 Landscape","dpi":300,"mapTitle":"","mapComment":"","mapFooter":"","layers":[{"baseURL":"http://wppgeog3:8082/geoserver/gwc/service/tms/","opacity":0.7,"singleTile":false,"type":"TMS","layer":"Warks_Full","maxExtent":[0,0,700000,1300000],"tileSize":[256,256],"resolutions":[2800,1400,700,350,175,84,42,21,11.2,5.6,2.8,1.4,0.7,0.35,0.14,0.07],"format":"png"},{"baseURL":"http://wppgeog3:8082/geoserver/ows","opacity":1,"singleTile":false,"type":"WMS","layers":["OS_MM_TOPOGRAPHIC_LINE"],"format":"image/png","styles":[""],"customParams":{"TRANSPARENT":true}}],"pages":[{"center":[429013.7,265094],"scale":10000,"rotation":0}],"legends":[]}

But the TMS requests are all going to level 11, which is 1:5,000:
http://wppgeog3:8082/geoserver/gwc/service/tms/1.0.0/Warks_Full/11/1201/743.png

The problem being - we have different maps at different resolutions, so the PDF can have a completely different map from the one desired/requested.

If this isn't the same issue, it can be moved to another ticket.

@jbjonesjr
Copy link
Contributor

Jonathan, can you share similar otuput from using the geoserver preview layer tool (maybe via openlayers?) You should be able to get the tile requests via "developer" tools available in a browser (I use firebug in firefox to capture individual tile/url requests, similar exists for Chrome, etc). That can help us see what tiles are correct to be requested.

While clearly mapfish is over-requesting tiles, I want to see as close to apples to apples as I can.

@jonathan-wcc
Copy link
Author

Hi Jamie,
Sorry I meant to do this yesterday but got distracted. Below are the logs from GeoServer for the same location/zoom/layer when made from an OpenLayers application as was used in the original screenshot/comment.

/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/49.png HTTP/1.1" 200 138076
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/49.png HTTP/1.1" 200 127770
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/48.png HTTP/1.1" 200 93470
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/48.png HTTP/1.1" 200 93988
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/50.png HTTP/1.1" 200 106743
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/50.png HTTP/1.1" 200 108338
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/49.png HTTP/1.1" 200 87163
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/49.png HTTP/1.1" 200 114218
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/48.png HTTP/1.1" 200 97729
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/50.png HTTP/1.1" 200 102846
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/48.png HTTP/1.1" 200 93779
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/47.png HTTP/1.1" 200 97558
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/50.png HTTP/1.1" 200 104447
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/47.png HTTP/1.1" 200 96866
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/47.png HTTP/1.1" 200 85081
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/49.png HTTP/1.1" 200 92816
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/47.png HTTP/1.1" 200 109555
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/48.png HTTP/1.1" 200 86558
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/50.png HTTP/1.1" 200 89675
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/46.png HTTP/1.1" 200 84670
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/46.png HTTP/1.1" 200 99178
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/47.png HTTP/1.1" 200 72320
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/46.png HTTP/1.1" 200 101836
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/46.png HTTP/1.1" 200 91275
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/46.png HTTP/1.1" 200 98418

@jbjonesjr
Copy link
Contributor

Jonathan, awesome. Thanks!
On Jun 13, 2013 5:38 AM, "jonathan-wcc" notifications@github.com wrote:

Hi Jamie,
Sorry I meant to do this yesterday but got distracted. Below are the logs
from GeoServer for the same location/zoom/layer when made from an
OpenLayers application as was used in the original screenshot/comment.

/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/49.png HTTP/1.1" 200
138076
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/49.png HTTP/1.1" 200
127770
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/48.png HTTP/1.1" 200
93470
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/48.png HTTP/1.1" 200
93988
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/50.png HTTP/1.1" 200
106743
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/50.png HTTP/1.1" 200
108338
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/49.png HTTP/1.1" 200
87163
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/49.png HTTP/1.1" 200
114218
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/48.png HTTP/1.1" 200
97729
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/50.png HTTP/1.1" 200
102846
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/48.png HTTP/1.1" 200
93779
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/47.png HTTP/1.1" 200
97558
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/50.png HTTP/1.1" 200
104447
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/47.png HTTP/1.1" 200
96866
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/47.png HTTP/1.1" 200
85081
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/49.png HTTP/1.1" 200
92816
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/47.png HTTP/1.1" 200
109555
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/48.png HTTP/1.1" 200
86558
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/50.png HTTP/1.1" 200
89675
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/80/46.png HTTP/1.1" 200
84670
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/79/46.png HTTP/1.1" 200
99178
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/47.png HTTP/1.1" 200
72320
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/81/46.png HTTP/1.1" 200
101836
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/78/46.png HTTP/1.1" 200
91275
/geoserver/gwc/service/tms/1.0.0/Warks_Full/7/82/46.png HTTP/1.1" 200 98418


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-19381650
.

@jbjonesjr
Copy link
Contributor

Jonathon, I'm back on this and exploring what is up. After looking through the notes in this issue, playing with the code, and examining your map more closely, I can't imagine the problem is ACTUALLY with the tms tiles and how they are being requested.

One of the things that your image (in the first comment) didn't show is how big an actual title is.

  1. Can you provide a screenshot/single image of a tile with "Coventry" in it?

At this point, my hunch is that there is a problem with how mapfish is Assembling the map from it's fetched titles. I can't imagine this is a problem due to the number of parallel fetches you are doing though.

  1. If I provide you a branch of the code to test with, would you be able to fetch, build, and test, or will I have to generate jar files for your use?

and

  1. What time zone are you located in and when is best to work with you on this? As much as we can go back and forth, only doing 1 round per day will be a little tough if I can't reproduce this myself (which I haven't been able to yet). Having a period where we can rapidly debug would help us get this solved.

@jonathan-wcc
Copy link
Author

Hi Jamie,
Thanks for your reply. I've recently rebuilt this layer in GeoServer for other reasons - the source datasets are all constructed differently now (geotiffs without overviews only used for a single level), but MFP still prints it in the exact same way.

To address your questions:

1) A tile is 256*256. I've attached several of them, including a couple from Coventry.

2) Sorry, building code isn't something I've ever done before; I stay well away from that. Pre-compiled jar files I can use.

3) I'm in the UK, so GMT+1.

If you're willing to sign an Ordnance Survey contractors license (it basically says you won't use the data for anything other than this - the Ordnance Survey are very license heavy), I can send you this portion of the raw-data and you can investigate it locally. That might be much easier for you, especially given item (2).

Thanks,
Jonathan
07 79 50
07 79 49
07 80 51
07 81 50
07 81 51

@jesseeichar
Copy link

What version of mapfish-print are you using?

You can find all published version here:

https://oss.sonatype.org/index.html#nexus-search;quick~mapfish-print

If you are using 1.2 could you try 2.0-SNAPSHOT. And vice-versa?

Jesse

On Mon, Jun 24, 2013 at 11:12 AM, jonathan-wcc notifications@github.comwrote:

Hi Jamie,
Thanks for your reply. I've recently rebuilt this layer in GeoServer for
other reasons - the source datasets are all constructed differently now
(geotiffs without overviews only used for a single level), but MFP still
prints it in the exact same way.

To address your questions:

  1. A tile is 256*256. I've attached several of them, including a couple from Coventry.

  2. Sorry, building code isn't something I've ever done before; I stay well away from that. Pre-compiled jar files I can use.

  3. I'm in the UK, so GMT+1.

If you're willing to sign an Ordnance Survey contractors license (it basically says you won't use the data for anything other than this - the Ordnance Survey are very license heavy), I can send you this portion of the raw-data and you can investigate it locally. That might be much easier for you, especially given item (2).

Thanks,
Jonathan
[image: 07 79 50]https://f.cloud.github.com/assets/3763600/694367/27e3b606-dcae-11e2-9dff-132f80199965.png
[image: 07 79 49]https://f.cloud.github.com/assets/3763600/694368/28d58864-dcae-11e2-8d1f-3465bbd9b74c.png
[image: 07 80 51]https://f.cloud.github.com/assets/3763600/694369/2c9da8be-dcae-11e2-9c85-095feac2f4a9.png
[image: 07 81 50]https://f.cloud.github.com/assets/3763600/694370/2fa1bc4e-dcae-11e2-8960-94c5c5354039.png
[image: 07 81 51]https://f.cloud.github.com/assets/3763600/694372/3233c862-dcae-11e2-870a-adbefe452000.png


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-19896318
.

@jonathan-wcc
Copy link
Author

Hi Jesse,
I'm using the Jun 4th servlet version from:
https://oss.sonatype.org/content/repositories/snapshots/org/mapfish/print/print-servlet/2.0-SNAPSHOT/

I also have a 1.2 install on the same tomcat instance. I've just tested that and it exhibits the exact same problem.

@jesseeichar
Copy link

Well the good news is we didn't break anything :-). Bad news is that this
makes it harder to debug.

On Mon, Jun 24, 2013 at 2:06 PM, jonathan-wcc notifications@github.comwrote:

Hi Jesse,
I'm using the Jun 4th servlet version from:

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

I also have a 1.2 install on the same tomcat instance. I've just tested
that and it exhibits the exact same problem.


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-19902836
.

@jbjonesjr
Copy link
Contributor

Jonathan, no problem, I can email you the jars/wars i want you to run. No big deal.

Let's wait on signing anything, we may be able to get pretty far without it.

Thanks for the tiles, they are a big help. I'm working on translating my own wms to a tms so i can test locally with my own data as well.

Now that I see your tiles, I see how your original map actually has 4 or 5 tiles in a row that are correct, and then 1 that is a duplicate. This lends credence to the thoughts that mapfish may be rounding incorrectly...

Still doesn't explain the duplicative fetches, but that's another issue (and why i'm working to stand up my own tms).

@jbjonesjr
Copy link
Contributor

And for reference, I'm US:East Coast, so GMT-4

@jonathan-wcc
Copy link
Author

Hey Jamie, That explains why you've popped up now then. :-)

Zip me the files when you want me to test them and I'll see what I can do. I'll probably be around until 1pm your time today.

@jbjonesjr
Copy link
Contributor

the other thing that would be helpful would be your full app/config yaml
file that you are using. It's probably easier to post it as a gist instead
of within a comment as well, it helps to maintain formatting better. If
you've never posted a gist before, just go to https://gist.github.com/ and
start pasting. They have yaml support and let's your add the metadata,
controls that you want. Makes sharing snippets easy.

And as you can probably tell from my posting habits, mapfish is in my
prework routine, so I typically review things and maybe do a little bit of
work between GMT1000 and 1200 each day.


Jamie Jones

jjones@alumni.virginia.edu , jbjonesjr@gmail.com

On Mon, Jun 24, 2013 at 8:50 AM, jonathan-wcc notifications@github.comwrote:

Hey Jamie, That explains why you've popped up now then. :-)

Zip me the files when you want me to test them and I'll see what I can do.
I'll probably be around until 1pm your time today.


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-19904714
.

@jonathan-wcc
Copy link
Author

Hmm, their gist stuff doesn't seem to work in Opera. But created it in FF instead:

https://gist.github.com/jonathan-wcc/a2c1f56f63ea11930a04

Hope that helps.

@jbjonesjr
Copy link
Contributor

awesome, thanks!

@justb4
Copy link

justb4 commented Jul 18, 2013

Hi, I also appear to have a TMS alignment problem when upgrading from MFP snapshot 13 june 2012 to the 4 june 2013 snapshot. Tiles seem to be out of place towards diagonally (e.g. south east). Strangely enough it was actually an issue I solved as a GeoExt patch by copying per-layer resolutions into the print preview (only happened there). But now I see misalignment both in print preview and direct print. All resources are online so for trying/inspecting:
Image
misaligned-tms-mfprint

Example:
http://lib.heron-mc.org/heron/latest/examples/printdialog
(TMS basemap, add WMS layers by enabling "BAG" layers from overlays)

YAML: http://kademo.nl/print/config.28992.yaml

Heron issue: https://code.google.com/p/geoext-viewer/issues/detail?id=191
GeoExt issue geoext/geoext#71
GeoExt patch used in example: https://code.google.com/p/geoext-viewer/source/browse/trunk/heron/lib/override-geoext.js (line 330)

EPSG is 28992 (Dutch projection, meters).

@justb4
Copy link

justb4 commented Jul 22, 2013

One question: is Proj.4 or a similar library called somehwhere inside MFP? In the past I have seen similar positioning issues where the EPSG:28992 string was incomplete (missing toWGS84 datum shift parameter).

@jesseeichar
Copy link

Geotools is used in some cases but I am not sure if that applies here...
Just to be clear. The issue is in the resulting PDF or in the javascript
preview?

On Mon, Jul 22, 2013 at 7:13 AM, Just van den Broecke <
notifications@github.com> wrote:

One question: is Proj.4 or a similar library called somehwhere inside MFP?
In the past I have seen similar positioning issues where the EPSG:28992
string was incomplete (missing toWGS84 datum shift parameter).


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-21346574
.

@justb4
Copy link

justb4 commented Jul 31, 2013

Yes the issue is in the PDF, not the js preview.

@justb4
Copy link

justb4 commented Oct 6, 2013

Still found the issue in MFP SNAPSHOT 2.0 of 29-aug-2013. I am almost sure it has to do with TMS in my case.
At first I thought it may be an outdated EPSG DB from GeoTools. Tried upgrading from 8.6 to 9.3 (you may update the gradlew build file) but to no avail. Also why should there be reprojections? All coordinates are in meters.

Now I am suspecting more and more a subtle interaction with TMS calculations like tileOrigin. In my case EPSG:28992, GeoExt does not encode a tileOrigin for TMS in GeoExt PrintProvider (maybe should try that). So the tileOrigin is calculated from maxExtent it seems from TileCacheInfo.java.. My maxExtent value is -285401.920, 22598.080, 595401.920, 903401.920 (yes lower left is negative). Maybe that could influence some calculations. Remember: I did not have this problem in MFP snapshot 13 june 2012, but when upgrading to recent versions.

I could trigger some errors when trying to print when zoomed out, see below.

With this create command:

{"units":"m","srs":"EPSG:28992","layout":"A4 Landscape","dpi":75,"mapTitle":"My Title - Direct Print","mapComment":"This is a simple map directly printed.","mapFooter":"","layers":[{"baseURL":"http://openbasiskaart.nl/mapcache/tms","opacity":1,"singleTile":false,"type":"TMS","layer":"osm@rd","maxExtent":[-285401.92,22598.08,595401.92,903401.92],"tileSize":[256,256],"resolutions":[3440.64,1720.32,860.16,430.08,215.04,107.52,53.76,26.88,13.44,6.72,3.36,1.68,0.84,0.42],"format":"png"},{"baseURL":"http://geodata.nationaalgeoregister.nl/natura2000/wms?","opacity":1,"singleTile":true,"type":"WMS","layers":["natura2000"],"format":"image/png","styles":[""],"customParams":{"TRANSPARENT":true}}],"pages":[{"center":[193742,468919],"scale":2500000,"rotation":0}]}

Map resolutions are:
3440.640, 1720.320, 860.160, 430.080, 215.040, 107.520, 53.760, 26.880, 13.440, 6.720, 3.360, 1.680, 0.840, 0.420, 0.210, 0.105, 0.0525 but the TMS layer/server has
3440.640, 1720.320, 860.160, 430.080, 215.040, 107.520, 53.760, 26.880, 13.440, 6.720, 3.360, 1.680, 0.840, 0.420 (OpenLayers will then blow-up images).

I see this output in the log, errors for tile requests.

2013-10-06 18:01:55,862 [TP-Processor5] INFO h.print.servlet.BaseMapServlet - Loading configuration file: /var/www/kademo.nl/webapps/print/config.28992.yaml
2013-10-06 18:01:55,864 [TP-Processor5] WARN org.ho.yaml.CustomBeanWrapper - AddressHostMatcher: unknown field 'host' with value '0.0.0.0'
2013-10-06 18:01:55,865 [TP-Processor5] WARN org.ho.yaml.CustomBeanWrapper - Config: unknown field 'metaData' with value '{author=Heron Devs, title=${mapTitle}, keywords=Web Map, Heron, PDOK, subject=${mapComment}, supportLegacyReader=false, creator=MapFish print module}'
2013-10-06 18:01:56,102 [TP-Processor11] DEBUG h.print.servlet.BaseMapServlet - Deleting PDF file: mapfish-print4052529749744109449.pdf.printout
2013-10-06 18:01:56,103 [TP-Processor11] DEBUG h.print.servlet.BaseMapServlet - Deleting PDF file: mapfish-print6014011530197663261.pdf.printout
2013-10-06 18:01:56,134 [TP-Processor11] DEBUG h.print.servlet.BaseMapServlet - Generating PDF for spec={"units":"m","srs":"EPSG:28992","layout":"A4 Landscape","dpi":75,"mapTitle":"My Title - Direct Print","mapComment":"This is a simple map directly printed.","mapFooter":"","layers":[{"baseURL":"http://openbasiskaart.nl/mapcache/tms","opacity":1,"singleTile":false,"type":"TMS","layer":"osm@rd","maxExtent":[-285401.92,22598.08,595401.92,903401.92],"tileSize":[256,256],"resolutions":[3440.64,1720.32,860.16,430.08,215.04,107.52,53.76,26.88,13.44,6.72,3.36,1.68,0.84,0.42],"format":"png"},{"baseURL":"http://geodata.nationaalgeoregister.nl/natura2000/wms?","opacity":1,"singleTile":true,"type":"WMS","layers":["natura2000"],"format":"image/png","styles":[""],"customParams":{"TRANSPARENT":true}}],"pages":[{"center":[193742,468919],"scale":2500000,"rotation":0}]}

2013-10-06 18:01:56,161 [TP-Processor11] INFO h.print.servlet.BaseMapServlet - Loading configuration file: /var/www/kademo.nl/webapps/print/config.28992.yaml
2013-10-06 18:01:56,163 [TP-Processor11] WARN org.ho.yaml.CustomBeanWrapper - AddressHostMatcher: unknown field 'host' with value '0.0.0.0'
2013-10-06 18:01:56,163 [TP-Processor11] WARN org.ho.yaml.CustomBeanWrapper - Config: unknown field 'metaData' with value '{author=Heron Devs, title=${mapTitle}, keywords=Web Map, Heron, PDOK, subject=${mapComment}, supportLegacyReader=false, creator=MapFish print module}'
2013-10-06 18:01:56,194 [TP-Processor11] INFO ish.print.output.OutputFactory - OutputFormat chosen for pdf is PdfOutputFactory
2013-10-06 18:01:56,194 [TP-Processor11] DEBUG h.print.servlet.BaseMapServlet - Using '/opt/apache/tomcat-6.0.29/work/Catalina/kademo.nl/print' as temporary directory
2013-10-06 18:01:56,195 [TP-Processor11] INFO ish.print.output.OutputFactory - OutputFormat chosen for pdf is PdfOutputFactory
2013-10-06 18:01:56,195 [TP-Processor11] INFO .print.output.PdfOutputFactory - Starting 'PDF Creation' at 2013-10-06 18:01:56
2013-10-06 18:01:56,216 [TP-Processor11] DEBUG h.print.config.InetHostMatcher - Address not in the authorizeds: openbasiskaart.nl/144.76.60.100
2013-10-06 18:01:56,217 [TP-Processor11] DEBUG rg.mapfish.print.config.Config - URI [http://openbasiskaart.nl/mapcache/tms] accepted by: AddressHostMatcher{ip='null', mask='0.0.0.0'}
2013-10-06 18:01:56,255 [TP-Processor11] DEBUG h.print.config.InetHostMatcher - Address not in the authorizeds: geodata.nationaalgeoregister.nl/145.77.103.123
2013-10-06 18:01:56,255 [TP-Processor11] DEBUG rg.mapfish.print.config.Config - URI [http://geodata.nationaalgeoregister.nl/natura2000/wms?] accepted by: AddressHostMatcher{ip='null', mask='0.0.0.0'}
2013-10-06 18:01:56,255 [tilesReader0] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,256 [tilesReader1] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,256 [tilesReader2] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,256 [tilesReader3] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,256 [tilesReader4] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,257 [tilesReader5] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,257 [tilesReader6] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,257 [tilesReader7] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,257 [tilesReader8] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,258 [tilesReader9] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,258 [tilesReader10] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,258 [tilesReader11] DEBUG current.OrderedResultsExecutor - Runner [tilesReader] started
2013-10-06 18:01:56,258 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Default min geo x and y calculation used
2013-10-06 18:01:56,259 [tilesReader1] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/0/1.png
2013-10-06 18:01:56,259 [tilesReader2] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/1/1.png
2013-10-06 18:01:56,259 [tilesReader8] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/2/1.png
2013-10-06 18:01:56,259 [tilesReader0] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/3/1.png
2013-10-06 18:01:56,259 [tilesReader11] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/0/2.png
2013-10-06 18:01:56,259 [tilesReader10] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/1/2.png
2013-10-06 18:01:56,261 [tilesReader9] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/2/2.png
2013-10-06 18:01:56,261 [tilesReader7] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/3/2.png
2013-10-06 18:01:56,261 [tilesReader6] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/0/3.png
2013-10-06 18:01:56,261 [tilesReader5] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/1/3.png
2013-10-06 18:01:56,262 [tilesReader4] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/2/3.png
2013-10-06 18:01:56,262 [tilesReader3] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/3/3.png
2013-10-06 18:01:56,267 [tilesReader1] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/0/1.png
2013-10-06 18:01:56,267 [tilesReader9] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/2/2.png
2013-10-06 18:01:56,268 [tilesReader9] DEBUG org.mapfish.print.PDFUtils - loading image: http://geodata.nationaalgeoregister.nl/natura2000/wms?BBOX=-103914.25%2C229912.06%2C491398.25%2C707925.94&HEIGHT=565&WIDTH=703&TRANSPARENT=true&map_resolution=75&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A75&LAYERS=natura2000&REQUEST=GetMap&STYLES=&SRS=EPSG%3A28992
2013-10-06 18:01:56,269 [tilesReader2] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/1/1.png
2013-10-06 18:01:56,270 [tilesReader8] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/2/1.png
2013-10-06 18:01:56,273 [tilesReader4] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/2/3.png
2013-10-06 18:01:56,273 [tilesReader3] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/3/3.png
2013-10-06 18:01:56,274 [tilesReader5] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/1/3.png
2013-10-06 18:01:56,275 [tilesReader6] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/0/3.png
2013-10-06 18:01:56,276 [tilesReader7] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/3/2.png
2013-10-06 18:01:56,276 [tilesReader10] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/1/2.png
2013-10-06 18:01:56,277 [tilesReader0] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/3/1.png
2013-10-06 18:01:56,277 [tilesReader11] DEBUG org.mapfish.print.PDFUtils - loaded image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/02/0/2.png
2013-10-06 18:01:56,968 [tilesReader9] DEBUG org.mapfish.print.PDFUtils - loaded image: http://geodata.nationaalgeoregister.nl/natura2000/wms?BBOX=-103914.25%2C229912.06%2C491398.25%2C707925.94&HEIGHT=565&WIDTH=703&TRANSPARENT=true&map_resolution=75&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A75&LAYERS=natura2000&REQUEST=GetMap&STYLES=&SRS=EPSG%3A28992
2013-10-06 18:01:57,074 [TP-Processor11] DEBUG h.print.config.InetHostMatcher - Address not in the authorizeds: openbasiskaart.nl/144.76.60.100
2013-10-06 18:01:57,074 [TP-Processor11] DEBUG rg.mapfish.print.config.Config - URI [http://openbasiskaart.nl/mapcache/tms] accepted by: AddressHostMatcher{ip='null', mask='0.0.0.0'}
2013-10-06 18:01:57,074 [TP-Processor11] DEBUG h.print.config.InetHostMatcher - Address not in the authorizeds: geodata.nationaalgeoregister.nl/145.77.103.123
2013-10-06 18:01:57,074 [TP-Processor11] DEBUG rg.mapfish.print.config.Config - URI [http://geodata.nationaalgeoregister.nl/natura2000/wms?] accepted by: AddressHostMatcher{ip='null', mask='0.0.0.0'}
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Default min geo x and y calculation used
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-2/-2.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-1/-2.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/-2.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/1/-2.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/2/-2.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-2/-1.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-1/-1.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/-1.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/1/-1.png
2013-10-06 18:01:57,075 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/2/-1.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-2/0.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-1/0.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/0.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/1/0.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/2/0.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-2/1.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-1/1.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/1/1.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/2/1.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-2/2.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/-1/2.png
2013-10-06 18:01:57,076 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/2.png
2013-10-06 18:01:57,077 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/1/2.png
2013-10-06 18:01:57,077 [TP-Processor11] DEBUG rint.map.readers.HTTPMapReader - Tile out of bounds: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/2/2.png
2013-10-06 18:01:57,077 [tilesReader2] DEBUG org.mapfish.print.PDFUtils - loading image: http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/1.png
2013-10-06 18:01:57,077 [tilesReader5] DEBUG org.mapfish.print.PDFUtils - loading image: http://geodata.nationaalgeoregister.nl/natura2000/wms?BBOX=-1592195.5%2C-1317018.8%2C1979679.5%2C2254856.8&HEIGHT=116&WIDTH=116&TRANSPARENT=true&map_resolution=75&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A75&LAYERS=natura2000&REQUEST=GetMap&STYLES=&SRS=EPSG%3A28992
2013-10-06 18:01:57,081 [tilesReader2] DEBUG org.mapfish.print.PDFUtils - Server returned an error for http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/1.png:
2013-10-06 18:01:57,081 [tilesReader2] ERROR org.mapfish.print.PDFUtils - Server returned an error for http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/1.png: Error (status=404) while reading the image from http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/1.png: Not Found
2013-10-06 18:01:57,081 [tilesReader2] WARN .mapfish.print.PDFCustomBlocks - Error while adding a PDF element
java.io.IOException: Error (status=404) while reading the image from http://openbasiskaart.nl/mapcache/tms/1.0.0/osm@rd/00/0/1.png: Not Found
at org.mapfish.print.PDFUtils.handleImageLoadError(PDFUtils.java:339)
at org.mapfish.print.PDFUtils.loadImageFromUrl(PDFUtils.java:323)
at org.mapfish.print.PDFUtils.getImageDirect(PDFUtils.java:175)
at org.mapfish.print.PDFUtils.getImage(PDFUtils.java:95)
at org.mapfish.print.PDFUtils.getImage(PDFUtils.java:79)
at org.mapfish.print.map.renderers.BitmapTileRenderer$1.readTile(BitmapTileRenderer.java:73)
at org.mapfish.print.map.MapTileTask.process(MapTileTask.java:41)
at org.mapfish.print.map.MapTileTask.process(MapTileTask.java:33)
at org.pvalsecc.concurrent.OrderedResultsExecutor$Runner.run(OrderedResultsExecutor.java:180)
at java.lang.Thread.run(Thread.java:662)
2013-10-06 18:01:57,554 [tilesReader5] DEBUG org.mapfish.print.PDFUtils - loaded image: http://geodata.nationaalgeoregister.nl/natura2000/wms?BBOX=-1592195.5%2C-1317018.8%2C1979679.5%2C2254856.8&HEIGHT=116&WIDTH=116&TRANSPARENT=true&map_resolution=75&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&format_options=dpi%3A75&LAYERS=natura2000&REQUEST=GetMap&STYLES=&SRS=EPSG%3A28992
2013-10-06 18:01:57,559 [TP-Processor11] DEBUG .mapfish.print.PDFCustomBlocks - Added an annotation for errors
2013-10-06 18:01:57,564 [TP-Processor11] INFO .print.output.PdfOutputFactory - Finished 'PDF Creation' after 1369 ms
2013-10-06 18:01:57,639 [TP-Processor16] INFO h.print.servlet.BaseMapServlet - Loading configuration file: /var/www/kademo.nl/webapps/print/config.28992.yaml
2013-10-06 18:01:57,641 [TP-Processor16] WARN org.ho.yaml.CustomBeanWrapper - AddressHostMatcher: unknown field 'host' with value '0.0.0.0'
2013-10-06 18:01:57,642 [TP-Processor16] WARN org.ho.yaml.CustomBeanWrapper - Config: unknown field 'metaData' with value '{author=Heron Devs, title=${mapTitle}, keywords=Web Map, Heron, PDOK, subject=${mapComment}, supportLegacyReader=false, creator=MapFish print module}'

@justb4
Copy link

justb4 commented Oct 6, 2013

And a print of the last request.There is at any zoomlevel a constant percentage in wrong offset for the TMS tiles to the south-east.

heronprint-2013-10-06t180157

@justb4
Copy link

justb4 commented Oct 6, 2013

Yes, definitely related to "tileOrigin":

If I post the same request, but with tileOrigin-field for the TMS layer the output is correct/aligned:

{"units":"m","srs":"EPSG:28992","layout":"A4 Landscape","dpi":75,"mapTitle":"My Title - Direct Print","mapComment":"This is a simple map directly printed.","mapFooter":"","layers":[{"baseURL":"http://openbasiskaart.nl/mapcache/tms","opacity":1,"singleTile":false,"type":"TMS","layer":"osm@rd","tileOrigin": {"x":-285401.920,"y":22598.080},"maxExtent":[-285401.92,22598.08,595401.92,903401.92],"tileSize":[256,256],"resolutions":[3440.64,1720.32,860.16,430.08,215.04,107.52,53.76,26.88,13.44,6.72,3.36,1.68,0.84,0.42],"format":"png"},{"baseURL":"http://geodata.nationaalgeoregister.nl/natura2000/wms?","opacity":1,"singleTile":true,"type":"WMS","layers":["natura2000"],"format":"image/png","styles":[""],"customParams":{"TRANSPARENT":true}}],"pages":[{"center":[193742,468919],"scale":2500000,"rotation":0}]}

See output below. IMHO sending tileOrigin would be redundant if maxExtent is already sent.
But looking at the code and commit 587b736 it looks like tileOrigin is set to 0,0 when not sent, while in previous versions the lowerleft of maxExtent was taken. .....hold on...But looking at the TMS-spec indeed the tileOrigin may be independent of the maxExtent! So all in all, the fix should be made in the client viz GeoExt PrintProvider.js! As an inbetween MFP could default to lowerleft of maxExtent if tileOrigin is not sent by the client....

heronprint-2013-10-06t205002

@jbjonesjr
Copy link
Contributor

Few thoughts:

  1. Ideally, the client should send the tileOrigin that it is using, and not-rely on some intelligent default being used, since the spec does not adequately describe such a default.
  2. Is 0/0 a good default to use?
  3. After re-reading the tms spec, I wonder if the statement "The is the lower-left corner of the 0/0 tile" means that the code should read the extent/bounding box of the entire layer, and set the origin default at whatever is in the lower-left corner? This is in contrast to what openlayers does, but then again, the spec is unclear.

I guess i'm now getting confused as to what the tile Origin is specifying. I thought it was the "anchor" point of a tile for it to start drawing with. That means origin 0/0 anchored at the bottom left, vs 0/1 which would anchor at the top left, etc.

The spec is talking about "lower left OF THE 0,0 tile", so maybe this is not the correct implementation?

I also don't know if this patch/change to geoext/layer format would fix the issue that @jonathan-wcc was originally seeing (it seems he has duplicated tiles).

I had stopped working on this bug because i was unable to debug deep enough into the code to inspect the issue, but that has since changed in the last few months, so i can start this up again (Continue to plug the use Intellij for development/ide needs: ide bug fixed from caused by gradle bug ).

@jesseeichar
Copy link

I seems to me that since OpenLayers is one of the main users of this api so
our defaults should probably align with openlayers.

I am busy with a major Geonetwork code change but will help out with this
when that is done.

Jesse

On Mon, Oct 7, 2013 at 6:35 PM, Jamie Jones notifications@github.comwrote:

Few thoughts:

  1. Ideally, the client should send the tileOrigin that it is using, and
    not-rely on some intelligent default being used, since the spec does not
    adequately describe such a default.
  2. Is 0/0 a good default to use?
  3. After re-reading the tms spechttp://wiki.osgeo.org/wiki/Tile_Map_Service_Specification,
    I wonder if the statement "The is the lower-left corner of the 0/0 tile"
    means that the code should read the extent/bounding box of the entire
    layer, and set the origin default at whatever is in the lower-left corner?
    This is in contrast to what openlayers does, but then again, the spec is
    unclear.

I guess i'm now getting confused as to what the tile Origin is specifying.
I thought it was the "anchor" point of a tile for it to start drawing
with. That means origin 0/0 anchored at the bottom left, vs 0/1 which would
anchor at the top left, etc.

The spec is talking about "lower left OF THE 0,0 tile", so maybe this is
not the correct implementation?

I also don't know if this patch/change to geoext/layer format would fix
the issue that @jonathan-wcc https://github.com/jonathan-wcc was
originally seeing (it seems he has duplicated tiles).

I had stopped working on this bug because i was unable to debug deep
enough into the code to inspect the issue, but that has since changed in
the last few months, so i can start this up again (Continue to plug the use
Intellij for development/ide needs: ide bughttp://youtrack.jetbrains.com/issue/IDEA-107959fixed from caused
by gradle bughttp://forums.gradle.org/gradle/topics/enhance_tooling_api_to_ease_debugging_of_tests_run_via_gradle?rfm=1).


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-25823945
.

@justb4
Copy link

justb4 commented Oct 15, 2013

The main problem is that there is now a subtle change in the MFP protocol (having tileOrigin mandatory when not 0,0) which will affect all client-implementations using TMS schema's with a non-0.0 origin. Most of these will use GeoExt 1.1, or have derived their code from GeoExt PrintProvider.js. I would still suggest to make tileOrigin in the MFP protocol the lowerleft of maxExtent if not provided. This will save the world from lots of confusion and frustration...

IMHO TMS is not really a spec like an OGC-spec: it is more of an ad-hoc recommendation from OSGeo without any versioning or official backing standards body. So implementations are most likely adapting themselves for the sake of interworking where the spec is vague or multi-interpretable rather than try to follow it to the letter. Even OGC-specs may be vague, viz the format of WMS GetFeatureInfo content or GML SRS encoding. Especially GeoServer, OpenLayers, GeoExt and family will try to be as flexible as possible in those cases (e.g. ESRI will not), all for the sake of interworking and the success of FOSS component integration.

btw OpenLayers API also takes that default (maxExtent), see API: http://dev.openlayers.org/docs/files/OpenLayers/Layer/TMS-js.html#OpenLayers.Layer.TMS.tileOrigin

    APIProperty: tileOrigin
     {<OpenLayers.LonLat>} Optional origin for aligning the grid of tiles.
       If provided, requests for tiles at all resolutions will be aligned
      with this location (no tiles shall overlap this location).  If
      not provided, the grid of tiles will be aligned with the bottom-left
      corner of the map's <maxExtent>.  Default is ``null``.

and TMS.js code:

    if (!this.tileOrigin) { 
        this.tileOrigin = new OpenLayers.LonLat(this.map.maxExtent.left,
                                            this.map.maxExtent.bottom);
    }                                       

@jonathan-wcc
Copy link
Author

Further to the originally reported issue, we now have a publically available service. As such, you can easily replicate it using this:

{"units":"m","srs":"EPSG:27700","layout":"A4 Portrait","dpi":300,"mapTitle":"Printed with Compass","mapComment":"","mapFooter":"","layers":[{"baseURL":"http://maps.warwickshire.gov.uk/gs/gwc/service/tms/","opacity":0.7,"singleTile":false,"type":"TMS","layer":"z_OS_Raster_Basemap","maxExtent":[0,0,700000,1300000],"tileSize":[256,256],"resolutions":[2800,1400,700,350,175,84,42,21,11.2,5.6,2.8,1.4,0.7,0.35,0.14,0.07],"format":"png"}],"pages":[{"center":[430552.3,265431.9],"scale":75000,"rotation":0}]}

Hopefully that should make it easier to fix as a local install of MFP should be able to access that, thus aiding testing.

@jesseeichar
Copy link

I looked at this a bit yesterday and am working on it today. I consider
this a blocking issue before I can release the 2.0 next month.

Jesse

On Tue, Dec 17, 2013 at 4:34 PM, jonathan-wcc notifications@github.comwrote:

Further to the originally reported issue, we now have a publically
available service. As such, you can easily replicate it using this:

{"units":"m","srs":"EPSG:27700","layout":"A4 Portrait","dpi":300,"mapTitle":"Printed with Compass","mapComment":"","mapFooter":"","layers":[{"baseURL":"http://maps.warwickshire.gov.uk/gs/gwc/service/tms/","opacity":0.7,"singleTile":false,"type":"TMS","layer":"z_OS_Raster_Basemap","maxExtent":[0,0,700000,1300000],"tileSize":[256,256],"resolutions":[2800,1400,700,350,175,84,42,21,11.2,5.6,2.8,1.4,0.7,0.35,0.14,0.07],"format":"png"}],"pages":[{"center":[430552.3,265431.9],"scale":75000,"rotation":0}]}

Hopefully that should make it easier to fix as a local install of MFP
should be able to access that, thus aiding testing.


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-30760594
.

@jonathan-wcc
Copy link
Author

Hi Jesse, thanks. Feel free to get back to me if you want me to try something or have a question etc.
Cheers,
Jonathan

@justb4
Copy link

justb4 commented Dec 19, 2013

Hi Jesse, Same for me. GeoExt is a major user of MFP. As it stands now the latest 1.1 version will be broken w.r.t. TMS-layers with non-0,0 tileOrigin (see my comments above), since PrintProvider.js in GeoExt 1.1 will not encode tileOrigin. As GeoExt 1.1 is not expected to be upgraded soon, we apply this override in Heron:

       "TMS": function (layer) {
            var enc = this.encoders.layers.TileCache.call(this, layer);
            return Ext.apply(enc, {
                type: 'TMS',
                format: layer.type
            });
        },
        "TileCache": function (layer) {
            var enc = this.encoders.layers.HTTPRequest.call(this, layer);
            // Heron fix JvdB 6 oct 2013
            // Add tileOrigin otherwise MapFish Print will be confused.
            // https://github.com/mapfish/mapfish-print/issues/68
            var maxExtent = layer.maxExtent.toArray();
            var tileOriginX = layer.tileOrigin ? layer.tileOrigin.lon : maxExtent[0];
            var tileOriginY = layer.tileOrigin ? layer.tileOrigin.lat : maxExtent[1];
            return Ext.apply(enc, {
                type: 'TileCache',
                layer: layer.layername,
                maxExtent: maxExtent,
                tileOrigin: {x: tileOriginX, y: tileOriginY},
                tileSize: [layer.tileSize.w, layer.tileSize.h],
                extension: layer.extension,
                resolutions: layer.serverResolutions || layer.resolutions
            });
        },

@jesseeichar
Copy link

Hi Just,

I made a change so that by default the origin will be obtained from the
maxExtent but also added a couple of parameters to the config.yaml

?tmsDefaultOriginX: 0.0f MF_V2.0
?tmsDefaultOriginY: 0.0f MF_V2.0

which allows one to declare what defaults you want.

By default they are null so the maxExtent is used.

Jesse

On Thu, Dec 19, 2013 at 12:18 PM, Just van den Broecke <
notifications@github.com> wrote:

Hi Jesse, Same for me. GeoExt is a major user of MFP. As it stands now the
latest 1.1 version will be broken w.r.t. TMS-layers with non-0,0 tileOrigin
(see my comments above), since PrintProvider.js in GeoExt 1.1 will not
encode tileOrigin. As GeoExt 1.1 is not expected to be upgraded soon, we
apply this override in Heron:

   "TMS": function (layer) {
        var enc = this.encoders.layers.TileCache.call(this, layer);
        return Ext.apply(enc, {
            type: 'TMS',
            format: layer.type
        });
    },
    "TileCache": function (layer) {
        var enc = this.encoders.layers.HTTPRequest.call(this, layer);
        // Heron fix JvdB 6 oct 2013
        // Add tileOrigin otherwise MapFish Print will be confused.
        // https://github.com/mapfish/mapfish-print/issues/68
        var maxExtent = layer.maxExtent.toArray();
        var tileOriginX = layer.tileOrigin ? layer.tileOrigin.lon : maxExtent[0];
        var tileOriginY = layer.tileOrigin ? layer.tileOrigin.lat : maxExtent[1];
        return Ext.apply(enc, {
            type: 'TileCache',
            layer: layer.layername,
            maxExtent: maxExtent,
            tileOrigin: {x: tileOriginX, y: tileOriginY},
            tileSize: [layer.tileSize.w, layer.tileSize.h],
            extension: layer.extension,
            resolutions: layer.serverResolutions || layer.resolutions
        });
    },


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-30921473
.

@justb4
Copy link

justb4 commented Dec 19, 2013

Hi Jesse, That sounds good! I guess then that per-layer tileOrigin also still works as currently? Just

@jesseeichar
Copy link

Exactly. you can either specify the tileOrigin in the spec json or if it
is not present you can configure a default in the config.yaml, or if there
is not default in config.yaml it is read from maxExtent. THus the default
behaviour is the same as in 1.1.

On Thu, Dec 19, 2013 at 2:00 PM, Just van den Broecke <
notifications@github.com> wrote:

Hi Jesse, That sounds good! I guess then that per-layer tileOrigin also
still works as currently? Just


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-30926511
.

jesseeichar pushed a commit that referenced this issue Dec 19, 2013
#68

Several changes in a single commit:

1. Fix for MFP 2 requests/shows wrong TMS tiles.  It was a problem with TileCacheLayerInfo.getNearestResolution which would in certain cases choose the wrong resolution.  This was caused by rounding errors rounding the value down below the needed value.
2. Fix logging in standalone application so the verbose parameter works again
3.  Update all tests to junit 4.11
4.  Add parameter to config.yaml to control the default origin for TMS.
@jesseeichar
Copy link

I have committed a fix for this. It is one of the changes in:

c15848a

I am going to close this ticket but please test and if there is still a problem then reopen this for more investigation.

@jesseeichar
Copy link

In order to test you can use the new binary on:

https://oss.sonatype.org/content/repositories/snapshots

@jonathan-wcc
Copy link
Author

Where abouts on there? I see a large number of directories, but none are obviously related to this project.

@jonathan-wcc
Copy link
Author

Ah ok. That one.
One thing I notice in this snapshot is that there are two extra directories in /web-inf/classes:
/production/
/test/

I suspect these shouldn't be there.

On the issue of the fix itself - the good news it is seems to have worked. So thanks!

The bad news is that it seems to have introduced issue - #103

@jesseeichar
Copy link

I was afraid that might happen. There were no unit tests to catch me.
Thanks to the work I am doing this will be the last time I have to worry
about it. Lets continue this conversation on 103. It should only take me
a short time to fix it now that I am familiar with the code.

Jesse

On Thu, Dec 19, 2013 at 6:18 PM, jonathan-wcc notifications@github.comwrote:

Ah ok. That one.
One thing I notice in this snapshot is that there are two extra
directories in /web-inf/classes:
/production/
/test/

I suspect these shouldn't be there.

On the issue of the fix itself - the good news it is seems to have worked.
So thanks!

The bad news is that it seems to have introduced issue - #103#103


Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-30947520
.

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

No branches or pull requests

4 participants