-
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.
- Loading branch information
Joonalai
committed
Feb 19, 2021
1 parent
ec59334
commit a669f1c
Showing
19 changed files
with
366 additions
and
207 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
/*************************************************************************** | ||
GlobeBuilder | ||
A QGIS plugin | ||
This plugin adds Globe view | ||
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ | ||
------------------- | ||
begin : 2020-01-10 | ||
copyright : (C) 2020 by Gispo Ltd. | ||
email : [email protected] | ||
git sha : $Format:%H$ | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
This script initializes the plugin, making it known to QGIS. | ||
""" | ||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import os | ||
|
||
|
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,18 @@ | ||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. |
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 |
---|---|---|
@@ -1,25 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
/*************************************************************************** | ||
GlobeBuilder | ||
A QGIS plugin | ||
This plugin adds Globe view | ||
------------------- | ||
begin : 2020-01-22 | ||
git sha : $Format:%H$ | ||
copyright : (C) 2020 by Gispo Ltd. | ||
email : [email protected] | ||
***************************************************************************/ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
""" | ||
|
||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import logging | ||
import os | ||
|
||
|
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 |
---|---|---|
@@ -1,24 +1,21 @@ | ||
""" | ||
/*************************************************************************** | ||
GlobeBuilder | ||
A QGIS plugin | ||
This plugin adds Globe view | ||
------------------- | ||
begin : 2020-09-22 | ||
git sha : $Format:%H$ | ||
copyright : (C) 2020 by Gispo Ltd. | ||
email : [email protected] | ||
***************************************************************************/ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
""" | ||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
from PyQt5.QtGui import QColor | ||
from qgis.core import (QgsProcessingFeedback, QgsVectorLayer, QgsFillSymbol, | ||
|
@@ -61,10 +58,12 @@ def _set_styles(layer, stroke_color): | |
fill_color.setAlpha(0) | ||
fill_symbol_layer.setFillColor(fill_color) | ||
fill_symbol_layer.setStrokeColor(stroke_color) | ||
# noinspection PyUnresolvedReferences | ||
renderer.setSymbol(fill_symbol) | ||
layer.triggerRepaint() | ||
|
||
def _create_graticule_layer(self, tmp_grid_layer) -> QgsVectorLayer: | ||
# noinspection PyUnresolvedReferences | ||
import processing | ||
params = { | ||
'INPUT': tmp_grid_layer, | ||
|
@@ -75,6 +74,7 @@ def _create_graticule_layer(self, tmp_grid_layer) -> QgsVectorLayer: | |
return layer | ||
|
||
def _create_grid_layer(self) -> QgsVectorLayer: | ||
# noinspection PyUnresolvedReferences | ||
import processing | ||
params = {'CRS': WGS84, | ||
'EXTENT': '-180,180,-90,90 [EPSG:4326]', 'HOVERLAY': 0, 'HSPACING': self.spacing, | ||
|
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 |
---|---|---|
@@ -1,28 +1,26 @@ | ||
""" | ||
/*************************************************************************** | ||
GlobeBuilder | ||
A QGIS plugin | ||
This plugin adds Globe view | ||
------------------- | ||
begin : 2020-09-22 | ||
git sha : $Format:%H$ | ||
copyright : (C) 2020 by Gispo Ltd. | ||
email : [email protected] | ||
***************************************************************************/ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
""" | ||
from qgis.gui import QgisInterface | ||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
from qgis.core import (QgsFillSymbol, QgsEffectStack, QgsDropShadowEffect, QgsInnerShadowEffect, | ||
QgsGeometryGeneratorSymbolLayer, QgsVectorLayer, QgsFeature, QgsGeometry, QgsPointXY, | ||
QgsCoordinateTransform, QgsProject) | ||
from qgis.gui import QgisInterface | ||
|
||
from ..definitions.projections import Projections | ||
from ..definitions.settings import (TRANSPARENT_COLOR, HaloDrawMethod, EARTH_RADIUS, DEFAULT_HALO_DRAW_METHOD, | ||
|
@@ -55,8 +53,8 @@ def create_halo_layer(self, use_effects, stroke_color, fill_color=None): | |
self.iface.mainWindow().blockSignals(False) | ||
|
||
feature = QgsFeature() | ||
# noinspection PyArgumentList | ||
if self.projection == Projections.AZIMUTHAL_ORTHOGRAPHIC: | ||
# noinspection PyArgumentList | ||
geom = QgsGeometry.fromPointXY(QgsPointXY(self.origin['lat'], self.origin['lon'])) | ||
if draw_method == HaloDrawMethod.buffered_point: | ||
geom = geom.buffer(EARTH_RADIUS, DEFAULT_NUMBER_OF_SEGMENTS) | ||
|
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,18 @@ | ||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. |
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 |
---|---|---|
@@ -1,25 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
/*************************************************************************** | ||
GlobeBuilder | ||
A QGIS plugin | ||
This plugin adds Globe view | ||
------------------- | ||
begin : 2020-01-23 | ||
git sha : $Format:%H$ | ||
copyright : (C) 2020 by Gispo Ltd. | ||
email : [email protected] | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
""" | ||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import json | ||
import logging | ||
|
||
|
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 |
---|---|---|
@@ -1,25 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
/*************************************************************************** | ||
GlobeBuilder | ||
A QGIS plugin | ||
This plugin adds Globe view | ||
------------------- | ||
begin : 2020-01-22 | ||
git sha : $Format:%H$ | ||
copyright : (C) 2020 by Gispo Ltd. | ||
email : [email protected] | ||
***************************************************************************/ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
""" | ||
|
||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
from qgis.core import QgsPrintLayout, QgsFillSymbol, QgsRuleBasedRenderer, QgsFeatureRequest, \ | ||
QgsCoordinateTransformContext, QgsCoordinateTransform | ||
|
||
|
@@ -42,7 +41,7 @@ def create_layout(layout_name, qgis_instance): | |
|
||
|
||
def set_selection_based_style(layer, s_color, else_color): | ||
# noinspection PyCallByClass | ||
# noinspection PyCallByClass,PyArgumentList | ||
fill_for_selected = QgsFillSymbol.createSimple({'color': 'blue'}) | ||
fill_for_selected.setColor(s_color) | ||
rule_s = QgsRuleBasedRenderer.Rule(fill_for_selected, label=tr(u"Selected"), | ||
|
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,18 @@ | ||
# Gispo Ltd., hereby disclaims all copyright interest in the program GlobeBuilder | ||
# Copyright (C) 2020-2021 Gispo Ltd (https://www.gispo.fi/). | ||
# | ||
# | ||
# This file is part of GlobeBuilder. | ||
# | ||
# GlobeBuilder is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# GlobeBuilder is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GlobeBuilder. If not, see <https://www.gnu.org/licenses/>. |
Oops, something went wrong.