{"action":"created","issue":{"url":"https://api.github.com/repos/nemac/landsatfact-data/issues/45","labels_url":"https://api.github.com/repos/nemac/landsatfact-data/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/nemac/landsatfact-data/issues/45/comments","events_url":"https://api.github.com/repos/nemac/landsatfact-data/issues/45/events","html_url":"https://github.com/nemac/landsatfact-data/issues/45","id":94148545,"number":45,"title":"Create GeoPDF for Custom Request","user":{"login":"mwhutchi","id":2244093,"avatar_url":"https://avatars.githubusercontent.com/u/2244093?v=3","gravatar_id":"","url":"https://api.github.com/users/mwhutchi","html_url":"https://github.com/mwhutchi","followers_url":"https://api.github.com/users/mwhutchi/followers","following_url":"https://api.github.com/users/mwhutchi/following{/other_user}","gists_url":"https://api.github.com/users/mwhutchi/gists{/gist_id}","starred_url":"https://api.github.com/users/mwhutchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwhutchi/subscriptions","organizations_url":"https://api.github.com/users/mwhutchi/orgs","repos_url":"https://api.github.com/users/mwhutchi/repos","events_url":"https://api.github.com/users/mwhutchi/events{/privacy}","received_events_url":"https://api.github.com/users/mwhutchi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-09T20:47:08Z","updated_at":"2015-07-09T20:56:57Z","closed_at":null,"body":"The task is to create a GeoPDF that contains the change products for the custom request with the map zoomed to and showing the user's AOI and on top of the symbolized change products. The map should also be in a map template that has a map title, product dates, scale bar, north arrow, etc."},"comment":{"url":"https://api.github.com/repos/nemac/landsatfact-data/issues/comments/120141957","html_url":"https://github.com/nemac/landsatfact-data/issues/45#issuecomment-120141957","issue_url":"https://api.github.com/repos/nemac/landsatfact-data/issues/45","id":120141957,"user":{"login":"mwhutchi","id":2244093,"avatar_url":"https://avatars.githubusercontent.com/u/2244093?v=3","gravatar_id":"","url":"https://api.github.com/users/mwhutchi","html_url":"https://github.com/mwhutchi","followers_url":"https://api.github.com/users/mwhutchi/followers","following_url":"https://api.github.com/users/mwhutchi/following{/other_user}","gists_url":"https://api.github.com/users/mwhutchi/gists{/gist_id}","starred_url":"https://api.github.com/users/mwhutchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwhutchi/subscriptions","organizations_url":"https://api.github.com/users/mwhutchi/orgs","repos_url":"https://api.github.com/users/mwhutchi/repos","events_url":"https://api.github.com/users/mwhutchi/events{/privacy}","received_events_url":"https://api.github.com/users/mwhutchi/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T20:56:57Z","updated_at":"2015-07-09T20:56:57Z","body":"William is helping me to protoype this to figure out the best method.\r\n\r\nWe first tried the GDAL/pyPDF method, which takes a geopdf that GDAL creates and merges it using pyPDF. We found the problem with this is that pyPDF does not retain its geospatial component. We tried merging it different orders and the output was non-spatial each time. \r\n\r\nBut, after digging in to GDAL some more we found there are more advanced options for creating a geoPDF with gdal_translate: http://www.gdal.org/frmt_pdf.html\r\n\r\nWe found that GDAL can take a WMS as an input, and each layer in the pdf can be specified via separate xml files that each refer to a WMS layer. So, this retains the product symbology via the WMS. \r\n\r\nUpon further research, GDAL has the option of creating a \"collar\" around the map in the pdf where you can insert images (north arrow, scalebar, etc.) and text on the pdf. We tested this and have a working prototype. The next steps are to refine the map, insert the user's AOI and zoom the map to the AOI extent. Then we need to think about how this would be done programmatically.\r\n\r\nHere is an example command we used:\r\n     gdal_translate -of PDF -a_srs epsg:4326 layer.xml map_out_base.pdf -projwin -94.21875 37.1337890625 -89.47265625 34.4970703125 -co \"LAYER_NAME=layer\" -co \"EXTRA_RASTERS=layer2.xml,layer3.xml,layer4.xml\"  -co \"EXTRA_RASTERS_LAYER_NAME=layer2,layer3,layer4\" -co \"EXTRA_IMAGES=mapscale.PNG,0,-10,1,northarrow.png, 600,50,.5,test_title.png, 450, 550, .5\" -co \"EXTRA_LAYER_NAME=mapscale,northarrow,test_title\"\r\n\r\nand here is an example WMS layer in the xml:\r\n     <GDAL_WMS>\r\n\t<Service name=\"WMS\">\r\n\t<Version>1.1.1</Version>\r\n\t<ServerUrl>http://landsatfact-data-dev.nemac.org/lsflayers</ServerUrl>\r\n\t<SRS>EPSG:4326</SRS>\r\n\t<ImageFormat>image/png</ImageFormat>\r\n\t<Layers>B7DIFF-raster-threshold&amp;TIME=2015-06-29</Layers>\r\n\t</Service>\r\n\t<DataWindow>\r\n\t<UpperLeftX>-94.21875</UpperLeftX>\r\n\t<UpperLeftY>37.1337890625</UpperLeftY>\r\n\t<LowerRightX>-89.47265625</LowerRightX>\r\n\t<LowerRightY>34.4970703125</LowerRightY>\r\n\t<SizeX>700</SizeX>\r\n\t<SizeY>600</SizeY>\r\n\t</DataWindow>\r\n\t<BlockSizeX>1024</BlockSizeX>\r\n\t<BlockSizeY>1024</BlockSizeY>\r\n\t<Projection>EPSG:4326</Projection>\r\n\t<BandsCount>3</BandsCount>\r\n\t<ClampRequests>false</ClampRequests>\r\n</GDAL_WMS>\r\n"}}