Skip to content

Commit

Permalink
Merge pull request #33 from pblottiere/coverage_buffered
Browse files Browse the repository at this point in the history
Add buffer for vector layer coverage
  • Loading branch information
pblottiere authored Jun 18, 2024
2 parents b4356be + 53c7f12 commit 97a86ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions qsa-api/qsa_api/mapproxy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# coding: utf8

from .mapproxy import QSAMapProxy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import shutil
from pathlib import Path

from .utils import config, qgisserver_base_url
from ..utils import config, qgisserver_base_url


class QSAMapProxy:
Expand Down
File renamed without changes.
8 changes: 7 additions & 1 deletion qsa-api/qsa_api/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,16 @@ def add_layer(
# add layer in mapproxy config file
if self._mapproxy_enabled:
self.debug("Update MapProxy configuration file")

extent = lyr.extent()
if t == Qgis.LayerType.Vector:
buffer = max(abs(extent.xMaximum()), abs(extent.yMaximum()))
extent = extent.buffered(buffer * 10 / 100)

bbox = list(
map(
float,
lyr.extent()
extent
.asWktCoordinates()
.replace(",", "")
.split(" "),
Expand Down

0 comments on commit 97a86ea

Please sign in to comment.