11 | Your QGIS plugin directory is located at:
12 | /Users/arthurrufhosangdacosta/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
13 |
14 |
35 | For information on writing PyQGIS code, see http://loc8.cc/pyqgis_resources for a list of resources. 36 |
37 |39 | ©2011-2019 GeoApt LLC - geoapt.com 40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 3D City Builder 2 | This QGIS Plugin generates 3D Models of Urban Areas using Aerial Imagery (Satellite Image), DTM (Digital Terrain Model), DSM (Digital Surface Model) and a Footprint layer (the contour of the buildings) from both, files stored on your computer and online. 3 | 4 | This plugin requires QGIS 3.0 or superior 5 | 6 | To see it on QGIS Plugin Repository, go to: https://plugins.qgis.org/plugins/citygen/ 7 | 8 | If you want to help in this project I'll be glad :D 9 | Plus, if you have any suggestins, please, let me know :D 10 | 11 | I appreciate any help to make this code compliant with PEP8. 12 | 13 | **Vienna, Austria** 14 |  15 | 16 | **Cities of Itajaí and Navegantes, Santa Catarina, Brazil** 17 |  18 | 19 | 20 | ## Installing 21 | 22 | "Stable" releases are available through the official QGIS plugins repository. 23 | 24 | 1. In QGIS 3 select Plugins->Manage and Install Plugins... 25 | 2. On the sidebar go to `Settings` and check the `Show also experimental plugins` checkbox 26 | 3. Now, go to `All` on the sidebar and search for `3D City Generator`. Select the plugin and click `Install Plugin` 27 | 28 | After installing the plugin, please run these commands on the terminal 29 | ```shell script 30 | brew reinstall libcapn 31 | brew install capnp 32 | brew install spatialindex 33 | ``` 34 | 35 | Opitionally, you can run these commands on the QGIS Python 36 | ```shell script 37 | python3 -m pip install geopandas numpy osmnx 38 | ``` 39 | Opitionally, you can follow the steps under https://landscapearchaeology.org/2018/installing-python-packages-in-qgis-3-for-windows/ to install the following libraries on QGIS Python: geopandas numpy osmnx. 40 | 41 | ## Using 42 | 43 | To run the 3D City Generator, just follow this steps: 44 | 1. Go to the menu `Plugins >> citygen >> 3D City Generator` to open the plugin. 45 | 2. Fill the information on `Definitions` and `Advanced` tabs. Then click `Run`. 46 | 3. Close the Plugins' window, go to `View >> New 3D Map View` 47 | 4. Have fun :D 48 | 49 | Animation demonstrating how to use this Plugin 50 |  51 | 52 | 53 | A sample dataset is available to: 54 | To make it easier for you to test this plugin, we've made available a sample dataset: 55 | * Vienna, Austria: https://3dcitygen-test-dataset.s3.amazonaws.com/test-dataset-vienna.zip 56 | 57 | 58 | ## Development 59 | 60 | You can use `make` to assist you while developing. 61 | 62 | The following rules can be useful: 63 | * `make deploy`: will automatically copy the required files to your QGIS plugins' folder. **BEWARE:** *it only works out-of-the-box for macOS. For other operating systems you might have to change the `QGISDIR` variable in `Makefile`.* 64 | * `make package VERSION=GIT_REF`: (where *GIT_REF* is a branch, tag or any other git ref) will make a zip package to be installed manually from QGIS or uploaded to the QGIS plugins' repository. 65 | 66 | ## License 67 | The project is licensed under the GNU GPLv2 license. 68 | 69 | You are free to download, modify and redistribute this plugin, since you reference this repo ;D 70 | 71 | 72 | **Third Party Licences** 73 | * geopandas: © GeoPandas - BSD Licence (https://geopandas.org/) 74 | * numpy: © NumPy - BSD Licence (https://www.numpy.org) 75 | * osmnx: © OSMnx - MIT Licence (https://github.com/gboeing/osmnx) 76 | 77 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Plugin Builder Results 2 | 3 | Your plugin citygen was created in: 4 | /Volumes/TarDisk/ruf/workspace/ttc/3dcitygen/citygen/citygen 5 | 6 | Your QGIS plugin directory is located at: 7 | /Users/arthurrufhosangdacosta/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins 8 | 9 | What's Next: 10 | 11 | * Copy the entire directory containing your new plugin to the QGIS plugin 12 | directory 13 | 14 | * Compile the resources file using pyrcc5 15 | 16 | * Run the tests (``make test``) 17 | 18 | * Test the plugin by enabling it in the QGIS plugin manager 19 | 20 | * Customize it by editing the implementation file: ``citygen.py`` 21 | 22 | * Create your own custom icon, replacing the default icon.png 23 | 24 | * Modify your user interface by opening citygen_dialog_base.ui in Qt Designer 25 | 26 | * You can use the Makefile to compile your Ui and resource files when 27 | you make changes. This requires GNU make (gmake) 28 | 29 | For more information, see the PyQGIS Developer Cookbook at: 30 | http://www.qgis.org/pyqgis-cookbook/index.html 31 | 32 | (C) 2011-2018 GeoApt LLC - geoapt.com 33 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | /*************************************************************************** 4 | citygen 5 | A QGIS plugin 6 | A plugin to generate 3D models of urban areas 7 | Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ 8 | ------------------- 9 | begin : 2020-04-30 10 | copyright : (C) 2020 by Arthur Ruf Hosang da Costa 11 | email : arthur.rhc@gmail.com 12 | git sha : $Format:%H$ 13 | ***************************************************************************/ 14 | 15 | /*************************************************************************** 16 | * * 17 | * This program is free software; you can redistribute it and/or modify * 18 | * it under the terms of the GNU General Public License as published by * 19 | * the Free Software Foundation; either version 2 of the License, or * 20 | * (at your option) any later version. * 21 | * * 22 | ***************************************************************************/ 23 | This script initializes the plugin, making it known to QGIS. 24 | """ 25 | 26 | 27 | # noinspection PyPep8Naming 28 | def classFactory(iface): # pylint: disable=invalid-name 29 | """Load citygen class from file citygen. 30 | 31 | :param iface: A QGIS interface instance. 32 | :type iface: QgsInterface 33 | """ 34 | # 35 | from .citygen_loader import citygen 36 | return citygen(iface) 37 | -------------------------------------------------------------------------------- /citygen_dialog.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | /*************************************************************************** 4 | citygenDialog 5 | A QGIS plugin 6 | A plugin to generate 3D models of urban areas 7 | Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ 8 | ------------------- 9 | begin : 2020-04-30 10 | git sha : $Format:%H$ 11 | copyright : (C) 2020 by Arthur Ruf Hosang da Costa 12 | email : arthur.rhc@gmail.com 13 | ***************************************************************************/ 14 | 15 | /*************************************************************************** 16 | * * 17 | * This program is free software; you can redistribute it and/or modify * 18 | * it under the terms of the GNU General Public License as published by * 19 | * the Free Software Foundation; either version 2 of the License, or * 20 | * (at your option) any later version. * 21 | * * 22 | ***************************************************************************/ 23 | """ 24 | 25 | import os 26 | 27 | from qgis.PyQt import uic 28 | from qgis.PyQt import QtWidgets 29 | 30 | # This loads your .ui file so that PyQt can populate your plugin with the elements from Qt Designer 31 | FORM_CLASS, _ = uic.loadUiType(os.path.join( 32 | os.path.dirname(__file__), 'citygen_dialog_base.ui')) 33 | 34 | 35 | class citygenDialog(QtWidgets.QDialog, FORM_CLASS): 36 | def __init__(self, parent=None): 37 | """Constructor.""" 38 | super(citygenDialog, self).__init__(parent) 39 | # Set up the user interface from Designer through FORM_CLASS. 40 | # After self.setupUi() you can access any designer object by doing 41 | # self.