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

[12.0] [IMP] geoengine_swisstopo : Add Swisstopo projections #351

Merged
merged 3 commits into from
Feb 29, 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
43 changes: 42 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,45 @@ repos:
args:
- --rcfile=.pylintrc-mandatory
additional_dependencies: *pylint_deps

- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args:
- --expand-star-imports
- --ignore-init-module-imports
- --in-place
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
# - repo: https://github.com/psf/black
# rev: 22.3.0
# hooks:
# - id: black
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: v2.1.2
# hooks:
# - id: prettier
# name: prettier (with plugin-xml)
# additional_dependencies:
# - "[email protected]"
# - "@prettier/[email protected]"
# args:
# - --plugin=@prettier/plugin-xml
# files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
hooks:
- id: pyupgrade
args:
- --keep-percent-format
- --py36-plus
# - repo: https://github.com/PyCQA/isort
# rev: 5.12.0
# language_version: python3.8
# hooks:
# - id: isort
# name: isort except __init__.py
# args:
# - --settings=.
# exclude: /__init__\.py$
Comment on lines +59 to +100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be modified manually, but only through copier update

1 change: 0 additions & 1 deletion base_geoengine/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# serve to show the default.

import sys
import imp
import os
import sphinx_bootstrap_theme

Expand Down
2 changes: 1 addition & 1 deletion base_geoengine/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def convert_to_column(self, value, record, values=None):
"""Convert value to database format

value can be geojson, wkt, shapely geometry object.
If geo_direct_write in context you can pass diretly WKT"""
If geo_direct_write in context you can pass directly WKT"""
if not value:
return None
shape_to_write = self.entry_to_shape(value, same_type=True)
Expand Down
2 changes: 1 addition & 1 deletion base_geoengine/geo_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_edit_info_for_geo_column(self, column):
'default_extent': view.default_extent or DEFAULT_EXTENT,
'default_zoom': view.default_zoom,
}
logger.debug("Parameters for geo field {}:\n{}".format(column, res))
logger.debug(f"Parameters for geo field {column}:\n{res}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the minimum version of python supported by v12 is 3.5, which does not have fstrings. This unfortunately broke my installation.

return res

@api.model
Expand Down
2 changes: 1 addition & 1 deletion base_geoengine/geo_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def geo_search(model, domain=None, geo_domain=None, offset=0,
return []


class GeoOperator(object):
class GeoOperator:

def __init__(self, geo_field):
self.geo_field = geo_field
Expand Down
12 changes: 3 additions & 9 deletions base_geoengine/geo_view/geo_raster_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,12 @@ class GeoRasterLayer(models.Model):
matrix_set = fields.Char("matrixSet")
format_suffix = fields.Char("formatSuffix", help="eg. png")
request_encoding = fields.Char("requestEncoding", help="eg. REST")
projection = fields.Char("projection", help="eg. EPSG:21781")
projection = fields.Char("projection", help="eg. EPSG:3857")
units = fields.Char(help="eg. m")
resolutions = fields.Char("resolutions")
max_extent = fields.Char("max_extent")
dimensions = fields.Char(
"dimensions",
help="List of dimensions separated by ','")
params = fields.Char(
"params",
help="Dictiorary of values for dimensions as JSON"
)
dimensions = fields.Char("dimensions", help="List of dimensions separated by ','")
params = fields.Char("params", help="Dictionary of values for dimensions as JSON")

# technical field to display or not layer type
has_type = fields.Boolean(compute='_compute_has_type')
Expand Down Expand Up @@ -86,4 +81,3 @@ def _compute_is_wmts(self):
@api.onchange('raster_type')
def onchange_set_wmts_options(self):
""" Abstract method for WMTS modules to set default options """
pass
Loading
Loading