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

allow to use a distinct url/layername for background in BPs #781

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/cadastrapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checking out"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Setting up Java"
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'

- name: "Maven repository caching"
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: cadastrapp-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -37,7 +38,7 @@ jobs:
run: mkdir -p scratch && cp cadastrapp/target/georchestra-cadastrapp*.deb scratch/

- name: "publish deb as artifact"
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: cadastrapp.deb
path: scratch/
Expand All @@ -46,15 +47,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checking out"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Setting up Java"
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'

- name: "Maven repository caching"
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: cadastrapp-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,22 @@ public ResponseEntity<byte[]> createImageBordereauParcellaire(

logger.debug("Call WMS for cadastral background");
// Get cadastral background image with good BBOX
final String cadastralLayerWmsUrl = CadastrappPlaceHolder.getProperty("cadastre.wms.url");
String cadastralLayerWmsUrl = CadastrappPlaceHolder.getProperty("cadastre.wms.url");
final String cadastralLayerWmsUsername = CadastrappPlaceHolder.getProperty("cadastre.wms.username");
final String cadastralLayerWmsPassword = CadastrappPlaceHolder.getProperty("cadastre.wms.password");

// overriden by cadastrebpbg if defined - allows to use a different layer source url for backgrounds in BPs
if (CadastrappPlaceHolder.getProperty("cadastrebpbg.wms.url") != null && !CadastrappPlaceHolder.getProperty("cadastrebpbg.wms.url").isEmpty()) {
cadastralLayerWmsUrl = CadastrappPlaceHolder.getProperty("cadastrebpbg.wms.url");
}
WebMapServer wmsCadastralLayer = createWebMapServer(cadastralLayerWmsUrl,cadastralLayerWmsUsername, cadastralLayerWmsPassword );

final String cadastralLayerName = CadastrappPlaceHolder.getProperty("cadastre.wms.layer.name");
String cadastralLayerName = CadastrappPlaceHolder.getProperty("cadastre.wms.layer.name");
final String cadastreSRS = CadastrappPlaceHolder.getProperty("cadastre.SRS");
final String cadastralLayerFormat = CadastrappPlaceHolder.getProperty("cadastre.format");

// overriden by cadastrebpbg if defined - allows to use a different layer name for backgrounds in BPs
if (CadastrappPlaceHolder.getProperty("cadastrebpbg.wms.layer.name") != null && !CadastrappPlaceHolder.getProperty("cadastrebpbg.wms.layer.name").isEmpty()) {
cadastralLayerName = CadastrappPlaceHolder.getProperty("cadastrebpbg.wms.layer.name");
}
GetMapRequest requestCadastralLayer = createAndConfigureMapRequest(wmsCadastralLayer, cadastralLayerFormat, cadastralLayerName, pdfImagePixelSize, cadastreSRS, bounds);

logger.debug("Create background cadastral image");
Expand Down
5 changes: 5 additions & 0 deletions cadastrapp/src/main/resources/cadastrapp.properties
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ cadastre.wms.layer.name=qgis:geo_parcelle
cadastre.wms.username=
cadastre.wms.password=

#if defined, used instead of cadastre.wms for the background layer in BP
#useful of cadastre.wms points at a cached layer and you want a different layer without resampling for BPs.
#cadastrebpbg.wms.url=https://georchestra.example.org/geoserver/wms
#cadastrebpbg.wms.layer.name=qgis:geo_parcelle

# Here you can configure the layer used to generate the plot selection on BP
# let it empty if cadastre.wms.url support SLD_BODY WMS param
# Note that it must support SLD_BODY WMS param
Expand Down
Loading