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

Rebranding (UN-5194) #79

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[report]
omit = Unfolded/qgis_plugin_tools/*
omit =
kepler/qgis_plugin_tools/*
Unfolded/*
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/__pycache__
**/*.pyc
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# sets up an "environment" tag for Sentry
- name: Set up a Sentry environment
run: |
sed -i "s/PLUGIN_ENVIRONMENT='local'/PLUGIN_ENVIRONMENT='production'/" Unfolded/sentry.py
sed -i "s/PLUGIN_ENVIRONMENT='local'/PLUGIN_ENVIRONMENT='production'/" kepler/sentry.py

- name: Install qgis-plugin-ci
run: pip3 install qgis-plugin-ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Run tests
run: >
docker run --rm --net=host --volume `pwd`:/app -w=/app -e QGIS_PLUGIN_IN_CI=1 qgis/qgis:${{ matrix.docker_tags }} sh -c
"pip3 install -q pytest pytest-cov && xvfb-run -s '+extension GLX -screen 0 1024x768x24'
pytest -v --cov=Unfolded --cov-report=xml"
"ls /app -lah && ls . -lah && rm -rf /app/Unfolded && pip3 install -q pytest pytest-cov && xvfb-run -s '+extension GLX -screen 0 1024x768x24'
pytest -vv --cov=kepler --cov-report=xml"
# Upload coverage report. Will not work if the repo is private
- name: Upload coverage to Codecov
if: ${{ matrix.docker_tags == 'latest' && !github.event.repository.private }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Unfolded/i18n
kepler/i18n
/.idea/
*.gpkg-shm
*.gpkg-wal
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "kepler/qgis_plugin_tools"]
path = kepler/qgis_plugin_tools
url = [email protected]:GispoCoding/qgis_plugin_tools.git
[submodule "Unfolded/qgis_plugin_tools"]
path = Unfolded/qgis_plugin_tools
url = https://github.com/GispoCoding/qgis_plugin_tools.git
4 changes: 2 additions & 2 deletions .qgis-plugin-ci
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugin_path: Unfolded
github_organization_slug: UnfoldedInc
plugin_path: kepler
github_organization_slug: foursquare
project_slug: qgis-plugin
transifex_coordinator: replace-me
transifex_organization: replace-me
33 changes: 2 additions & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
# CHANGELOG

### 1.0.5 - 09/06/2023
### 1.0.0 - 21/07/2023

* Additional bug fixes

### 1.0.4 - 29/05/2023

* Support for additional symbols: Logarithmic, Pretty Breaks and Natural Breaks (Jenks)
* Several bugfixes

### 1.0.3 - 03/03/2023

* Update Studio map import URL

### 1.0.2 - 28/06/2021

* Fixed support for QGIS 3.20
* Fixed encoding issues on Windows

### 1.0.1 - 25/03/2021

* Changed CSV separator to comma
* Improved UI
* <a href="https://github.com/UnfoldedInc/qgis-plugin/compare/1.0.0...1.0.1">Full Changelog</a>

### 1.0.0 - 24/03/2021

* Initial configuration export functionality
* Support for points, lines and polygons
* Support for single symbol styles
* Support for graduated and categorized styles
* Multithreading support
* <a href="https://github.com/UnfoldedInc/qgis-plugin/compare/1.0.0-rc1...1.0.0">Full Changelog</a>
* Initial version

###
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Unfolded QGIS plugin
# kepler QGIS plugin by Foursquare
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# kepler QGIS plugin by Foursquare
# kepler.gl QGIS plugin by Foursquare


![](https://github.com/UnfoldedInc/qgis-plugin/workflows/Tests/badge.svg)
[![codecov.io](https://codecov.io/github/UnfoldedInc/qgis-plugin/coverage.svg?branch=main)](https://codecov.io/github/UnfoldedInc/qgis-plugin?branch=main)
![](https://github.com/UnfoldedInc/qgis-plugin/workflows/Release/badge.svg)
![](https://github.com/foursquare/qgis-plugin/workflows/Tests/badge.svg)
[![codecov.io](https://codecov.io/github/foursquare/qgis-plugin/coverage.svg?branch=main)](https://codecov.io/github/foursquare/qgis-plugin?branch=main)
![](https://github.com/foursquare/qgis-plugin/workflows/Release/badge.svg)

<img src="docs/imgs/foursquare-logo.png" height="100">

This plugin exports [QGIS](http://qgis.org/) vector layers into a format that can be imported into [Unfolded Studio](https://studio.unfolded.ai/) for further analysis or one-click publishing to the web, after signing up for a free [Unfolded](https://unfolded.ai/) account.
This plugin exports [QGIS](http://qgis.org/) vector layers into a format that can be imported into [Foursquare Studio](https://studio.foursquare.com/) for further analysis or one-click publishing to the web, after signing up for a free [Foursquare Studio](https://studio.foursquare.com/) account.
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to expand this to talk about both Foursquare and kepler.gl. Probably best to work on this in a Google Doc before a PR, copy the current text into a Google Doc and we can collaborate on that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created a "README.md" section within rebranding RFC doc.


# Documentation

This readme contains a short overview of basic functionality of the plugin. Full documentation is available at [docs.unfolded.ai](https://docs.unfolded.ai/integrations/qgis).
This readme contains a short overview of basic functionality of the plugin. Full documentation is available at [location.foursquare.com/studio/docs](https://location.foursquare.com/studio/docs/integrations-qgis).

## Requirements

Expand All @@ -28,25 +28,25 @@ User can export any vector data format that
is [supported in QGIS](https://docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/index.html) and the data can
be in any known coordinate reference system as it is automatically reprojected (to EPSG:4326) during export.

Layer geometries and styles are exported in to a single ZIP configuration file, which can then be imported to Unfolded
Layer geometries and styles are exported in to a single ZIP configuration file, which can then be imported to Foursquare
Studio.

Before opening the plugin, users add their datasets to QGIS in the normal way (see
e.g. [QGIS tutorials](https://www.qgistutorials.com/en/)), perform some data processing tasks if necessary and add
cartographic styling for the vector layers.

After the user is satisfied with their result and the plugin has been installed, the `Unfolded` plugin can now be opened
After the user is satisfied with their result and the plugin has been installed, the `kepler` plugin can now be opened
under the *Web* tab in QGIS. It opens a new window, which lets the user control the map export process.

![Main plugin dialog](docs/imgs/main_dialog.png)

- **Layer Selection** - If a project contains multiple layers, user can select which layers should be exported and which
should be visible by default (note layers are preserved in the exported map and the user can control layer visibility
in Unfolded Studio after importing the map).
in Foursquare Studio after importing the map).

- **Basemap Selection** - In the main *Export* tab the user can also select which type of basemap they want to use and
which Unfolded Studio functionality (e.g. brushing, geocoding) that the exported interactive map should offer. All of
these values can be changed after import into Unfolded Studio.
which Foursquare Studio functionality (e.g. brushing, geocoding) that the exported interactive map should offer. All of
these values can be changed after import into Foursquare Studio.

- **Interactive Features** - In the *Settings* tab user can define where they want the exported configuration file to be
exported on their local disk. A user can also add their personal MapBox API key if they wish to add MapBox basemaps to
Expand Down
22 changes: 11 additions & 11 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Instructions were confirmed to be working well with a combination of: Python 3.9
2. We rely on [qgis_plugin_tools](https://github.com/GispoCoding/qgis_plugin_tools), so when cloning the repo, make sure to clone it recursively, with submodules:

```bash
git clone --recurse-submodules https://github.com/UnfoldedInc/qgis-plugin.git
git clone --recurse-submodules https://github.com/foursquare/qgis-plugin.git
```

3. Set up tools:
Expand Down Expand Up @@ -42,20 +42,20 @@ export PYTHONPATH=/Applications/Qgis.app/Contents/Resources/python # this makes

6. The build script:

If you're on Mac, you want to comment out the lines #70 and #71 in `qgis-plugin/Unfolded/qgis_plugin_tools/infrastructure/plugin_maker.py`. This is because Apple returns `"darwin"` as a OS identifier, so this OS check mistakenly thinks it's a Windows machine, and instead, we just let it fall through to the actual case for Mac.
If you're on Mac, you want to comment out the lines #70 and #71 in `qgis-plugin/kepler/qgis_plugin_tools/infrastructure/plugin_maker.py`. This is because Apple returns `"darwin"` as a OS identifier, so this OS check mistakenly thinks it's a Windows machine, and instead, we just let it fall through to the actual case for Mac.

Now you can run the build script and deploy it to the QGIS' plugins folder:

```bash
cd qgis-plugin/Unfolded
cd qgis-plugin/kepler
python3 build.py deploy
```

This should be the end of your setup and if you manage to run `build.py` script without any errors, that's a confirmation that everything is set up correctly.

## Development workflow

- make changes to the plugin inside `/Unfolded` folder
- make changes to the plugin inside `/kepler` folder
- run `python3 build.py deploy`, this packages the plugin and copies it to the QGIS' plugins folder (usually `/Users/<username>/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins`; or see [plugin's dir location](https://gis.stackexchange.com/questions/274311/qgis-3-plugin-folder-location))
- this does not publish the plugin to the official plugin registry, just installs it locally! (for releasing it to the remote registry, see [Creating a release](#creating-a-release) section)
- additionally, you can set up a filesystem watcher to monitor entire folder and automatically execute the deploy command so you don't have to do it manually every time
Expand All @@ -77,14 +77,14 @@ For debugging, use:
- also consider adding this config line to your `.vscode/settings.json` (this makes sure it can find `qgis` module as well):
```json
{
"python.analysis.extraPaths": ["./kepler", "./keplergl", "./Unfolded", "/Applications/Qgis.app/Contents/Resources/python", "/Applications/Qgis.app/Contents/Resources", "${userHome}/.pyenv/versions/3.9.5/lib/python3.9/site-packages", "${userHome}/.pyenv/shims/pytest"]
"python.analysis.extraPaths": ["./kepler", "./keplergl", "./kepler", "/Applications/Qgis.app/Contents/Resources/python", "/Applications/Qgis.app/Contents/Resources", "${userHome}/.pyenv/versions/3.9.5/lib/python3.9/site-packages", "${userHome}/.pyenv/shims/pytest"]
}
```

Another useful thing is to have both versions of the plugin installed - the current, officially available version and your development version:
- install the regular version from the registry
- before running `python3 build.py deploy` script, update `name` in `metadata.txt` to something like `name=Unfolded-dev`
- now when you run the script, a new plugin with `Unfolded-dev` name will appear along side the regular one in the QGIS plugins directory and plugins listing
- before running `python3 build.py deploy` script, update `name` in `metadata.txt` to something like `name=kepler-dev`
- now when you run the script, a new plugin with `kepler-dev` name will appear along side the regular one in the QGIS plugins directory and plugins listing
- ❗️ don't commit these changes to `metadata.txt` when doing a release (unless that's your actual intention ofc; this is just for development), just keep them in git's unstaged changes e.g.
- you can also update icon and naming in other places to help differentiate it

Expand All @@ -100,9 +100,9 @@ If you create or edit source files make sure that:

from ..utils.exceptions import TestException # Good

from Unfolded.utils.exceptions import TestException # Bad
from kepler.utils.exceptions import TestException # Bad
```
* they will be found by [build.py](../Unfolded/build.py) script (`py_files` and `ui_files` values)
* they will be found by [build.py](../kepler/build.py) script (`py_files` and `ui_files` values)
* you consider adding test files for the new functionality

## QGIS documentation and help
Expand Down Expand Up @@ -136,7 +136,7 @@ in [.qgis-plugin-ci](../.qgis-plugin-ci) to use Transifex translation.
* Go to your Transifex site, add some languages and start translating
* Copy [push_translations.yml](push_translations.yml) file to [workflows](../.github/workflows) folder to enable
automatic pushing after commits to master
* Add this badge ![](https://github.com/UnfoldedInc/qgis-plugin/workflows/Translations/badge.svg) to
* Add this badge ![](https://github.com/foursquare/qgis-plugin/workflows/Translations/badge.svg) to
the [README](../README.md)

##### Pulling
Expand All @@ -148,7 +148,7 @@ You can however pull manually to test the process.

#### Translating with QT Linguistic (if Transifex not available)

The translation files are in [i18n](../Unfolded/resources/i18n) folder. Translatable content in python files is code
The translation files are in [i18n](../kepler/resources/i18n) folder. Translatable content in python files is code
such as `tr(u"Hello World")`.

To update language *.ts* files to contain newest lines to translate, run
Expand Down
15 changes: 15 additions & 0 deletions kepler/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
indent_style = space
indent_size = 4

[*.ui]
indent_size = 2
max_line_length = 100000
4 changes: 4 additions & 0 deletions kepler/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gitattributes export-ignore
.editorconfig export-ignore
test export-ignore

31 changes: 31 additions & 0 deletions kepler/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Gispo Ltd., hereby disclaims all copyright interest in the program Foursquare
# Copyright (C) 2021 Gispo Ltd (https://www.gispo.fi/).
#
#
# This file is part of kepler QGIS plugin by Foursquare.
#
# kepler QGIS plugin by Foursquare 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.
#
# kepler QGIS plugin by Foursquare 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 kepler QGIS plugin by Foursquare. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>.

import os

from .qgis_plugin_tools.infrastructure.debugging import setup_pydevd

if os.environ.get('QGIS_PLUGIN_USE_DEBUGGER') == 'pydevd':
if os.environ.get('IN_TESTS', "0") != "1" and os.environ.get('QGIS_PLUGIN_IN_CI', "0") != "1":
setup_pydevd()


def classFactory(iface):
from .plugin import Plugin
return Plugin(iface)
42 changes: 42 additions & 0 deletions kepler/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Gispo Ltd., hereby disclaims all copyright interest in the program kepler QGIS plugin by Foursquare
# Copyright (C) 2021 Gispo Ltd (https://www.gispo.fi/).
#
#
# This file is part of kepler QGIS plugin by Foursquare.
#
# kepler QGIS plugin by Foursquare 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.
#
# kepler QGIS plugin by Foursquare 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 kepler QGIS plugin by Foursquare. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>.

import glob

from qgis_plugin_tools.infrastructure.plugin_maker import PluginMaker

'''
#################################################
# Edit the following to match the plugin
#################################################
'''

py_files = [fil for fil in glob.glob("**/*.py", recursive=True) if "test/" not in fil]
locales = ['fi']
profile = 'default'
ui_files = list(glob.glob("**/*.ui", recursive=True))
resources = list(glob.glob("**/*.qrc", recursive=True))
extra_dirs = ["resources"]
compiled_resources = []

PluginMaker(py_files=py_files, ui_files=ui_files, resources=resources, extra_dirs=extra_dirs,
compiled_resources=compiled_resources, locales=locales, profile=profile)
10 changes: 5 additions & 5 deletions Unfolded/test/__init__.py → kepler/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Gispo Ltd., hereby disclaims all copyright interest in the program Unfolded QGIS plugin
# Gispo Ltd., hereby disclaims all copyright interest in the program kepler QGIS plugin by Foursquare
# Copyright (C) 2021 Gispo Ltd (https://www.gispo.fi/).
#
#
# This file is part of Unfolded QGIS plugin.
# This file is part of kepler QGIS plugin by Foursquare.
#
# Unfolded QGIS plugin is free software: you can redistribute it and/or modify
# kepler QGIS plugin by Foursquare 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.
#
# Unfolded QGIS plugin is distributed in the hope that it will be useful,
# kepler QGIS plugin by Foursquare 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 Unfolded QGIS plugin. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>.
# along with kepler QGIS plugin by Foursquare. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>.
Loading