Source code for gws.types

from typing import Any, Dict, List, Optional, Tuple, Union, cast


# NB: we cannot use the standard Enum, because after "class Color(Enum): RED = 1"
# the value of Color.RED is like {'_value_': 1, '_name_': 'RED', '__objclass__': etc}
# and we need it to be 1, literally (that's what we'll get from the client)

[docs]class Enum: pass
#:alias An array of 4 elements representing extent coordinates [minx, miny, maxx, maxy] Extent = Tuple[float, float, float, float] #:alias Point coordinates [x, y] Point = Tuple[float, float] #:alias Size [width, height] Size = Tuple[float, float] #:alias A value with a unit Measurement = Tuple[float, str] #:alias An XML generator tag Tag = tuple
[docs]class Axis(Enum): """Axis orientation.""" xy = 'xy' yx = 'yx'
#:alias Verbatim literal type Literal = str #:alias Valid readable file path on the server FilePath = str #:alias Valid readable directory path on the server DirPath = str #:alias String like "1w 2d 3h 4m 5s" or a number of seconds Duration = str #:alias CSS color name Color = str #:alias Regular expression, as used in Python Regex = str #:alias String with {attribute} placeholders FormatStr = str #:alias CRS code like "EPSG:3857 Crs = str #:alias ISO date like "2019-01-30" Date = str #:alias ISO date/time like "2019-01-30 01:02:03" DateTime = str #:alias Http or https URL Url = str # dummy classes to support extension typing
[docs]class ext:
[docs] class action:
[docs] class Config: pass
[docs] class Props: pass
[docs] class auth:
[docs] class method:
[docs] class Config: pass
[docs] class provider:
[docs] class Config: pass
[docs] class template:
[docs] class Config: pass
[docs] class Props: pass
[docs] class db:
[docs] class provider:
[docs] class Config: pass
[docs] class layer:
[docs] class Config: pass
[docs] class Props: pass
[docs] class search:
[docs] class provider:
[docs] class Config: pass
[docs] class storage:
[docs] class Config: pass
[docs] class helper:
[docs] class Config: pass
[docs] class ows:
[docs] class provider:
[docs] class Config: pass
[docs] class service:
[docs] class Config: pass
# basic data type
[docs]class Data: """Basic data object.""" def __init__(self, *args, **kwargs): self._extend(args, kwargs) def __repr__(self): return repr(vars(self)) def __getattr__(self, item): if item.startswith('_'): # do not use None fallback for special props raise AttributeError() return None
[docs] def get(self, k, default=None): return vars(self).get(k, default)
def _extend(self, args, kwargs): d = {} for a in args: if isinstance(a, dict): d.update(a) elif isinstance(a, Data): d.update(vars(a)) d.update(kwargs) vars(self).update(d)
# configuration primitives
[docs]class Config(Data): """Configuration base type""" uid: str = '' #: unique ID
[docs]class WithType(Config): type: str #: object type
[docs]class AccessType(Enum): allow = 'allow' deny = 'deny'
[docs]class Access(Config): """Access rights definition for authorization roles""" type: AccessType #: access type (deny or allow) role: str #: a role to which this rule applies
[docs]class WithAccess(Config): access: Optional[List[Access]] #: access rights
[docs]class WithTypeAndAccess(Config): type: str #: object type access: Optional[List[Access]] #: access rights
# attributes
[docs]class AttributeType(Enum): bool = 'bool' bytes = 'bytes' date = 'date' datetime = 'datetime' float = 'float' geometry = 'geometry' int = 'int' list = 'list' str = 'str' text = 'text' time = 'time'
[docs]class GeometryType(Enum): curve = 'CURVE' geomcollection = 'GEOMCOLLECTION' geometry = 'GEOMETRY' linestring = 'LINESTRING' multicurve = 'MULTICURVE' multilinestring = 'MULTILINESTRING' multipoint = 'MULTIPOINT' multipolygon = 'MULTIPOLYGON' multisurface = 'MULTISURFACE' point = 'POINT' polygon = 'POLYGON' polyhedralsurface = 'POLYHEDRALSURFACE' surface = 'SURFACE'
[docs]class Attribute(Data): name: str title: str = '' type: AttributeType = 'str' value: Any = None editable: bool = True
# request params and responses
[docs]class Params(Data): projectUid: Optional[str] #: project uid locale: Optional[str] #: locale for this request
[docs]class NoParams(Data): pass
[docs]class ResponseError(Data): status: int info: str
[docs]class Response(Data): error: Optional[ResponseError]
[docs]class HttpResponse(Response): mime: str content: str status: int
[docs]class FileResponse(Response): mime: str path: str status: int attachment_name: str
# props baseclass
[docs]class Props(Data): """Properties base type""" pass
[docs]class Bounds(Data): crs: 'Crs' extent: 'Extent'
[docs]class CorsOptions(Data): allow_credentials: bool allow_headers: Optional[List[str]] allow_origin: str
[docs]class DocumentRoot(Data): allow_mime: Optional[List[str]] deny_mime: Optional[List[str]] dir: 'DirPath'
[docs]class FeatureProps(Data): attributes: Optional[List[Attribute]] elements: Optional[dict] layerUid: Optional[str] shape: Optional['ShapeProps'] style: Optional['StyleProps'] uid: Optional[str]
[docs]class IBaseRequest: data: Optional[bytes] environ: dict input_struct_type: int is_secure: bool method: str output_struct_type: int params: dict root: 'IRootObject' site: 'IWebSite' text: Optional[str]
[docs] def cookie(self, key: str, default: str = None) -> str: pass
[docs] def env(self, key: str, default: str = None) -> str: pass
[docs] def error_response(self, err) -> 'IResponse': pass
[docs] def file_response(self, path: str, mimetype: str, status: int = 200, attachment_name: str = None) -> 'IResponse': pass
[docs] def has_param(self, key: str) -> bool: pass
[docs] def header(self, key: str, default: str = None) -> str: pass
[docs] def init(self): pass
[docs] def param(self, key: str, default: str = None) -> str: pass
[docs] def redirect_response(self, location, status=302): pass
[docs] def response(self, content: str, mimetype: str, status: int = 200) -> 'IResponse': pass
[docs] def struct_response(self, data: 'Response', status: int = 200) -> 'IResponse': pass
[docs] def url_for(self, url: 'Url') -> 'Url': pass
[docs]class IFeature: attr_dict: dict attributes: List[Attribute] category: str data_model: Optional['IModel'] elements: dict full_uid: str layer: Optional['ILayer'] props: 'FeatureProps' props_for_render: 'FeatureProps' shape: Optional['IShape'] style: Optional['IStyle'] template_context: dict templates: Optional[List['ITemplate']] uid: str
[docs] def apply_data_model(self, model: 'IModel' = None) -> 'IFeature': pass
[docs] def apply_templates(self, templates: List['ITemplate'] = None, extra_context: dict = None, keys: List[str] = None) -> 'IFeature': pass
[docs] def attr(self, name: str): pass
[docs] def to_geojson(self) -> dict: pass
[docs] def to_svg(self, rv: 'MapRenderView', style: 'IStyle' = None) -> str: pass
[docs] def to_svg_tags(self, rv: 'MapRenderView', style: 'IStyle' = None) -> List['Tag']: pass
[docs] def transform_to(self, crs) -> 'IFeature': pass
[docs]class IObject: access: 'Access' children: List['IObject'] config: Config parent: 'IObject' props: Props root: 'IRootObject' uid: str
[docs] def append_child(self, obj: 'IObject') -> 'IObject': pass
[docs] def create_child(self, klass, cfg) -> 'IObject': pass
[docs] def get_children(self, klass) -> List['IObject']: pass
[docs] def get_closest(self, klass) -> 'IObject': pass
[docs] def initialize(self, cfg): pass
[docs] def is_a(self, klass): pass
[docs] def post_configure(self): pass
[docs] def post_initialize(self): pass
[docs] def props_for(self, user) -> Optional[dict]: pass
[docs] def set_uid(self, uid): pass
[docs] def var(self, key, default=None, parent=False): pass
[docs]class IResponse:
[docs] def add_header(self, key, value): pass
[docs]class IRole:
[docs] def can_use(self, obj, parent=None): pass
[docs]class ISession: changed: bool data: dict method: 'IAuthMethod' type: str uid: str user: 'IUser'
[docs] def get(self, key, default=None): pass
[docs] def set(self, key, val): pass
[docs]class IShape: area: float bounds: 'Bounds' centroid: 'IShape' crs: str ewkb: bytes ewkb_hex: str ewkt: str extent: 'Extent' props: 'ShapeProps' srid: int type: 'GeometryType' wkb: bytes wkb_hex: str wkt: str x: float y: float
[docs] def intersects(self, shape: 'IShape') -> bool: pass
[docs] def to_multi(self) -> 'IShape': pass
[docs] def to_type(self, new_type: 'GeometryType') -> 'IShape': pass
[docs] def tolerance_polygon(self, tolerance, resolution=None) -> 'IShape': pass
[docs] def transformed_to(self, to_crs, **kwargs) -> 'IShape': pass
[docs]class IStyle: name: str props: 'StyleProps' text: str type: 'StyleType' values: 'StyleValues'
[docs]class IUser: attributes: dict display_name: str fid: str is_guest: bool props: 'UserProps' provider: 'IAuthProvider' roles: List[str] uid: str
[docs] def attribute(self, key: str, default: str = '') -> str: pass
[docs] def can_use(self, obj, parent=None) -> bool: pass
[docs] def has_role(self, role: str) -> bool: pass
[docs] def init_from_data(self, provider, uid, roles, attributes) -> 'IUser': pass
[docs] def init_from_source(self, provider, uid, roles=None, attributes=None) -> 'IUser': pass
[docs]class LayerLegend(Data): enabled: bool path: str template: 'ITemplate' url: str
[docs]class MapRenderInput(Data): background_color: int items: List['MapRenderInputItem'] view: 'MapRenderView'
[docs]class MapRenderInputItem(Data): dpi: int features: List['IFeature'] fragment: 'SvgFragment' layer: 'ILayer' opacity: float print_as_vector: bool style: 'IStyle' sub_layers: List[str] type: str
[docs]class MapRenderInputItemType(Enum): features = 'features' fragment = 'fragment' image = 'image' image_layer = 'image_layer' svg_layer = 'svg_layer'
[docs]class MapRenderOutput(Data): base_dir: str items: List['MapRenderOutputItem'] view: 'MapRenderView'
[docs]class MapRenderOutputItem(Data): path: str tags: List['Tag'] type: str
[docs]class MapRenderView(Data): bounds: 'Bounds' center: 'Point' dpi: int rotation: int scale: int size_mm: 'Size' size_px: 'Size'
[docs]class MetaContact(Data): address: str area: str city: str country: str email: str fax: str organization: str person: str phone: str position: str role: str url: str zip: str
[docs]class MetaData(Data): abstract: str accessConstraints: str attribution: str authorityIdentifier: str authorityName: str authorityUrl: 'Url' catalogUid: str contact: 'MetaContact' dateCreated: 'DateTime' dateUpdated: 'DateTime' fees: str image: 'Url' insipreKeywords: List['MetaInspireMandatoryKeyword'] insipreMandatoryKeyword: 'MetaInspireMandatoryKeyword' inspireDegreeOfConformity: 'MetaInspireDegreeOfConformity' inspireResourceType: 'MetaInspireResourceType' inspireSpatialDataServiceType: 'MetaInspireSpatialDataServiceType' inspireTheme: 'MetaInspireTheme' inspireThemeName: str inspireThemeNameEn: str isoMaintenanceFrequencyCode: 'MetaIsoMaintenanceFrequencyCode' isoQualityConformanceExplanation: str isoQualityConformancePass: bool isoQualityLineageSource: str isoQualityLineageSourceScale: int isoQualityLineageStatement: str isoScope: 'MetaIsoScope' isoSpatialRepresentationType: 'MetaIsoSpatialRepresentationType' isoTopicCategory: 'MetaIsoTopicCategory' keywords: List[str] language: str links: List['MetaLink'] name: str serviceUrl: 'Url' title: str url: 'Url' urlType: str
[docs]class MetaInspireDegreeOfConformity(Enum): conformant = 'conformant' notConformant = 'notConformant' notEvaluated = 'notEvaluated'
[docs]class MetaInspireMandatoryKeyword(Enum): chainDefinitionService = 'chainDefinitionService' comEncodingService = 'comEncodingService' comGeographicCompressionService = 'comGeographicCompressionService' comGeographicFormatConversionService = 'comGeographicFormatConversionService' comMessagingService = 'comMessagingService' comRemoteFileAndExecutableManagement = 'comRemoteFileAndExecutableManagement' comService = 'comService' comTransferService = 'comTransferService' humanCatalogueViewer = 'humanCatalogueViewer' humanChainDefinitionEditor = 'humanChainDefinitionEditor' humanFeatureGeneralizationEditor = 'humanFeatureGeneralizationEditor' humanGeographicDataStructureViewer = 'humanGeographicDataStructureViewer' humanGeographicFeatureEditor = 'humanGeographicFeatureEditor' humanGeographicSpreadsheetViewer = 'humanGeographicSpreadsheetViewer' humanGeographicSymbolEditor = 'humanGeographicSymbolEditor' humanGeographicViewer = 'humanGeographicViewer' humanInteractionService = 'humanInteractionService' humanServiceEditor = 'humanServiceEditor' humanWorkflowEnactmentManager = 'humanWorkflowEnactmentManager' infoCatalogueService = 'infoCatalogueService' infoCoverageAccessService = 'infoCoverageAccessService' infoFeatureAccessService = 'infoFeatureAccessService' infoFeatureTypeService = 'infoFeatureTypeService' infoGazetteerService = 'infoGazetteerService' infoManagementService = 'infoManagementService' infoMapAccessService = 'infoMapAccessService' infoOrderHandlingService = 'infoOrderHandlingService' infoProductAccessService = 'infoProductAccessService' infoRegistryService = 'infoRegistryService' infoSensorDescriptionService = 'infoSensorDescriptionService' infoStandingOrderService = 'infoStandingOrderService' metadataGeographicAnnotationService = 'metadataGeographicAnnotationService' metadataProcessingService = 'metadataProcessingService' metadataStatisticalCalculationService = 'metadataStatisticalCalculationService' spatialCoordinateConversionService = 'spatialCoordinateConversionService' spatialCoordinateTransformationService = 'spatialCoordinateTransformationService' spatialCoverageVectorConversionService = 'spatialCoverageVectorConversionService' spatialDimensionMeasurementService = 'spatialDimensionMeasurementService' spatialFeatureGeneralizationService = 'spatialFeatureGeneralizationService' spatialFeatureManipulationService = 'spatialFeatureManipulationService' spatialFeatureMatchingService = 'spatialFeatureMatchingService' spatialImageCoordinateConversionService = 'spatialImageCoordinateConversionService' spatialImageGeometryModelConversionService = 'spatialImageGeometryModelConversionService' spatialOrthorectificationService = 'spatialOrthorectificationService' spatialPositioningService = 'spatialPositioningService' spatialProcessingService = 'spatialProcessingService' spatialProximityAnalysisService = 'spatialProximityAnalysisService' spatialRectificationService = 'spatialRectificationService' spatialRouteDeterminationService = 'spatialRouteDeterminationService' spatialSamplingService = 'spatialSamplingService' spatialSensorGeometryModelAdjustmentService = 'spatialSensorGeometryModelAdjustmentService' spatialSubsettingService = 'spatialSubsettingService' spatialTilingChangeService = 'spatialTilingChangeService' subscriptionService = 'subscriptionService' taskManagementService = 'taskManagementService' temporalProcessingService = 'temporalProcessingService' temporalProximityAnalysisService = 'temporalProximityAnalysisService' temporalReferenceSystemTransformationService = 'temporalReferenceSystemTransformationService' temporalSamplingService = 'temporalSamplingService' temporalSubsettingService = 'temporalSubsettingService' thematicChangeDetectionService = 'thematicChangeDetectionService' thematicClassificationService = 'thematicClassificationService' thematicFeatureGeneralizationService = 'thematicFeatureGeneralizationService' thematicGeocodingService = 'thematicGeocodingService' thematicGeographicInformationExtractionService = 'thematicGeographicInformationExtractionService' thematicGeoparsingService = 'thematicGeoparsingService' thematicGoparameterCalculationService = 'thematicGoparameterCalculationService' thematicImageManipulationService = 'thematicImageManipulationService' thematicImageProcessingService = 'thematicImageProcessingService' thematicImageSynthesisService = 'thematicImageSynthesisService' thematicImageUnderstandingService = 'thematicImageUnderstandingService' thematicMultibandImageManipulationService = 'thematicMultibandImageManipulationService' thematicObjectDetectionService = 'thematicObjectDetectionService' thematicProcessingService = 'thematicProcessingService' thematicReducedResolutionGenerationService = 'thematicReducedResolutionGenerationService' thematicSpatialCountingService = 'thematicSpatialCountingService' thematicSubsettingService = 'thematicSubsettingService' workflowEnactmentService = 'workflowEnactmentService'
[docs]class MetaInspireResourceType(Enum): dataset = 'dataset' series = 'series' service = 'service'
[docs]class MetaInspireSpatialDataServiceType(Enum): discovery = 'discovery' download = 'download' invoke = 'invoke' other = 'other' transformation = 'transformation' view = 'view'
[docs]class MetaInspireTheme(Enum): ac = 'ac' ad = 'ad' af = 'af' am = 'am' au = 'au' br = 'br' bu = 'bu' cp = 'cp' ef = 'ef' el = 'el' er = 'er' ge = 'ge' gg = 'gg' gn = 'gn' hb = 'hb' hh = 'hh' hy = 'hy' lc = 'lc' lu = 'lu' mf = 'mf' mr = 'mr' nz = 'nz' of = 'of' oi = 'oi' pd = 'pd' pf = 'pf' ps = 'ps' rs = 'rs' sd = 'sd' so = 'so' sr = 'sr' su = 'su' tn = 'tn' us = 'us'
[docs]class MetaIsoMaintenanceFrequencyCode(Enum): annually = 'annually' asNeeded = 'asNeeded' biannually = 'biannually' continual = 'continual' daily = 'daily' fortnightly = 'fortnightly' irregular = 'irregular' monthly = 'monthly' notPlanned = 'notPlanned' quarterly = 'quarterly' unknown = 'unknown' weekly = 'weekly'
[docs]class MetaIsoOnLineFunction(Enum): download = 'download' information = 'information' offlineAccess = 'offlineAccess' order = 'order' search = 'search'
[docs]class MetaIsoScope(Enum): attribute = 'attribute' attributeType = 'attributeType' collectionHardware = 'collectionHardware' collectionSession = 'collectionSession' dataset = 'dataset' dimensionGroup = 'dimensionGroup' feature = 'feature' featureType = 'featureType' fieldSession = 'fieldSession' initiative = 'initiative' model = 'model' nonGeographicDataset = 'nonGeographicDataset' otherAggregate = 'otherAggregate' platformSeries = 'platformSeries' productionSeries = 'productionSeries' propertyType = 'propertyType' sensor = 'sensor' sensorSeries = 'sensorSeries' series = 'series' service = 'service' software = 'software' stereomate = 'stereomate' tile = 'tile' transferAggregate = 'transferAggregate'
[docs]class MetaIsoSpatialRepresentationType(Enum): grid = 'grid' stereoModel = 'stereoModel' textTable = 'textTable' tin = 'tin' vector = 'vector' video = 'video'
[docs]class MetaIsoTopicCategory(Enum): biota = 'biota' boundaries = 'boundaries' climatologyMeteorologyAtmosphere = 'climatologyMeteorologyAtmosphere' economy = 'economy' elevation = 'elevation' environment = 'environment' farming = 'farming' geoscientificInformation = 'geoscientificInformation' health = 'health' imageryBaseMapsEarthCover = 'imageryBaseMapsEarthCover' inlandWaters = 'inlandWaters' intelligenceMilitary = 'intelligenceMilitary' location = 'location' oceans = 'oceans' planningCadastre = 'planningCadastre' society = 'society' structure = 'structure' transportation = 'transportation' utilitiesCommunication = 'utilitiesCommunication'
[docs]class ModelProps(Props): rules: List['ModelRule']
[docs]class ModelRule(Data): editable: bool expression: str format: 'FormatStr' name: str source: str title: str type: 'AttributeType' value: Optional[str]
[docs]class OwsOperation: formats: List[str] get_url: 'Url' name: str parameters: dict post_url: 'Url'
[docs]class Projection(Data): epsg: str is_geographic: bool proj4text: str srid: int units: str uri: str url: str urn: str urnx: str
[docs]class RewriteRule(Data): match: 'Regex' options: Optional[dict] target: str
[docs]class SearchArgs(Data): axis: str bounds: 'Bounds' filter: Optional['SearchFilter'] keyword: Optional[str] layers: List['ILayer'] limit: int params: dict project: 'IProject' resolution: float shapes: List['IShape'] source_layer_names: List[str] tolerance: 'Measurement'
[docs]class SearchFilter(Data): name: str operator: str shape: 'IShape' sub: List['SearchFilter'] value: str
[docs]class SelectArgs(Data): extra_where: Optional[list] keyword: Optional[str] limit: Optional[int] map_tolerance: Optional[float] shape: Optional['IShape'] sort: Optional[str] table: 'SqlTable' uids: Optional[List[str]]
[docs]class ShapeProps(Props): crs: str geometry: dict
[docs]class SourceLayer(Data): a_level: int a_path: str a_uid: str data_source: dict is_expanded: bool is_group: bool is_image: bool is_queryable: bool is_visible: bool layers: List['SourceLayer'] legend: str meta: 'MetaData' name: str opacity: int resource_urls: dict scale_range: List[float] styles: List['SourceStyle'] supported_bounds: List['Bounds'] supported_crs: List['Crs'] title: str
[docs]class SourceStyle(Data): is_default: bool legend: 'Url' meta: 'MetaData' name: str
[docs]class SpecValidator:
[docs] def method_spec(self, name): pass
[docs] def read_value(self, val, type_name, path='', strict=True): pass
[docs]class SqlTable(Data): geometry_column: str geometry_crs: 'Crs' geometry_type: 'GeometryType' key_column: str name: str search_column: str
[docs]class SqlTableColumn(Data): crs: 'Crs' geom_type: 'GeometryType' is_geometry: bool is_key: bool name: str native_type: str type: 'AttributeType'
[docs]class StorageDirectory(Data): category: str entries: List['StorageEntry'] readable: bool writable: bool
[docs]class StorageElement(Data): data: dict entry: 'StorageEntry'
[docs]class StorageEntry(Data): category: str name: str
[docs]class StorageRecord(Data): category: str created: int data: str name: str updated: int user_fid: str
[docs]class StyleGeometryOption(Enum): all = 'all' none = 'none'
[docs]class StyleLabelAlign(Enum): center = 'center' left = 'left' right = 'right'
[docs]class StyleLabelFontStyle(Enum): italic = 'italic' normal = 'normal'
[docs]class StyleLabelFontWeight(Enum): bold = 'bold' normal = 'normal'
[docs]class StyleLabelOption(Enum): all = 'all' none = 'none'
[docs]class StyleLabelPlacement(Enum): end = 'end' middle = 'middle' start = 'start'
[docs]class StyleMarker(Enum): arrow = 'arrow' circle = 'circle' cross = 'cross' square = 'square'
[docs]class StyleProps(Props): name: Optional[str] text: Optional[str] type: 'StyleType' values: Optional['StyleValues']
[docs]class StyleStrokeLineCap(Enum): butt = 'butt' round = 'round' square = 'square'
[docs]class StyleStrokeLineJoin(Enum): bevel = 'bevel' miter = 'miter' round = 'round'
[docs]class StyleType(Enum): css = 'css' cssSelector = 'cssSelector'
[docs]class StyleValues(Data): fill: Optional['Color'] icon: Optional[str] label_align: Optional['StyleLabelAlign'] label_background: Optional['Color'] label_fill: Optional['Color'] label_font_family: Optional[str] label_font_size: Optional[int] label_font_style: Optional['StyleLabelFontStyle'] label_font_weight: Optional['StyleLabelFontWeight'] label_line_height: Optional[int] label_max_scale: Optional[int] label_min_scale: Optional[int] label_offset_x: Optional[int] label_offset_y: Optional[int] label_padding: Optional[List[int]] label_placement: Optional['StyleLabelPlacement'] label_stroke: Optional['Color'] label_stroke_dasharray: Optional[List[int]] label_stroke_dashoffset: Optional[int] label_stroke_linecap: Optional['StyleStrokeLineCap'] label_stroke_linejoin: Optional['StyleStrokeLineJoin'] label_stroke_miterlimit: Optional[int] label_stroke_width: Optional[int] marker: Optional['StyleMarker'] marker_fill: Optional['Color'] marker_size: Optional[int] marker_stroke: Optional['Color'] marker_stroke_dasharray: Optional[List[int]] marker_stroke_dashoffset: Optional[int] marker_stroke_linecap: Optional['StyleStrokeLineCap'] marker_stroke_linejoin: Optional['StyleStrokeLineJoin'] marker_stroke_miterlimit: Optional[int] marker_stroke_width: Optional[int] offset_x: Optional[int] offset_y: Optional[int] point_size: Optional[int] stroke: Optional['Color'] stroke_dasharray: Optional[List[int]] stroke_dashoffset: Optional[int] stroke_linecap: Optional['StyleStrokeLineCap'] stroke_linejoin: Optional['StyleStrokeLineJoin'] stroke_miterlimit: Optional[int] stroke_width: Optional[int] with_geometry: Optional['StyleGeometryOption'] with_label: Optional['StyleLabelOption']
[docs]class SvgFragment(Data): points: List['Point'] styles: Optional[List['IStyle']] tags: List['Tag']
[docs]class TemplateLegendMode(Enum): html = 'html' image = 'image'
[docs]class TemplateOutput(Data): content: str mime: str path: str
[docs]class TemplateProps(Props): dataModel: 'ModelProps' mapHeight: int mapWidth: int qualityLevels: List['TemplateQualityLevel'] title: str uid: str
[docs]class TemplateQualityLevel(Data): dpi: int name: str
[docs]class UserProps(Data): displayName: str
[docs]class IApi(IObject): actions: dict
[docs]class IApplication(IObject): api: 'IApi' auth: 'IAuthManager' client: Optional['IClient'] meta: 'MetaData' monitor: 'IMonitor' qgis_version: str version: str web_sites: List['IWebSite']
[docs] def developer_option(self, name): pass
[docs] def find_action(self, action_type, project_uid=None): pass
[docs] def require_helper(self, key): pass
[docs]class IAuthManager(IObject): guest_user: 'IUser' methods: List['IAuthMethod'] providers: List['IAuthProvider'] sys: 'IAuthProvider'
[docs] def authenticate(self, method: 'IAuthMethod', login, password, **kw) -> Optional['IUser']: pass
[docs] def close_session(self, sess: 'ISession', req: 'IRequest', res: 'IResponse') -> 'ISession': pass
[docs] def create_stored_session(self, type: str, method: 'IAuthMethod', user: 'IUser') -> 'ISession': pass
[docs] def delete_stored_sessions(self): pass
[docs] def destroy_stored_session(self, sess: 'ISession'): pass
[docs] def find_stored_session(self, uid): pass
[docs] def get_method(self, type: str) -> Optional['IAuthMethod']: pass
[docs] def get_provider(self, uid: str) -> Optional['IAuthProvider']: pass
[docs] def get_role(self, name: str) -> 'IRole': pass
[docs] def get_user(self, user_fid: str) -> Optional['IUser']: pass
[docs] def login(self, method: 'IAuthMethod', login: str, password: str, req: 'IRequest') -> 'ISession': pass
[docs] def logout(self, sess: 'ISession', req: 'IRequest') -> 'ISession': pass
[docs] def new_session(self, **kwargs): pass
[docs] def open_session(self, req: 'IRequest') -> 'ISession': pass
[docs] def save_stored_session(self, sess: 'ISession'): pass
[docs] def serialize_user(self, user: 'IUser') -> str: pass
[docs] def stored_session_records(self) -> List[dict]: pass
[docs] def unserialize_user(self, s: str) -> 'IUser': pass
[docs]class IAuthMethod(IObject): type: str
[docs] def close_session(self, auth: 'IAuthManager', sess: 'ISession', req: 'IRequest', res: 'IResponse'): pass
[docs] def login(self, auth: 'IAuthManager', login: str, password: str, req: 'IRequest') -> Optional['ISession']: pass
[docs] def logout(self, auth: 'IAuthManager', sess: 'ISession', req: 'IRequest') -> 'ISession': pass
[docs] def open_session(self, auth: 'IAuthManager', req: 'IRequest') -> Optional['ISession']: pass
[docs]class IAuthProvider(IObject): allowed_methods: List[str]
[docs] def authenticate(self, method: 'IAuthMethod', login: str, password: str, **kwargs) -> Optional['IUser']: pass
[docs] def get_user(self, user_uid: str) -> Optional['IUser']: pass
[docs] def user_from_dict(self, d: dict) -> 'IUser': pass
[docs] def user_to_dict(self, u: 'IUser') -> dict: pass
[docs]class IClient(IObject): pass
[docs]class IDbProvider(IObject): pass
[docs]class ILayer(IObject): cache_uid: str can_render_box: bool can_render_svg: bool can_render_xyz: bool crs: str data_model: Optional['IModel'] default_search_provider: Optional['ISearchProvider'] description: str description_template: 'ITemplate' display: str edit_data_model: Optional['IModel'] edit_options: Data edit_style: Optional['IStyle'] extent: Optional['Extent'] geometry_type: Optional['GeometryType'] grid_uid: str has_cache: bool has_legend: bool has_search: bool image_format: str is_editable: bool is_group: bool is_public: bool layers: List['ILayer'] legend: 'LayerLegend' map: 'IMap' meta: 'MetaData' opacity: float own_bounds: Optional['Bounds'] ows_feature_name: str ows_name: str resolutions: List[float] style: 'IStyle' supports_wfs: bool supports_wms: bool templates: List['ITemplate'] title: str
[docs] def configure_legend(self) -> 'LayerLegend': pass
[docs] def configure_metadata(self, provider_meta=None) -> 'MetaData': pass
[docs] def edit_access(self, user): pass
[docs] def edit_operation(self, operation: str, feature_props: List['FeatureProps']) -> List['IFeature']: pass
[docs] def get_features(self, bounds: 'Bounds', limit: int = 0) -> List['IFeature']: pass
[docs] def mapproxy_config(self, mc): pass
[docs] def ows_enabled(self, service: 'IOwsService') -> bool: pass
[docs] def render_box(self, rv: 'MapRenderView', extra_params=None): pass
[docs] def render_html_legend(self, context=None) -> str: pass
[docs] def render_legend(self, context=None) -> Optional[str]: pass
[docs] def render_legend_image(self, context=None) -> bytes: pass
[docs] def render_svg(self, rv: 'MapRenderView', style: 'IStyle' = None) -> str: pass
[docs] def render_svg_tags(self, rv: 'MapRenderView', style: 'IStyle' = None) -> List['Tag']: pass
[docs] def render_xyz(self, x, y, z): pass
[docs]class IMap(IObject): bounds: 'Bounds' center: 'Point' coordinate_precision: float crs: 'Crs' extent: 'Extent' init_resolution: float layers: List['ILayer'] resolutions: List[float]
[docs]class IModel(IObject): attribute_names: List[str] geometry_crs: 'Crs' geometry_type: 'GeometryType' rules: List['ModelRule']
[docs] def apply(self, atts: List[Attribute]) -> List[Attribute]: pass
[docs] def apply_to_dict(self, d: dict) -> List[Attribute]: pass
[docs]class IMonitor(IObject): path_stats: dict watch_dirs: dict watch_files: dict
[docs] def add_directory(self, path, pattern): pass
[docs] def add_path(self, path): pass
[docs] def start(self): pass
[docs]class IOwsProvider(IObject): invert_axis_crs: List[str] meta: 'MetaData' operations: List['OwsOperation'] source_layers: List['SourceLayer'] supported_crs: List['Crs'] type: str url: 'Url' version: str
[docs] def find_features(self, args: 'SearchArgs') -> List['IFeature']: pass
[docs] def operation(self, name: str) -> 'OwsOperation': pass
[docs]class IOwsService(IObject): meta: 'MetaData' type: str version: str
[docs] def error_response(self, err: 'Exception') -> 'HttpResponse': pass
[docs] def handle(self, req: 'IRequest') -> 'HttpResponse': pass
[docs]class IPrinter(IObject): templates: List['ITemplate']
[docs]class IProject(IObject): api: Optional['IApi'] assets_root: Optional['DocumentRoot'] client: Optional['IClient'] locales: List[str] map: Optional['IMap'] meta: 'MetaData' overview_map: Optional['IMap'] printer: Optional['IPrinter'] templates: List['ITemplate'] title: str
[docs]class IRequest(IBaseRequest): auth: 'IAuthManager' session: 'ISession' user: 'IUser'
[docs] def acquire(self, klass: str, uid: str) -> Optional['IObject']: pass
[docs] def auth_close(self, res: 'IResponse'): pass
[docs] def auth_open(self): pass
[docs] def login(self, login: str, password: str): pass
[docs] def logout(self): pass
[docs] def require(self, klass: str, uid: str) -> 'IObject': pass
[docs] def require_layer(self, uid: str) -> 'ILayer': pass
[docs] def require_project(self, uid: str) -> 'IProject': pass
[docs]class IRootObject(IObject): all_objects: list all_types: dict application: 'IApplication' shared_objects: dict validator: 'SpecValidator'
[docs] def create(self, klass, cfg=None): pass
[docs] def create_object(self, klass, cfg, parent=None): pass
[docs] def create_shared_object(self, klass, uid, cfg): pass
[docs] def create_unbound_object(self, klass, cfg): pass
[docs] def find(self, klass, uid=None) -> 'IObject': pass
[docs] def find_all(self, klass=None) -> List['IObject']: pass
[docs] def find_by_uid(self, uid) -> 'IObject': pass
[docs] def find_first(self, klass) -> 'IObject': pass
[docs]class ISearchProvider(IObject): active: bool capabilties: int data_model: Optional['IModel'] templates: List['ITemplate'] tolerance: 'Measurement' with_geometry: bool with_keyword: bool
[docs] def can_run(self, args: 'SearchArgs'): pass
[docs] def context_shape(self, args: 'SearchArgs') -> 'IShape': pass
[docs] def run(self, layer: 'ILayer', args: 'SearchArgs') -> List['IFeature']: pass
[docs]class ITemplate(IObject): category: str data_model: Optional['IModel'] key: str legend_layer_uids: List[str] legend_mode: Optional['TemplateLegendMode'] map_size: 'Size' mime_types: List[str] page_size: 'Size' path: str subject: str text: str title: str
[docs] def add_headers_and_footers(self, context: dict, in_path: str, out_path: str, format: str) -> str: pass
[docs] def dpi_for_quality(self, quality): pass
[docs] def normalize_context(self, context: dict) -> dict: pass
[docs] def render(self, context: dict, mro: 'MapRenderOutput' = None, out_path: str = None, legends: dict = None, format: str = None) -> 'TemplateOutput': pass
[docs]class IWebSite(IObject): assets_root: 'DocumentRoot' cors: 'CorsOptions' error_page: Optional['ITemplate'] host: str reversed_host: str reversed_rewrite_rules: List['RewriteRule'] rewrite_rules: List['RewriteRule'] ssl: bool static_root: 'DocumentRoot'
[docs] def url_for(self, req, url): pass
[docs]class ISqlProvider(IDbProvider):
[docs] def describe(self, table: 'SqlTable') -> Dict[str, 'SqlTableColumn']: pass
[docs] def edit_operation(self, operation: str, table: 'SqlTable', features: List['IFeature']) -> List['IFeature']: pass
[docs] def select(self, args: 'SelectArgs', extra_connect_params: dict = None) -> List['IFeature']: pass
[docs]class IVectorLayer(ILayer):
[docs] def connect_feature(self, feature: 'IFeature') -> 'IFeature': pass