-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from cevi/feature/pdf-map-export
- New PDF-map export using MapFish. - Added command-line for user-defined map scaling - Added command-line options to enable/disable features - Removed default file name for GPX file
- Loading branch information
Showing
18 changed files
with
1,718 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Docker Container running MapFish | ||
As of version 1.4.0, the script is divided into two main components: | ||
|
||
- A python script executed directly by the end user (entry-point `../python_program/main.py`) | ||
- A docker container running a MapFish instance used to create PDF-map exports via a web api. | ||
|
||
## Run MapFish inside a Local Docker Container: | ||
MapFish is an open-source tool to create reports containing maps. This script uses MapFish to create the PDF-map | ||
exports. We relay directly on the default `camptocamp/mapfish_print` docker container, customized by binding of our | ||
settings. | ||
|
||
Once you have Docker installed on your system, you can start the MapFish print server by calling: | ||
|
||
docker run --name=mapfish-print-test \ | ||
--mount type=bind,source=<path_to_pdf_map_export_folder>,target=/usr/local/tomcat/webapps/ROOT/print-apps/swisstopo \ | ||
--publish=8080:8080 camptocamp/mapfish_print | ||
|
||
## Test your MapFish Instance | ||
You can test if the container is running properly by opening [http://localhost:8080](http://localhost:8080/). Now you | ||
can copy-past the content of the `test_query.json` file and click on `Create And Get Print`. If the test PDF gets | ||
created properly, your installation was successfully. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
templates: | ||
|
||
#=========================================================================== | ||
A4 landscape: !template | ||
#=========================================================================== | ||
|
||
reportTemplate: report.jrxml | ||
attributes: | ||
|
||
map: !map | ||
maxDpi: 400 | ||
width: 813 | ||
height: 566 | ||
|
||
northArrow: !northArrow | ||
size: 50 | ||
default: | ||
graphic: "north_arrow.png" | ||
|
||
overlayLayers: !staticLayers | ||
default: | ||
layers: | ||
- type: grid | ||
origin: [ 2700000, 1200000 ] | ||
spacing: [ 1000, 1000 ] | ||
renderAsSvg: true | ||
gridColor: "#FFFFFF" | ||
rotateLabels: False | ||
labelColor: black | ||
valueFormat: "###,###" | ||
formatGroupingSeparator: " " | ||
font: | ||
name: | ||
- Liberation Sans | ||
- Helvetica | ||
- Nimbus Sans L | ||
- Liberation Sans | ||
- FreeSans | ||
- Sans-serif | ||
size: 6 | ||
style: | ||
version: 2 | ||
"*": | ||
symbolizers: | ||
- type: "line" | ||
strokeWidth: 0.1 | ||
strokeOpacity: 0.5 | ||
strokeColor: gray | ||
|
||
scalebar: !scalebar | ||
width: 200 | ||
height: 25 | ||
default: | ||
fontSize: 8 | ||
renderAsSvg: True | ||
unit: m | ||
type: line | ||
|
||
processors: | ||
- !addOverlayLayers | ||
inputMapper: | ||
overlayLayers: staticLayers | ||
map: map | ||
- !reportBuilder # compile all reports in current directory | ||
directory: '.' | ||
- !createMap { } | ||
- !createScalebar { } | ||
- !createNorthArrow {} | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Created with Jaspersoft Studio version 6.17.0.final using JasperReports Library version 6.17.0-6d93193241dd8cc42629e188b94f9e0bc5722efd --> | ||
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" | ||
name="report" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="814" leftMargin="14" | ||
rightMargin="14" topMargin="14" bottomMargin="14" uuid="9a3e59f5-6675-48cf-ad74-9c42b5a5b290"> | ||
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> | ||
<property name="com.jaspersoft.studio.unit." value="pixel"/> | ||
<parameter name="mapSubReport" class="java.lang.String"/> | ||
<parameter name="scalebarSubReport" class="java.lang.String"/> | ||
<parameter name="northArrowGraphic" class="java.lang.String"/> | ||
<title> | ||
<band height="567" splitType="Stretch"> | ||
<subreport> | ||
<reportElement x="1" y="0" width="813" height="566" backcolor="#B1F2BE" | ||
uuid="fa145068-76a5-4834-98ed-ce65b1976b3d"> | ||
<property name="local_mesure_unitwidth" value="pixel"/> | ||
<property name="local_mesure_unitheight" value="pixel"/> | ||
<property name="com.jaspersoft.studio.unit.width" value="px"/> | ||
<property name="com.jaspersoft.studio.unit.height" value="px"/> | ||
</reportElement> | ||
<subreportExpression><![CDATA[$P{mapSubReport}]]></subreportExpression> | ||
</subreport> | ||
<rectangle> | ||
<reportElement x="600" y="518" width="210" height="45" forecolor="#FFFFFF" | ||
uuid="c9901651-0788-428f-b7a3-0f1623195781"> | ||
<property name="com.jaspersoft.studio.unit.x" value="px"/> | ||
<property name="com.jaspersoft.studio.unit.width" value="px"/> | ||
<property name="com.jaspersoft.studio.unit.height" value="px"/> | ||
<property name="com.jaspersoft.studio.unit.y" value="px"/> | ||
</reportElement> | ||
</rectangle> | ||
<subreport> | ||
<reportElement x="605" y="523" width="200" height="25" uuid="fa145068-76a5-4834-98ed-ce65b1976b3d"> | ||
<property name="com.jaspersoft.studio.unit.height" value="px"/> | ||
<property name="com.jaspersoft.studio.unit.width" value="px"/> | ||
<property name="com.jaspersoft.studio.unit.x" value="px"/> | ||
</reportElement> | ||
<subreportExpression><![CDATA[$P{scalebarSubReport}]]></subreportExpression> | ||
</subreport> | ||
<staticText> | ||
<reportElement x="605" y="545" width="200" height="16" uuid="a03c1801-86f0-4389-9fc7-3a5e6f7a30dc"> | ||
<property name="com.jaspersoft.studio.unit.width" value="px"/> | ||
<property name="com.jaspersoft.studio.unit.x" value="px"/> | ||
</reportElement> | ||
<textElement textAlignment="Center" verticalAlignment="Middle"> | ||
<font fontName="SansSerif" size="9"/> | ||
</textElement> | ||
<text><![CDATA[https://disclaimer.admin.ch © swisstopo]]></text> | ||
</staticText> | ||
<image evaluationTime="Report"> | ||
<reportElement x="10" y="10" width="280" height="39" uuid="e7375b56-57f5-4abb-8f88-45734b26ed1b"/> | ||
<imageExpression><![CDATA["cevi_logo.svg"]]></imageExpression> | ||
</image> | ||
<image> | ||
<reportElement x="750" y="20" width="50" height="50" uuid="fa145068-76a5-4834-98ed-ce65b1976b3d"> | ||
<property name="local_mesure_unitwidth" value="pixel"/> | ||
<property name="com.jaspersoft.studio.unit.width" value="px"/> | ||
<property name="local_mesure_unitheight" value="pixel"/> | ||
<property name="com.jaspersoft.studio.unit.height" value="px"/> | ||
</reportElement> | ||
<imageExpression class="net.sf.jasperreports.engine.JRRenderable"> | ||
<![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File(new java.net.URI($P{northArrowGraphic})))]]> | ||
</imageExpression> | ||
</image> | ||
</band> | ||
</title> | ||
</jasperReport> |
Oops, something went wrong.