├── LICENSE.txt ├── README.md ├── __init__.py ├── assets ├── icon.png └── icon.svg ├── cartogram.py ├── cartogram_dialog.py ├── cartogram_dialog.ui ├── cartogram_feature.py ├── cartogram_worker.py ├── demo ├── demo.dbf ├── demo.prj ├── demo.qpj ├── demo.shp └── demo.shx ├── i18n └── da.qm ├── metadata.txt └── resources_rc.py /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | QGIS Cartogram 2 | ============== 3 | 4 | [![Code Climate](https://codeclimate.com/github/informeren/qgis-cartogram/badges/gpa.svg)](https://codeclimate.com/github/informeren/qgis-cartogram) 5 | 6 | A QGIS plugin for creating cartograms based on polygon layers. 7 | 8 | This plugin is an updated version of the [cartogram plugin](https://github.com/carsonfarmer/cartogram) by Carson Farmer which is based on an algorithm proposed in the following paper: 9 | 10 | > Dougenik, J. A, N. R. Chrisman, and D. R. Niemeyer. 1985. "An algorithm to construct continuous cartograms." Professional Geographer 37:75-81 11 | 12 | ![Cartogram created from the included demo data](https://github.com/informeren/qgis-cartogram/raw/develop/assets/cartogram.png) 13 | 14 | This plugin is based on the template provided by the [Plugin Builder](https://plugins.qgis.org/plugins/pluginbuilder/) QGIS plugin. 15 | 16 | 17 | Try it out 18 | ---------- 19 | 20 | To see the plugin in action simply import the demo data included with the plugin (*Vector → Cartogram → Add demo layer*). Then you can click the Cartogram button on the toolbar or select *Vector → Cartogram → Create cartogram*. 21 | 22 | ![Configure the cartogram creator](https://github.com/informeren/qgis-cartogram/raw/develop/assets/screenshot-setup.png) 23 | 24 | Select the newly added demo layer and the *VOTERS* field and set the number of iterations to 5. When you click OK the cartogram will be generated in the background. 25 | 26 | ![Cartogram being generated](https://github.com/informeren/qgis-cartogram/raw/develop/assets/screenshot-working.png) 27 | 28 | When the cartogram has been generated it is automatically added to your canvas so you can continue working with it or export it in any of the file formats supported by QGIS. 29 | 30 | 31 | Limitations 32 | ----------- 33 | 34 | The algorithm only supports positive values as the basis for creating the cartograms. If your dataset contains zero or NULL values, we try to create suitable replacement values to make it possible to render a cartogram anyway. 35 | 36 | 37 | Further reading 38 | --------------- 39 | 40 | * [Search for 'An algorithm to construct continuous cartograms' on Google Scholar](https://scholar.google.dk/scholar?q=an+algorithm+to+construct+continuous+area+cartograms) 41 | * [Constructing Contiguous Area Cartogram uUsing ArcView Avenue](http://proceedings.esri.com/library/userconf/proc99/proceed/papers/pap489/p489.htm) 42 | * [def CreateRubberSheetCartogram](http://indiemaps.com/blog/2008/03/def-createrubbersheetcartogram/) 43 | 44 | 45 | License 46 | ------- 47 | 48 | QGIS Cartogram – a plugin for creating cartograms from polygon layers 49 | Copyright (C) 2015 Morten Wulff 50 | Copyright (C) 2013 Carson Farmer 51 | 52 | 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. 53 | 54 | This program 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. 55 | 56 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 57 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | """Plugin entry point.""" 2 | 3 | 4 | # noinspection PyPep8Naming 5 | def classFactory(iface): # pylint: disable=invalid-name 6 | """Load Cartogram class from file cartogram.""" 7 | from .cartogram import Cartogram 8 | return Cartogram(iface) 9 | -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/informeren/qgis-cartogram/6e9b381cb4610bcca7f71d127c547f9af4867a13/assets/icon.png -------------------------------------------------------------------------------- /assets/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 20 | Natural Earth Raster 22 | 42 | 48 | 49 | 51 | 52 | 54 | image/svg+xml 55 | 57 | Natural Earth Raster 58 | 60 | 2015-08-10 61 | 62 | 63 | Morten Wulff 64 | 65 | 66 | 67 | 68 | Morten Wulff 69 | 70 | 71 | 72 | 73 | Dagbladet Information 74 | 75 | 76 | 77 | 78 | icon 79 | earth 80 | globe 81 | 82 | 83 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 97 | 98 | 99 | 101 | 107 | 111 | 115 | 119 | 123 | 129 | 130 | -------------------------------------------------------------------------------- /cartogram.py: -------------------------------------------------------------------------------- 1 | from PyQt4.QtCore import (Qt, QCoreApplication, QPyNullVariant, QSettings, 2 | QThread, QTranslator, qVersion) 3 | from PyQt4.QtGui import (QAction, QPushButton, QDialog, QIcon, QLabel, 4 | QMessageBox, QProgressBar) 5 | from qgis.core import (QGis, QgsDistanceArea, QgsGeometry, QgsMapLayer, 6 | QgsMapLayerRegistry, QgsMessageLog, QgsPoint, QgsVectorFileWriter, 7 | QgsVectorLayer) 8 | from qgis.gui import QgsFieldProxyModel, QgsMapLayerProxyModel, QgsMessageBar 9 | 10 | from cartogram_dialog import CartogramDialog 11 | from cartogram_worker import CartogramWorker 12 | 13 | import math 14 | import os.path 15 | import resources_rc 16 | 17 | 18 | class Cartogram: 19 | """QGIS Plugin Implementation.""" 20 | 21 | def __init__(self, iface): 22 | """Constructor. 23 | 24 | :param iface: An interface instance that will be passed to this class 25 | which provides the hook by which you can manipulate the QGIS 26 | application at run time. 27 | :type iface: QgsInterface 28 | """ 29 | 30 | # save reference to the QGIS interface 31 | self.iface = iface 32 | 33 | # initialize plugin directory 34 | self.plugin_dir = os.path.dirname(__file__) 35 | 36 | # initialize locale 37 | locale = QSettings().value('locale/userLocale')[0:2] 38 | locale_path = os.path.join( 39 | self.plugin_dir, 40 | 'i18n', 41 | '{}.qm'.format(locale)) 42 | 43 | if os.path.exists(locale_path): 44 | self.translator = QTranslator() 45 | self.translator.load(locale_path) 46 | 47 | if qVersion() > '4.3.3': 48 | QCoreApplication.installTranslator(self.translator) 49 | 50 | # declare instance attributes 51 | self.action = None 52 | self.menu = self.tr('&Cartogram') 53 | 54 | def initGui(self): 55 | """Create the menu entries and toolbar icons inside the QGIS GUI.""" 56 | 57 | # create action to display the settings dialog 58 | self.run_action = QAction( 59 | QIcon(':/plugins/cartogram/assets/icon.png'), 60 | self.tr('Create cartogram...'), 61 | self.iface.mainWindow()) 62 | 63 | self.demo_action = QAction( 64 | self.tr('Add demo layer'), 65 | self.iface.mainWindow()) 66 | 67 | # connect the actions to their respective methods 68 | self.run_action.triggered.connect(self.run) 69 | self.demo_action.triggered.connect(self.demo) 70 | 71 | # add toolbar button and menu items 72 | self.iface.addToolBarIcon(self.run_action) 73 | self.iface.addPluginToVectorMenu(self.menu, self.run_action) 74 | self.iface.addPluginToVectorMenu(self.menu, self.demo_action) 75 | 76 | def unload(self): 77 | """Removes the plugin menu item and icon from the QGIS GUI.""" 78 | self.iface.removePluginVectorMenu('&Cartogram', self.run_action) 79 | self.iface.removePluginVectorMenu('&Cartogram', self.demo_action) 80 | self.iface.removeToolBarIcon(self.run_action) 81 | 82 | def run(self): 83 | """Makes a few sanity checks and prepares the worker thread.""" 84 | 85 | # create the dialog (after translation) and keep reference 86 | self.dialog = CartogramDialog() 87 | 88 | # make sure we have at least one vector layer to work on 89 | count = self.count_vector_layers() 90 | if count == 0: 91 | message = self.tr('You need at least one vector layer to create a ' 92 | 'cartogram.') 93 | self.iface.messageBar().pushMessage('Error', message, 94 | level=QgsMessageBar.CRITICAL, duration=5) 95 | return False 96 | 97 | # we are only interested in polygon layers and numeric fields 98 | self.dialog.sourceLayerCombo.setFilters( 99 | QgsMapLayerProxyModel.PolygonLayer) 100 | self.dialog.sourceFieldCombo.setFilters(QgsFieldProxyModel.Numeric) 101 | 102 | # select the first layer in the list and notify the field combobox 103 | self.dialog.sourceLayerCombo.setCurrentIndex(0) 104 | currentLayer = self.dialog.sourceLayerCombo.currentLayer() 105 | self.dialog.sourceLayerCombo.layerChanged.emit(currentLayer) 106 | 107 | # connect some odds and ends 108 | self.dialog.buttonBox.accepted.connect(self.validate) 109 | 110 | # show the dialog 111 | self.dialog.show() 112 | result = self.dialog.exec_() 113 | if result == QDialog.Rejected: 114 | return False 115 | 116 | input_layer_name = self.dialog.sourceLayerCombo.currentText() 117 | input_layer = self.get_vector_layer_by_name(input_layer_name) 118 | input_field = self.dialog.sourceFieldCombo.currentText() 119 | iterations = self.dialog.iterationsSpinBox.value() 120 | 121 | memory_layer = self.create_memory_layer(input_layer) 122 | memory_layer_data_provider = memory_layer.dataProvider() 123 | 124 | self.worker_start(memory_layer, input_field, iterations) 125 | 126 | def demo(self): 127 | path = os.path.join(self.plugin_dir, 'demo', 'demo.shp') 128 | 129 | layer = QgsVectorLayer(path, 'Cartogram demo layer', 'ogr') 130 | QgsMapLayerRegistry.instance().addMapLayer(layer) 131 | 132 | def worker_start(self, layer, field_name, iterations): 133 | """Start a worker instance on a background thread.""" 134 | 135 | worker = CartogramWorker(layer, field_name, iterations) 136 | 137 | message_bar = self.iface.messageBar().createMessage('') 138 | 139 | label = QLabel('Creating cartogram...') 140 | label.setAlignment(Qt.AlignLeft | Qt.AlignVCenter) 141 | 142 | progress_bar = QProgressBar() 143 | progress_bar.setAlignment(Qt.AlignLeft | Qt.AlignVCenter) 144 | progress_bar.setMaximum(iterations * layer.featureCount()) 145 | 146 | cancel_button = QPushButton() 147 | cancel_button.setText(self.tr('Cancel')) 148 | cancel_button.clicked.connect(worker.kill) 149 | 150 | message_bar.layout().addWidget(label) 151 | message_bar.layout().addWidget(progress_bar) 152 | message_bar.layout().addWidget(cancel_button) 153 | 154 | self.iface.messageBar().pushWidget(message_bar, 155 | self.iface.messageBar().INFO) 156 | self.message_bar = message_bar 157 | 158 | # start the worker in a new thread 159 | thread = QThread() 160 | worker.moveToThread(thread) 161 | 162 | # connect some odds and ends 163 | worker.finished.connect(self.worker_finished) 164 | worker.error.connect(self.worker_error) 165 | worker.progress.connect(progress_bar.setValue) 166 | thread.started.connect(worker.run) 167 | 168 | thread.start() 169 | 170 | self.thread = thread 171 | self.worker = worker 172 | 173 | def worker_finished(self, layer, exit_code): 174 | """Clean up after the worker and the thread.""" 175 | 176 | self.worker.deleteLater() 177 | self.thread.quit() 178 | self.thread.wait() 179 | self.thread.deleteLater() 180 | 181 | self.iface.messageBar().popWidget(self.message_bar) 182 | 183 | if layer is not None: 184 | QgsMapLayerRegistry.instance().addMapLayer(layer) 185 | else: 186 | if (exit_code == 1): 187 | message = self.tr('Cartogram creation cancelled by user.') 188 | self.iface.messageBar().pushMessage(message, 189 | level=QgsMessageBar.INFO, duration=3) 190 | 191 | def worker_error(self, e, exception_string): 192 | message = self.tr('An error ocurred during cartogram creation. ' 193 | 'Please see the "Plugins" log for details.') 194 | self.iface.messageBar().pushMessage('Error', message, 195 | level=QgsMessageBar.CRITICAL, duration=5) 196 | 197 | log = 'Worker thread exception: {}'.format(exception_string) 198 | QgsMessageLog.logMessage(log, level=QgsMessageLog.CRITICAL, 199 | tag='Plugins') 200 | 201 | def validate(self): 202 | """Make sure that all fields have valid values.""" 203 | message = '' 204 | if not self.dialog.sourceLayerCombo.currentText(): 205 | message += self.tr('Please select an input layer.') 206 | if not self.dialog.sourceFieldCombo.currentText(): 207 | message += self.tr('Please select an area field.') 208 | 209 | if message: 210 | QMessageBox.warning(self.dialog, 'Cartogram', message) 211 | else: 212 | # get the select layer and field 213 | layer_name = self.dialog.sourceLayerCombo.currentText() 214 | layer = self.get_vector_layer_by_name(layer_name) 215 | field = self.dialog.sourceFieldCombo.currentText() 216 | 217 | # loop through the input data to make sure no rows contain zero or 218 | # null values 219 | zero_null = None 220 | for feature in layer.dataProvider().getFeatures(): 221 | feature_value = feature.attribute(field) 222 | if type(feature_value) is QPyNullVariant or feature_value == 0: 223 | zero_null = 1 224 | 225 | # ask the user if she wants to continue if one or more zero or null 226 | # rows are found in the input data 227 | if zero_null is not None: 228 | message = self.tr('One or more rows in your "area" column ' 229 | 'contain zero or NULL values. Do you want to continue ' 230 | 'anyway with modified (non-zero) values for those fields?') 231 | reply = QMessageBox.question(self.dialog, 'Cartogram', 232 | message, QMessageBox.Cancel, QMessageBox.Ok) 233 | 234 | if reply == QMessageBox.Cancel: 235 | self.dialog.reject() 236 | return False 237 | 238 | self.dialog.accept() 239 | 240 | # noinspection PyMethodMayBeStatic 241 | def tr(self, message): 242 | """Get the translation for a string using Qt translation API.""" 243 | # noinspection PyTypeChecker,PyArgumentList,PyCallByClass 244 | return QCoreApplication.translate('Cartogram', message) 245 | 246 | def get_vector_layer_by_name(self, layer_name): 247 | """Retrieve a layer from the registry by name.""" 248 | layerMap = QgsMapLayerRegistry.instance().mapLayers() 249 | for name, layer in layerMap.iteritems(): 250 | if layer.type() == QgsMapLayer.VectorLayer \ 251 | and layer.name() == layer_name: 252 | if layer.isValid(): 253 | return layer 254 | else: 255 | return None 256 | 257 | def count_vector_layers(self): 258 | """Count the number of vector layers on the canvas.""" 259 | layermap = QgsMapLayerRegistry.instance().mapLayers() 260 | 261 | count = 0 262 | for name, layer in layermap.iteritems(): 263 | if layer.type() == QgsMapLayer.VectorLayer: 264 | if layer.geometryType() == QGis.Polygon: 265 | count += 1 266 | 267 | return count 268 | 269 | def create_memory_layer(self, layer): 270 | """Create an in-memory copy of an existing vector layer.""" 271 | 272 | data_provider = layer.dataProvider() 273 | 274 | # create the layer path defining geometry type and reference system 275 | geometry_type = QGis.vectorGeometryType(layer.geometryType()) 276 | crs_id = layer.crs().authid() 277 | path = geometry_type + '?crs=' + crs_id + '&index=yes' 278 | 279 | # create the memory layer and get a reference to the data provider 280 | memory_layer = QgsVectorLayer(path, 'Cartogram', 'memory') 281 | memory_layer_data_provider = memory_layer.dataProvider() 282 | 283 | # copy all attributes from the source layer to the memory layer 284 | memory_layer.startEditing() 285 | memory_layer_data_provider.addAttributes( 286 | data_provider.fields().toList()) 287 | memory_layer.commitChanges() 288 | 289 | # copy all features from the source layer to the memory layer 290 | for feature in data_provider.getFeatures(): 291 | memory_layer_data_provider.addFeatures([feature]) 292 | 293 | return memory_layer 294 | -------------------------------------------------------------------------------- /cartogram_dialog.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'cartogram_dialog.ui' 4 | # 5 | # Created: Thu Aug 6 11:36:26 2015 6 | # by: PyQt4 UI code generator 4.11.3 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt4 import QtCore, QtGui 11 | 12 | try: 13 | _fromUtf8 = QtCore.QString.fromUtf8 14 | except AttributeError: 15 | def _fromUtf8(s): 16 | return s 17 | 18 | try: 19 | _encoding = QtGui.QApplication.UnicodeUTF8 20 | def _translate(context, text, disambig): 21 | return QtGui.QApplication.translate(context, text, disambig, _encoding) 22 | except AttributeError: 23 | def _translate(context, text, disambig): 24 | return QtGui.QApplication.translate(context, text, disambig) 25 | 26 | class Ui_CartogramDialog(object): 27 | def setupUi(self, CartogramDialog): 28 | CartogramDialog.setObjectName(_fromUtf8("CartogramDialog")) 29 | CartogramDialog.resize(280, 190) 30 | CartogramDialog.setModal(True) 31 | self.formLayout = QtGui.QFormLayout(CartogramDialog) 32 | self.formLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize) 33 | self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) 34 | self.formLayout.setObjectName(_fromUtf8("formLayout")) 35 | self.sourceLayerLabel = QtGui.QLabel(CartogramDialog) 36 | self.sourceLayerLabel.setObjectName(_fromUtf8("sourceLayerLabel")) 37 | self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.sourceLayerLabel) 38 | self.sourceLayerCombo = gui.QgsMapLayerComboBox(CartogramDialog) 39 | self.sourceLayerCombo.setObjectName(_fromUtf8("sourceLayerCombo")) 40 | self.formLayout.setWidget(1, QtGui.QFormLayout.SpanningRole, self.sourceLayerCombo) 41 | self.sourceFieldLabel = QtGui.QLabel(CartogramDialog) 42 | self.sourceFieldLabel.setObjectName(_fromUtf8("sourceFieldLabel")) 43 | self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.sourceFieldLabel) 44 | self.sourceFieldCombo = gui.QgsFieldComboBox(CartogramDialog) 45 | self.sourceFieldCombo.setObjectName(_fromUtf8("sourceFieldCombo")) 46 | self.formLayout.setWidget(3, QtGui.QFormLayout.SpanningRole, self.sourceFieldCombo) 47 | self.iterationsLabel = QtGui.QLabel(CartogramDialog) 48 | self.iterationsLabel.setObjectName(_fromUtf8("iterationsLabel")) 49 | self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.iterationsLabel) 50 | self.iterationsSpinBox = QtGui.QSpinBox(CartogramDialog) 51 | self.iterationsSpinBox.setMinimum(1) 52 | self.iterationsSpinBox.setProperty("value", 5) 53 | self.iterationsSpinBox.setObjectName(_fromUtf8("iterationsSpinBox")) 54 | self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.iterationsSpinBox) 55 | self.buttonBox = QtGui.QDialogButtonBox(CartogramDialog) 56 | self.buttonBox.setOrientation(QtCore.Qt.Horizontal) 57 | self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) 58 | self.buttonBox.setObjectName(_fromUtf8("buttonBox")) 59 | self.formLayout.setWidget(5, QtGui.QFormLayout.SpanningRole, self.buttonBox) 60 | 61 | self.retranslateUi(CartogramDialog) 62 | QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), CartogramDialog.reject) 63 | QtCore.QObject.connect(self.sourceLayerCombo, QtCore.SIGNAL(_fromUtf8("layerChanged(QgsMapLayer*)")), self.sourceFieldCombo.setLayer) 64 | QtCore.QMetaObject.connectSlotsByName(CartogramDialog) 65 | CartogramDialog.setTabOrder(self.sourceLayerCombo, self.sourceFieldCombo) 66 | CartogramDialog.setTabOrder(self.sourceFieldCombo, self.iterationsSpinBox) 67 | CartogramDialog.setTabOrder(self.iterationsSpinBox, self.buttonBox) 68 | 69 | def retranslateUi(self, CartogramDialog): 70 | CartogramDialog.setWindowTitle(_translate("CartogramDialog", "Cartogram", None)) 71 | self.sourceLayerLabel.setText(_translate("CartogramDialog", "Input layer:", None)) 72 | self.sourceFieldLabel.setText(_translate("CartogramDialog", "Area field:", None)) 73 | self.iterationsLabel.setText(_translate("CartogramDialog", "Number of iterations to perform:", None)) 74 | 75 | from qgis import gui 76 | 77 | class CartogramDialog(QtGui.QDialog, Ui_CartogramDialog): 78 | def __init__(self, parent=None, f=QtCore.Qt.WindowFlags()): 79 | QtGui.QDialog.__init__(self, parent, f) 80 | 81 | self.setupUi(self) 82 | 83 | -------------------------------------------------------------------------------- /cartogram_dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CartogramDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 280 10 | 190 11 | 12 | 13 | 14 | Cartogram 15 | 16 | 17 | true 18 | 19 | 20 | 21 | QLayout::SetFixedSize 22 | 23 | 24 | QFormLayout::AllNonFixedFieldsGrow 25 | 26 | 27 | 28 | 29 | Input layer: 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Area field: 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | Number of iterations to perform: 50 | 51 | 52 | 53 | 54 | 55 | 56 | 1 57 | 58 | 59 | 5 60 | 61 | 62 | 63 | 64 | 65 | 66 | Qt::Horizontal 67 | 68 | 69 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | QgsFieldComboBox 78 | QComboBox 79 |
qgsfieldcombobox.h
80 |
81 | 82 | QgsMapLayerComboBox 83 | QComboBox 84 |
qgsmaplayercombobox.h
85 |
86 |
87 | 88 | sourceLayerCombo 89 | sourceFieldCombo 90 | iterationsSpinBox 91 | buttonBox 92 | 93 | 94 | 95 | 96 | buttonBox 97 | rejected() 98 | CartogramDialog 99 | reject() 100 | 101 | 102 | 10 103 | 230 104 | 105 | 106 | 20 107 | 20 108 | 109 | 110 | 111 | 112 | sourceLayerCombo 113 | layerChanged(QgsMapLayer*) 114 | sourceFieldCombo 115 | setLayer(QgsMapLayer*) 116 | 117 | 118 | 126 119 | 45 120 | 121 | 122 | 171 123 | 104 124 | 125 | 126 | 127 | 128 |
129 | -------------------------------------------------------------------------------- /cartogram_feature.py: -------------------------------------------------------------------------------- 1 | class CartogramFeature(object): 2 | """Stores various calculated values for each feature.""" 3 | 4 | def __init__(self): 5 | self.center_x = -1 6 | self.center_y = -1 7 | self.value = -1 8 | self.area = -1 9 | self.mass = -1 10 | self.radius = -1 11 | -------------------------------------------------------------------------------- /cartogram_worker.py: -------------------------------------------------------------------------------- 1 | from PyQt4.QtCore import pyqtSignal, QObject, QPyNullVariant 2 | from qgis.core import QgsDistanceArea, QgsGeometry, QgsPoint 3 | 4 | from cartogram_feature import CartogramFeature 5 | 6 | import math 7 | import traceback 8 | 9 | 10 | class CartogramWorker(QObject): 11 | """Background worker which actually creates the cartogram.""" 12 | 13 | finished = pyqtSignal(object, int) 14 | error = pyqtSignal(Exception, basestring) 15 | progress = pyqtSignal(float) 16 | 17 | def __init__(self, layer, field_name, iterations): 18 | """Constructor.""" 19 | QObject.__init__(self) 20 | 21 | self.layer = layer 22 | self.field_name = field_name 23 | self.iterations = iterations 24 | 25 | # used to store the computed minimum value when the input data contains 26 | # zero or null values in the column used to create the cartogram 27 | self.min_value = None 28 | 29 | # set default exit code - if this doesn't change everything went well 30 | self.exit_code = -1 31 | 32 | def run(self): 33 | ret = None 34 | 35 | try: 36 | feature_count = self.layer.featureCount() 37 | 38 | step = self.get_step() 39 | steps = 0 40 | 41 | for i in range(self.iterations): 42 | (meta_features, 43 | force_reduction_factor) = self.get_reduction_factor( 44 | self.layer, self.field_name) 45 | 46 | for feature in self.layer.getFeatures(): 47 | if self.exit_code > 0: 48 | break 49 | 50 | old_geometry = feature.geometry() 51 | new_geometry = self.transform(meta_features, 52 | force_reduction_factor, old_geometry) 53 | 54 | self.layer.dataProvider().changeGeometryValues({ 55 | feature.id() : new_geometry}) 56 | 57 | steps += 1 58 | if step == 0 or steps % step == 0: 59 | self.progress.emit(steps / float(feature_count) * 100) 60 | 61 | if self.exit_code == -1: 62 | self.progress.emit(100) 63 | ret = self.layer 64 | except Exception, e: 65 | self.error.emit(e, traceback.format_exc()) 66 | 67 | self.finished.emit(ret, self.exit_code) 68 | 69 | def kill(self): 70 | self.exit_code = 1 71 | 72 | def get_reduction_factor(self, layer, field): 73 | """Calculate the reduction factor.""" 74 | data_provider = layer.dataProvider() 75 | meta_features = [] 76 | 77 | total_area = 0.0 78 | total_value = 0.0 79 | 80 | if self.min_value is None: 81 | self.min_value = self.get_min_value(data_provider, field) 82 | 83 | for feature in data_provider.getFeatures(): 84 | meta_feature = CartogramFeature() 85 | 86 | geometry = QgsGeometry(feature.geometry()) 87 | 88 | area = QgsDistanceArea().measure(geometry) 89 | total_area += area 90 | 91 | feature_value = feature.attribute(field) 92 | if type(feature_value) is QPyNullVariant or feature_value == 0: 93 | feature_value = self.min_value / 100 94 | 95 | total_value += feature_value 96 | 97 | meta_feature.area = area 98 | meta_feature.value = feature_value 99 | 100 | centroid = geometry.centroid() 101 | (cx, cy) = centroid.asPoint().x(), centroid.asPoint().y() 102 | meta_feature.center_x = cx 103 | meta_feature.center_y = cy 104 | 105 | meta_features.append(meta_feature) 106 | 107 | fraction = total_area / total_value 108 | 109 | total_size_error = 0 110 | 111 | for meta_feature in meta_features: 112 | polygon_value = meta_feature.value 113 | polygon_area = meta_feature.area 114 | 115 | if polygon_area < 0: 116 | polygon_area = 0 117 | 118 | # this is our 'desired' area... 119 | desired_area = polygon_value * fraction 120 | 121 | # calculate radius, a zero area is zero radius 122 | radius = math.sqrt(polygon_area / math.pi) 123 | meta_feature.radius = radius 124 | 125 | if desired_area / math.pi > 0: 126 | mass = math.sqrt(desired_area / math.pi) - radius 127 | meta_feature.mass = mass 128 | else: 129 | meta_feature.mass = 0 130 | 131 | size_error = max(polygon_area, desired_area) / \ 132 | min(polygon_area, desired_area) 133 | 134 | total_size_error += size_error 135 | 136 | average_error = total_size_error / len(meta_features) 137 | force_reduction_factor = 1 / (average_error + 1) 138 | 139 | return (meta_features, force_reduction_factor) 140 | 141 | def transform(self, meta_features, force_reduction_factor, geometry): 142 | """Transform the geometry based on the force reduction factor.""" 143 | 144 | if geometry.isMultipart(): 145 | geometries = [] 146 | for polygon in geometry.asMultiPolygon(): 147 | new_polygon = self.transform_polygon(polygon, meta_features, 148 | force_reduction_factor) 149 | geometries.append(new_polygon) 150 | return QgsGeometry.fromMultiPolygon(geometries) 151 | else: 152 | polygon = geometry.asPolygon() 153 | new_polygon = self.transform_polygon(polygon, meta_features, 154 | force_reduction_factor) 155 | return QgsGeometry.fromPolygon(new_polygon) 156 | 157 | def transform_polygon(self, polygon, meta_features, 158 | force_reduction_factor): 159 | """Transform the geometry of a single polygon.""" 160 | 161 | new_line = [] 162 | new_polygon = [] 163 | 164 | for line in polygon: 165 | for point in line: 166 | x = x0 = point.x() 167 | y = y0 = point.y() 168 | 169 | # compute the influence of all shapes on this point 170 | for feature in meta_features: 171 | cx = feature.center_x 172 | cy = feature.center_y 173 | distance = math.sqrt((x0 - cx) ** 2 + (y0 - cy) ** 2) 174 | 175 | if (distance > feature.radius): 176 | # calculate the force exerted on points far away from 177 | # the centroid of this polygon 178 | force = feature.mass * feature.radius / distance 179 | else: 180 | # calculate the force exerted on points close to the 181 | # centroid of this polygon 182 | xF = distance / feature.radius 183 | # distance ** 2 / feature.radius ** 2 instead of xF 184 | force = feature.mass * (xF ** 2) * (4 - (3 * xF)) 185 | force = force * force_reduction_factor / distance 186 | x = (x0 - cx) * force + x 187 | y = (y0 - cy) * force + y 188 | new_line.append(QgsPoint(x, y)) 189 | new_polygon.append(new_line) 190 | new_line = [] 191 | 192 | return new_polygon 193 | 194 | def get_step(self): 195 | """Determine how often the progress bar should be updated.""" 196 | 197 | feature_count = self.layer.featureCount() 198 | 199 | # update the progress bar at each .1% increment 200 | step = feature_count // 1000 201 | 202 | # because we use modulo to determine if we should emit the progress 203 | # signal, the step needs to be greater than 1 204 | if step < 2: 205 | step = 2 206 | 207 | return step 208 | 209 | def get_min_value(self, data_provider, field): 210 | features = [] 211 | for feature in data_provider.getFeatures(): 212 | feature_value = feature.attribute(field) 213 | if not type(feature_value) is QPyNullVariant \ 214 | and feature_value != 0: 215 | features.append(feature.attribute(field)) 216 | 217 | return min(features) 218 | -------------------------------------------------------------------------------- /demo/demo.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/informeren/qgis-cartogram/6e9b381cb4610bcca7f71d127c547f9af4867a13/demo/demo.dbf -------------------------------------------------------------------------------- /demo/demo.prj: -------------------------------------------------------------------------------- 1 | PROJCS["ETRS89_UTM_zone_32N",GEOGCS["GCS_ETRS_1989",DATUM["D_ETRS_1989",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /demo/demo.qpj: -------------------------------------------------------------------------------- 1 | PROJCS["ETRS89 / UTM zone 32N",GEOGCS["ETRS89",DATUM["European_Terrestrial_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6258"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4258"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","25832"]] 2 | -------------------------------------------------------------------------------- /demo/demo.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/informeren/qgis-cartogram/6e9b381cb4610bcca7f71d127c547f9af4867a13/demo/demo.shp -------------------------------------------------------------------------------- /demo/demo.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/informeren/qgis-cartogram/6e9b381cb4610bcca7f71d127c547f9af4867a13/demo/demo.shx -------------------------------------------------------------------------------- /i18n/da.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/informeren/qgis-cartogram/6e9b381cb4610bcca7f71d127c547f9af4867a13/i18n/da.qm -------------------------------------------------------------------------------- /metadata.txt: -------------------------------------------------------------------------------- 1 | [general] 2 | name=Cartogram 3 | qgisMinimumVersion=2.8 4 | description=Create continuous area cartograms 5 | about=An updated version of the cartogram plugin by Carson Farmer. This version adds support for memory layers and background processing. 6 | version=1.0.1 7 | author=Carson Farmer, Morten Wulff 8 | email=wulff@ratatosk.net 9 | tags=geometry, layers, polygon, shapefile 10 | homepage=http://informeren.github.io/qgis/ 11 | tracker=https://github.com/informeren/qgis-cartogram/issues 12 | repository=https://github.com/informeren/qgis-cartogram 13 | category=Vector 14 | icon=assets/icon.png 15 | experimental=False 16 | deprecated=False 17 | -------------------------------------------------------------------------------- /resources_rc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Resource object code 4 | # 5 | # Created: Thu Jul 23 16:26:35 2015 6 | # by: The Resource Compiler for PyQt (Qt v4.8.6) 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt4 import QtCore 11 | 12 | qt_resource_data = "\ 13 | \x00\x00\x0e\x0d\ 14 | \x89\ 15 | \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ 16 | \x00\x00\x40\x00\x00\x00\x40\x08\x06\x00\x00\x00\xaa\x69\x71\xde\ 17 | \x00\x00\x0d\xd4\x49\x44\x41\x54\x78\x5e\xe5\x5a\x5b\x8b\x25\x59\ 18 | \x56\xfe\x56\xdc\xe3\xc4\xb9\xe4\xc9\x5b\x55\xb5\x5d\x63\x8f\xad\ 19 | \x83\x32\x0f\xc2\xe0\xc3\xbc\xd9\x8d\x4a\xfb\x62\xb7\x42\xd3\x0c\ 20 | \x8e\x88\x17\x18\x47\x9a\x79\x90\xf9\x03\xed\x48\x3f\xf8\xa2\x20\ 21 | \x6a\xf7\x4b\x81\xbe\x09\x03\x63\x43\x83\x62\x8b\xe2\x65\x44\x1b\ 22 | \xda\x11\x1d\xd4\xb1\x9c\x5b\xd7\x4c\x56\x66\xe5\xc9\x3c\x99\xe7\ 23 | \x92\xe7\x16\xb1\xf7\x76\x9f\x15\x27\x17\x44\xc4\x09\xb2\x07\x34\ 24 | \x52\xe8\x55\xec\xda\x71\x76\xec\x88\x3a\xdf\xb7\xd6\xfe\xf6\xda\ 25 | \xab\x0e\x01\x30\xf8\xff\x6b\x84\xff\x63\xf3\xb0\xb1\x56\x0c\xb8\ 26 | \x2e\x60\x74\xf1\x5f\x35\x95\x0b\x31\x19\x26\x07\x98\x5e\x41\xac\ 27 | \x9d\x00\xd0\xb5\x8f\xd4\xdf\x70\x00\xa5\x81\xe5\x12\x30\x32\xa7\ 28 | \x01\x02\xe2\x18\x38\xff\x56\x0e\x5e\x1b\xe9\xd9\x8c\x01\xb4\x96\ 29 | \x9e\x1b\x51\xde\xcb\xb8\x6d\xf7\x3f\x0e\xb1\x7f\xfb\x07\x99\x0f\ 30 | \x40\xde\xc9\x63\x4a\x0b\xb8\xe2\x3b\xb4\x8c\xe1\x27\x5e\x02\x26\ 31 | \xd3\x06\x09\x70\xa9\x06\x3c\x5f\x57\xc0\x0b\x70\x23\xe0\x50\xb0\ 32 | \x2a\xf8\xbc\xd7\x25\xf0\xc6\x14\xe6\xca\x67\xcf\x45\x63\xe6\x30\ 33 | \xeb\x28\x82\x37\xe2\xd9\xa2\x97\x88\xaa\x84\x08\x78\x31\x21\xaa\ 34 | \xfa\x4e\x01\x5f\x6c\x40\xe9\x9d\xa6\x51\x02\x8a\xde\xae\x86\xa7\ 35 | \x34\x01\xac\xcb\x73\x2b\xfa\x20\x73\x0b\xc0\x8a\xef\x6d\x1e\x7c\ 36 | \xbd\x08\x16\x42\xb9\x10\xae\xe2\x4d\x21\xc1\x6c\x9d\x5b\x5d\x02\ 37 | \xe5\xb0\x27\xb9\xae\x01\x2f\xf3\x6f\x83\x80\x22\x20\x23\x6d\x0b\ 38 | \x21\x02\xa8\xde\x6b\xba\x36\xec\x3f\x18\x78\xd3\x3c\x01\x25\x40\ 39 | \x02\x5e\xae\x45\xf0\x6a\xbd\x29\x56\x12\x53\xc3\xfd\x8d\x9e\x17\ 40 | \x07\x70\xdf\xb4\x06\xd4\xaf\x79\x69\x22\x78\x54\x19\xaf\x98\x91\ 41 | \xf1\xb2\x68\xd6\x7b\xde\x60\xd3\x37\x4f\x80\x80\x2d\x7a\x08\x5b\ 42 | \xb6\x3a\xaa\x0d\xe5\x82\xe9\x42\x94\x94\xc9\x15\xe0\x02\x9e\x04\ 43 | \xbc\x44\xcd\x2d\x68\x80\xa9\xee\xf3\xd5\xf0\x2c\x6b\x41\x4d\xd8\ 44 | \x9a\x1a\xdd\xc0\x76\xc1\x53\xb2\xed\xde\xe2\x12\x10\x60\xb5\x6a\ 45 | \x5f\xf6\x60\x51\xf0\xc4\x64\x6e\x1d\xf8\x1a\xcf\x73\xbb\x45\x02\ 46 | \x44\xdc\x94\x78\xa9\xb4\xd5\x15\x01\x50\x49\xed\xc5\x04\xe8\xcd\ 47 | \xe0\x95\x84\xfd\xad\x80\x17\x02\xc4\x4c\x29\x0a\x40\x37\x84\xb2\ 48 | \xd9\x1e\x01\xd5\xb9\x25\xb2\x6a\xc1\xcb\xbb\x6e\x4d\x03\xea\x13\ 49 | \xa2\xca\x19\xa1\x2e\x73\xbb\x79\xcd\x1b\xb3\x1d\xbc\x08\x65\xf3\ 50 | \x04\x94\xc0\x57\xf7\xf9\x6a\xd8\xd7\x8a\x60\x2d\x78\x19\xab\x82\ 51 | \xbf\xe5\x4c\xd0\x75\x2a\x49\x8e\x10\xe0\x6c\xce\xf6\x0e\x18\x74\ 52 | \xee\x9e\xcd\x7d\x17\x80\x49\x01\x84\x28\x58\x05\xbc\x90\x79\x23\ 53 | \x78\xbe\x4f\xd4\x6c\xc5\xc5\xf8\x3e\x90\xa6\x1f\xce\x8a\x90\x03\ 54 | \x30\xf8\x0f\xad\x39\xf8\x10\x9b\x68\x40\x12\x03\x5f\xfd\xc7\xed\ 55 | \x82\x67\x4c\x71\xcb\x02\xaa\xdb\xa2\xbb\x03\x7c\xe2\x13\x10\xfb\ 56 | \xfb\x3f\xaf\x3f\x53\xa0\xf4\x5e\xa9\x1b\xc8\x38\xf0\xcb\xaf\x02\ 57 | \xe3\x49\x83\x04\x68\xd4\xab\xbd\x80\x65\xf0\xdb\x33\xbc\x74\x58\ 58 | \x15\x40\xa0\x7e\x9f\xd7\x35\xa4\xdc\x62\x45\x68\x7b\x7a\x6b\xc4\ 59 | \xd3\x37\x66\x78\x05\x23\xaa\x07\x2f\x20\xab\xe0\x6f\x3f\x15\x26\ 60 | \xf1\x5a\x11\x00\x70\x63\x6e\x5f\x30\xad\x6e\x06\xaf\x6c\xa3\xc2\ 61 | \x3b\x6e\x9b\x80\x82\xe7\x6f\x2e\x58\xd6\x97\xb1\xca\x21\xbe\x15\ 62 | \xbc\xa4\xc3\x72\x5f\x09\xf8\x5b\x4a\x85\x6b\xd7\x7c\x4d\xfd\xde\ 63 | \xd4\xa5\xc3\x45\xf0\xa0\x2a\x78\x16\x40\xb5\x2d\xf4\x2b\x24\xb8\ 64 | \x10\x83\x91\x9e\xdb\xcd\xd8\x92\xe4\x70\x8f\x68\xb6\x0f\xe0\x60\ 65 | \xa5\x54\xbf\xd3\x4a\x3e\xb9\x5a\x2d\x3f\xdb\xed\x76\x5f\x38\x3a\ 66 | \x3a\xfa\x27\x00\x4e\xe9\x2c\x50\x5d\xf3\xd5\xf1\x1b\x43\x56\xc6\ 67 | \x85\x58\x25\xaa\x2f\xa4\x96\xd3\x1c\xc7\xd9\x90\x84\x02\x3c\x85\ 68 | \x2d\xf6\xde\x7b\x5f\xf9\xc2\xd1\xd1\x77\x22\x0b\xa2\x75\x7a\x3a\ 69 | \x88\xce\xce\xce\x5a\x4f\x9e\x9c\x76\x86\xc3\xf3\xf6\xf9\xf0\xa2\ 70 | \x33\x1e\xd9\x36\x1e\x77\x96\xcb\x79\x94\xa6\x59\x90\xa6\x69\xa8\ 71 | \x94\xf2\xce\xe7\x73\x38\x8e\xa3\x5f\x79\xe5\x95\xcf\x3e\x78\xf0\ 72 | \x60\x4d\x80\x44\x80\x78\xc6\x48\xd8\xdf\x08\x5e\x80\x18\x5d\x57\ 73 | \x11\x2a\xcc\x97\x42\xc9\xf1\x13\x17\xa7\x83\x1c\x9b\x52\x24\xd5\ 74 | \xa7\xd9\x1c\x18\x8d\x81\x95\xca\x9f\x7f\xf5\xd5\xcf\x7d\x89\x60\ 75 | \x8c\xf5\x9a\x73\x7c\x7c\xdc\xb5\x60\x7b\x97\x97\x17\xed\x97\x5e\ 76 | \xfa\x99\xd6\x62\xb1\x88\x96\xcb\x65\x64\xfb\x38\xcb\x32\x0f\x25\ 77 | \x73\x3d\x1f\x7e\xd8\x82\x9f\xf4\x91\x04\x31\x5a\x9d\x5d\x33\x7c\ 78 | \xf2\xc8\xcc\xc6\x03\xe7\xe2\x62\x94\x20\x37\xf2\x04\xec\x07\xf1\ 79 | \x7c\x7d\x6e\x5f\x5f\x11\xe2\x56\x24\xf9\x8b\x6f\xf9\xf8\x9b\x2f\ 80 | \x6b\x10\x19\x98\xfa\x3d\x0f\x7f\xf0\xfb\xbf\xf7\x73\xd8\x62\xae\ 81 | \xbf\x06\x17\xc3\x0f\xda\xd8\xdd\x79\x0a\x71\x6f\xdf\x24\xed\x3e\ 82 | \xe2\xce\x2e\x5a\x49\x17\x61\xbb\x87\x56\x7b\x17\x61\xd4\x81\x17\ 83 | \xc5\x70\x5d\xcf\x7e\xee\xd3\xdf\x7e\xe9\x77\xf1\x5f\xef\xbd\x83\ 84 | \xf1\x78\xd4\x29\x69\xc0\x07\x07\x6f\x0a\xe1\x5d\x2b\x82\x55\xc1\ 85 | \xbb\x5e\x06\x26\xc0\xe5\x98\x98\xa5\x3b\xf7\x3f\x86\xb8\xb3\xcf\ 86 | \xee\x76\x5c\xdf\x36\x87\xbf\x2c\x91\x6d\xae\xbb\x06\x69\xe6\xe3\ 87 | \x33\x3c\xfc\x97\xbf\x46\xdc\xdd\xc5\x27\x5f\xf8\x15\x24\xbd\x03\ 88 | \x84\xad\x0e\xe2\x56\x17\x5e\x1c\xc3\xf3\x5b\xf0\x5c\x87\x40\x0e\ 89 | \x80\x9c\x50\xa3\x15\x54\x96\xc2\x28\x0d\xa5\x53\xa8\xd5\x12\x59\ 90 | \x3a\x47\x64\x9f\x59\x9b\x8d\xa2\x6b\x02\x8c\x10\xf0\xbd\xac\x79\ 91 | \xa2\xf2\x56\x57\x27\x82\xd5\x5a\xe2\x74\x0a\x8c\x2e\x32\x0b\xd6\ 92 | \xc3\x0b\xbf\xf8\x5b\x38\xfc\xc8\x8f\x20\x5d\xcd\x40\xe4\xc8\xff\ 93 | \xc0\xf0\x1f\xa5\x10\x26\x5d\x7a\xf8\xcf\x7f\xc9\x04\xec\xdf\x79\ 94 | \x06\x3f\xfa\xe3\x2f\x23\x5d\xce\xa1\xb5\x82\xce\xb2\x1c\xa8\x5a\ 95 | \x61\x99\x2a\x18\xad\xf3\xc6\xcf\x6b\x40\x23\xef\x19\x47\x0e\x24\ 96 | \x4c\x7a\xdc\x8f\x46\xe3\x76\x85\x80\x0f\x2e\x78\x15\xf0\xd5\x8a\ 97 | \x90\x2e\x94\xbd\x2a\x04\x9c\x59\x02\xfc\xb0\x8b\xa0\xd5\xc6\x6a\ 98 | \x3e\x41\x9a\xad\x72\xec\x9b\x33\xb9\x36\x1a\x4a\xa5\xec\xd1\xd1\ 99 | \xe0\x88\x49\x8c\xda\x3b\x58\xcd\x26\x58\xcc\xa7\x4c\x16\x83\x83\ 100 | \x23\x02\x44\x20\x39\x47\xc3\x38\x30\xa4\x41\x86\x78\x1e\x53\xa2\ 101 | \x35\xe2\x76\x1e\x01\x57\x57\xd3\x0e\x64\x26\xdb\xf7\x24\x78\x55\ 102 | \xf0\xb6\x89\x09\xe8\x02\x78\xd9\xf6\xa6\x33\x17\xd3\x2b\x83\x4e\ 103 | \xff\x00\x61\xdc\x86\xd2\x1a\x8e\x43\x39\x04\x22\x80\xc0\xbd\x03\ 104 | \x62\x80\xf3\xd9\x98\x31\xc5\x9d\x3e\x5c\x2f\x00\x64\xce\x26\xe4\ 105 | \x37\x82\x63\x8c\xb6\x8d\x7b\x6e\x28\x5d\xeb\x2c\x45\x9c\xf4\xe1\ 106 | \x38\xbe\x75\xc2\xb4\xf5\xdc\x73\xcf\x45\xa5\x54\xb8\x5e\x08\xb5\ 107 | \x6c\x65\x5b\xf2\x78\xb3\x2d\x0f\xa8\x8f\x9e\xf3\x21\xf1\xfc\xf6\ 108 | \xce\x1d\x78\x7e\x08\xad\x53\xfe\x0c\x53\x06\x01\x0e\xf5\x99\xd5\ 109 | \x00\x00\x6b\x11\x93\xf5\x0d\x40\xe6\x09\x78\xc8\xf3\xa5\x77\x19\ 110 | \x89\x80\x30\x6a\xc3\x8f\x42\x64\x59\x16\x3d\x7a\xf4\xe8\x50\x08\ 111 | \x70\xb0\xdd\xf3\x72\x5a\x93\xf1\x92\xe7\x49\xe6\x95\xac\x9a\xe1\ 112 | \x11\xe5\xfd\xc9\x00\x6c\xdd\xfe\x5d\xd6\x81\x4d\x0a\x2a\xe0\x61\ 113 | \xae\xd7\xb2\x82\xce\x56\x98\x4f\x2e\x78\x7e\x10\x26\x50\x3a\x2b\ 114 | \x90\x54\x00\xaa\x2b\xe0\xa5\x07\x88\x89\xe6\x6d\x31\x4c\x90\xae\ 115 | \x56\x21\x11\x1d\x14\x4e\x83\x35\x6a\x2f\xe0\xab\x61\x5f\x1c\xab\ 116 | \x07\x5f\x1c\x3b\x1b\x12\x0f\x24\xbb\x7b\x80\x31\xac\xd6\xe4\x5c\ 117 | \x8b\x1f\xe0\x10\xf1\x4e\xe0\x79\x01\x5c\x3f\xc0\x6c\x7c\x9e\x13\ 118 | \xb6\x7f\x0f\x9e\x1b\xf0\x6e\xc1\xc0\x94\x82\xbe\x0e\x71\x2d\xd9\ 119 | \xd3\x16\xf0\xd8\x2c\x01\xcd\xef\x0b\x82\xc8\x5c\x29\x15\x4c\x26\ 120 | \xb3\x7d\x21\x60\xb1\x00\x7e\xf2\x67\x01\xcf\x13\xf1\x2a\x2f\x6b\ 121 | \x19\xa8\x0e\x55\x6b\x78\xbf\xfa\x39\x01\x5e\xcd\x0f\x28\xbf\xd1\ 122 | \xdf\xbd\x0f\x2f\x88\x10\xc5\x1d\x0b\xca\x65\x20\x69\xba\x44\xba\ 123 | \xb8\xb2\x5e\xbf\xc4\x7c\x36\xc1\xf9\xc9\xd7\x31\x38\xfe\x06\xcf\ 124 | \x1f\x1c\xfd\x37\xa2\x56\x0f\x41\x18\x23\x6c\x75\xd9\x9b\xe4\x10\ 125 | \xb4\xca\x78\x47\xc8\x54\x6a\x7b\xdb\x94\x2a\xe8\x00\x88\x84\x10\ 126 | \x4b\x20\x85\xc9\x8e\xfd\xf8\xbe\x43\xa4\x77\x85\x00\xe0\x7f\xf7\ 127 | \x37\x39\xa3\x31\xb6\x5a\x10\x04\x30\x26\x03\x39\x2e\x9c\x30\xc2\ 128 | \xf1\xb7\xff\x1d\xe7\x16\xe0\xe4\xfc\x31\x2e\xcf\x4f\x30\x1d\x1e\ 129 | \x63\xbc\x6e\xf6\x3a\x5d\xcd\x0b\xcf\xbe\xfb\x67\x0f\xf0\x2e\x1e\ 130 | \x20\x4e\xba\x68\xef\x3d\x85\xde\xee\x3d\x74\x76\xef\xa0\xb7\xf7\ 131 | \x34\x0b\x6a\xdc\xee\x23\x8c\x12\xf8\x51\x2b\x77\xa0\x51\x50\x4a\ 132 | \x31\x29\x2a\xcb\xc9\x31\xae\x8f\x78\xb3\x15\x2e\x97\xe9\xbd\x6b\ 133 | \x02\xa8\xa9\xe2\x6b\x1c\xc7\x1f\x75\x1c\xe7\x2b\x97\x97\x97\x3b\ 134 | \x7f\xf1\xc7\xbf\x69\xb2\xd5\x8c\xcc\x96\x50\xf1\x83\x18\xbb\x77\ 135 | \xbe\xdf\x0a\xe5\x21\x8e\xdf\xff\x0f\x8e\x8a\xc3\xfb\x3f\x8c\x74\ 136 | \x39\xc3\xe8\xec\x08\xf3\x47\x5f\xc3\xc0\x36\x31\x72\x10\xc5\x09\ 137 | \x3a\x56\x58\xbb\x7b\xf7\x90\xf4\x6d\x6f\xc9\x69\xf7\x0e\x11\x77\ 138 | \x76\x58\x3f\x38\xda\x5a\x1d\x74\xed\xbd\xb5\x1d\xdc\x39\x78\xf9\ 139 | \xf2\x72\xf8\x3b\x5e\x93\xd5\xe7\xd9\x6c\x76\x40\x44\xb1\x31\xb9\ 140 | \x40\xf4\xf7\xef\xa3\xd5\xdb\xb3\x40\x0f\xd0\xdb\x7f\x9a\x3d\x9a\ 141 | \x74\xf6\xf8\x4b\x47\x71\x97\x33\xbe\x3f\xfd\xc3\xdf\xc0\xe9\xa3\ 142 | \xff\xc4\x8f\xfd\xd4\xa7\x71\xf7\x23\x1f\xc7\xf0\xc9\xfb\x98\x4d\ 143 | \x86\x18\x0f\x4f\x70\x39\xf8\x2e\x26\xc3\x23\x4c\x47\xe7\xb8\x1a\ 144 | \x9d\x61\xf0\xf8\xeb\xdc\x84\x17\x22\x5e\x36\xad\xce\x0e\xef\x3a\ 145 | \xfd\xbb\xcf\x60\x6c\xa3\x6d\x6d\xb3\xe9\x94\x93\xa1\x26\x09\x40\ 146 | \xd4\x6e\x1f\x4e\x2e\x2e\xc2\x83\xa7\x7f\xc8\xfc\xf4\x2f\x7d\x81\ 147 | \xc2\x30\x0f\x59\xd7\xf3\x40\x70\xa0\x39\xb3\xcb\x60\x6c\x4b\xd3\ 148 | \x15\x2b\x70\xdb\x12\x74\x0a\x60\x7a\x39\x80\xff\xb1\x04\xfd\x83\ 149 | \xfb\xd8\x7b\xea\xa3\x9b\xad\x53\x23\x5b\xad\xb0\x5c\x4c\x2d\x29\ 150 | \x17\x96\x84\x53\x4c\x2e\x6d\x1b\x9e\x70\xa4\x58\x52\x58\x4f\xce\ 151 | \x4f\xbe\xcd\xed\xfd\xaf\xbd\x2b\x00\xac\x33\x3a\xc6\x18\xf2\xd0\ 152 | \xa0\x7d\xfa\x53\x9f\xfa\xb5\x37\xdf\x78\x03\x7b\x77\x7f\x00\x07\ 153 | \x4f\xfd\x20\x7b\x52\x65\xa9\x05\xb1\x60\xf0\xb2\x0d\x02\xac\xf2\ 154 | \xf0\x43\xc4\xc9\x0e\x3f\x3b\xbf\x1a\xf3\x56\xb6\x5a\x6b\xc3\x0a\ 155 | \x1b\x91\xcb\xa9\xf5\xfc\xc0\x6a\xc2\x5d\xec\xec\x7f\x1f\x88\x93\ 156 | \x43\x83\xcc\x12\xb8\x5a\x0b\xea\xf4\x12\xd3\xd1\x00\x93\x8b\x53\ 157 | \xac\xcf\x15\x67\x27\xdf\xc4\xd9\xd1\x37\x60\x4f\x92\x6d\x22\x0a\ 158 | \x1b\x22\x80\x31\xe1\x3b\x8f\xbe\xdb\xe7\xa4\xa6\x77\x80\x74\xb5\ 159 | \x60\xd5\xb7\x9a\x00\xe0\x3a\xb3\xd3\x30\x60\x04\x39\x19\x44\x2c\ 160 | \x6e\x6b\x5b\x58\x4f\x1a\xa5\x25\xb4\x01\x4e\x87\x79\x9e\x56\x79\ 161 | \x7e\xa0\x35\x93\xc2\xe3\x3c\xc3\xf5\x58\x47\x3a\x96\x9c\x7b\xcf\ 162 | \x68\x38\x9e\x8f\xf3\xc7\xdf\xc4\x5f\xfd\xc9\x6f\xaf\xe7\xb2\x2e\ 163 | \x35\x4a\xc0\xd9\xd9\x80\x73\xf0\x4e\x6f\x1f\x8c\x81\x3d\x8e\x3c\ 164 | \x89\x81\x29\x64\x77\x0c\xd4\x68\xde\xf2\x00\xb0\x27\x39\x4a\x20\ 165 | \x59\x63\xe1\x39\x18\xc0\xa1\x9c\x14\x18\xe2\xfb\x3c\xdf\x28\x9e\ 166 | \x67\x49\xe2\x1a\x81\xd6\x86\x7b\x20\x0b\x7e\xe1\x33\x9f\xd9\x6d\ 167 | \x8c\x00\x6b\xf4\xec\xb3\xcf\xf6\x38\x02\x76\xf6\xa1\x95\xa4\xb4\ 168 | \x0c\x62\x03\x46\xc0\x49\xfa\x1a\x27\xb9\x68\x5d\x5d\xf0\x01\x89\ 169 | \xf2\xf9\x85\xe7\x60\x6a\x92\x20\x6e\x90\x08\x83\x01\x27\x59\xae\ 170 | \xeb\x23\x5d\x2e\xbd\x77\xde\x7a\xab\xe5\xa0\x21\x7b\xfe\xf9\xe7\ 171 | \x7b\x53\xab\xbc\xbe\x1f\xa1\xdd\x3b\x80\xca\xb2\x8a\x27\xa1\x73\ 172 | \x40\x92\xbd\x69\x85\x28\xe1\x08\x58\x67\x84\xac\x15\xe0\x53\x23\ 173 | \x83\xac\x05\x2f\xef\x94\x31\x23\x11\xe1\xb8\x2e\x47\x80\x1d\x23\ 174 | \xad\x3d\xaf\x31\x11\x7c\xf8\xf0\xe1\x5d\xbb\xf5\x84\x61\xdc\xe5\ 175 | \xad\x49\xab\xf4\x3a\x9c\x0b\x9e\x97\xa8\xd0\x06\x2a\x5b\x21\x88\ 176 | \xdb\x2c\x72\x8b\xc5\x15\xd7\x02\xfc\xa0\x95\x87\xb5\xd9\xf2\x8c\ 177 | \x80\x97\x6b\x39\x27\xf0\x18\x29\x4e\xc2\x5c\x2f\x58\x8f\xf9\x71\ 178 | \xec\x1e\x36\x16\x01\x5a\xd3\xbd\xf9\x72\x19\x87\x49\xdb\x82\x4a\ 179 | \x58\xfd\x0d\xe4\x50\x23\x9e\x17\x8f\x81\x3d\xc6\x80\x83\xa8\x8d\ 180 | \xcc\x82\x5f\x2d\x66\xac\x1d\xf2\x8c\x6d\xf5\xe0\xe5\xbd\xf9\x35\ 181 | \xf8\xfc\xc0\x02\xea\xfa\x3e\x53\x6e\xeb\x8c\xa6\x31\x02\x5e\x7e\ 182 | \xe5\xe5\x5f\x57\x4a\xb9\x71\xa7\x6f\x3c\xd7\x27\x75\x7d\xbe\x96\ 183 | \x2f\x69\x0a\x40\x28\x3f\x0e\xb3\xf7\xc3\xb8\xcd\xe1\xbf\x98\x8d\ 184 | \x61\x88\x04\x14\x60\x6a\xc0\xe7\xe3\xba\xb4\x0c\xb4\xd1\x79\x1a\ 185 | \x4e\xae\xb1\xe6\x1e\x1e\x1e\xee\x37\xb6\x04\x8e\x8f\x1f\xb3\x9c\ 186 | \x77\xfa\x77\xb9\xde\x67\xb4\x02\x81\x24\x4c\x41\x28\x1e\x69\xa1\ 187 | \x01\x05\x78\x9e\xcf\x07\x20\x00\x4c\x00\x01\x39\x10\xbe\x42\x0d\ 188 | \x78\xd1\x87\xeb\x25\x20\x11\x41\x30\x44\x5e\x60\x00\xd0\xe3\xb3\ 189 | \x0b\xbf\xb1\x08\x38\x3d\x79\xc2\x1b\x7a\xbb\x7f\x00\xe4\xea\x2d\ 190 | \x6a\x0f\x94\xc0\x4b\x41\x24\x03\x39\x0e\xa2\x3c\x19\xe2\xac\x8e\ 191 | \xf2\xb9\x05\xe1\xab\x03\xaf\x19\x74\x0e\x5e\xe6\x03\xf0\xfd\x80\ 192 | \x3f\xdf\xbf\x73\xe7\xe7\x9b\x8a\x00\xc9\x01\xda\x9d\x3d\x40\x5d\ 193 | \x0b\x1f\x72\xd0\x30\x5b\x8b\x19\x9a\x81\x12\xa2\xce\x8e\xe4\x02\ 194 | \x05\x30\x46\xdf\x04\x5e\x96\x01\x01\x72\xcf\x0b\xa3\xcd\x89\x70\ 195 | \x96\x34\x42\xc0\x6b\xaf\xbd\xe6\xbd\xf9\xe6\x9b\x7d\x10\x71\x79\ 196 | \x5b\xe9\x2c\xf7\x0c\x9c\x5a\xf0\x46\x44\x4e\x23\x8e\xbb\xf9\x17\ 197 | \x9e\x8f\xa1\x65\xdc\xd4\x83\x97\x6d\x50\xbc\xcf\x63\x3a\xff\xbc\ 198 | \x49\x84\x80\x2c\x53\x68\x44\x04\xdf\x7e\xfb\xed\x1d\x9b\x03\x24\ 199 | \x41\xd4\xe2\xc2\xa4\x52\x5c\x07\xac\x01\x2f\x5f\x5e\xc6\xc2\x4d\ 200 | \x2e\xb0\x98\x8e\xa0\x15\x8b\x67\x49\xed\xeb\xc1\x13\x00\x89\x14\ 201 | \x9d\x47\x84\xe7\x85\x1b\x02\xd2\xae\xd7\x4c\xf8\x9f\xdd\x5f\x2c\ 202 | \x16\x61\xb2\x73\x88\xa0\xd5\xe1\xb4\x94\x88\x0a\xe0\x4b\x45\x4c\ 203 | \xd1\x04\xad\x34\x17\x3a\x98\x80\xf9\x88\x73\x03\xc9\x1b\x4a\x22\ 204 | \xc7\x64\x96\x48\x31\x84\x52\x5e\xc0\x3b\x0b\x03\x48\xd3\xd4\x69\ 205 | \x24\x02\x5e\x7c\xf1\xc5\xcf\x2b\xa5\xfc\x70\x5d\xd2\x0a\x5a\x50\ 206 | \x59\x26\x1e\x2b\x00\x2f\x85\x32\x98\x00\x2e\x66\xe6\x04\x5c\x8d\ 207 | \x91\xad\x96\xc8\xf1\xeb\xf2\x5c\x59\xf3\xd2\x17\xb3\x46\x69\x8e\ 208 | \xeb\x6f\x72\x13\x1d\x36\x42\xc0\xe9\x60\xd0\xb6\xe0\xc8\x96\xb6\ 209 | \x8d\xeb\x3a\x04\xa3\xca\xe9\x6b\x19\xbc\x00\xd4\x4a\x21\x88\x12\ 210 | \x2e\xa1\xcf\xa6\x97\x5c\x2a\xe3\xe8\xd1\xc5\xb0\xd7\x5a\x04\x0f\ 211 | \xda\x54\xc0\x8b\xf7\x8d\x52\x70\x3d\x21\x20\x6a\x84\x80\x93\x27\ 212 | \xf9\x16\x98\xf4\xf6\x01\x22\x28\xad\x60\xd6\xcd\xe8\x7a\xf0\x92\ 213 | \xcc\x64\xf0\x83\x08\x7e\x9c\x20\x4b\x53\xac\x96\x33\x00\x42\x50\ 214 | \x59\xf0\x64\xbd\x57\xc0\x6b\xb5\xd1\x00\x05\x22\x47\x32\xc8\x46\ 215 | \x34\xe0\x7c\x30\x60\x15\xeb\xed\xdd\xe3\x33\x3a\xc1\x01\x08\x22\ 216 | \x4a\xd0\x0a\xba\x22\x82\x9c\x08\x40\xc3\x70\xc5\x28\x8a\x12\xcc\ 217 | \xc7\x43\xde\x09\xda\x3d\x39\x4d\x16\xe6\xb3\x87\xb5\x29\x12\x24\ 218 | \x04\x68\xd6\x13\x50\xb6\xa9\x41\x10\x94\x52\xed\x46\x08\x98\x4c\ 219 | \x26\x1d\x22\x32\x8e\xe3\x61\x36\x1e\x1a\xa5\x52\x3e\x92\x92\xe3\ 220 | \xc2\x73\x5c\x02\x05\x72\xaa\xd3\xb9\xa7\xc4\x5b\x80\xb1\x73\x03\ 221 | \x84\x71\x67\xb3\x15\x5e\x61\xfd\x1e\xd0\x75\x2e\xe8\x00\x0e\xe4\ 222 | \xe7\x6d\xec\x5c\x06\xec\x30\xa9\x0e\x14\x8c\x21\x18\x10\xe0\x81\ 223 | \xc1\x7b\x41\x0c\x27\xcf\x46\x9b\x29\x88\x0c\x87\xc3\x43\x63\x0c\ 224 | \xbd\xfb\xce\x1f\xe1\x5f\xff\xee\x8b\x70\xfd\x10\x7e\x10\xc2\xf5\ 225 | \xc2\xb5\x22\x1b\x3f\x4c\xf8\x80\xe4\x87\x31\x82\x75\x0b\x5a\xf0\ 226 | \x82\x90\xe7\xb1\xf7\xe3\x1d\x26\x0b\x00\xd9\x3a\x9f\x59\xce\xa6\ 227 | \x58\xcd\xa7\x9b\xdd\x42\xb1\x97\x39\xc4\x91\xef\x1a\x46\x67\x9b\ 228 | \x71\xc5\x9f\xb5\xb9\xfe\xaf\xf2\x0c\xb4\x49\xa8\xc8\x71\xec\x94\ 229 | \xac\xd7\x08\x01\xdd\x6e\x37\x05\x30\xd4\x4a\x85\x8b\xab\x0b\x47\ 230 | \x6b\xed\x1a\x63\x1c\xdb\xd6\x3d\xa1\xde\x40\x44\x5c\xd2\xd6\x2a\ 231 | \xe3\x01\xfb\x03\x07\xfa\xd6\x57\xbf\xcc\xe0\x58\x00\xc1\x15\xa4\ 232 | \x42\xe2\x64\x74\xb1\x58\x92\x97\xce\x80\xcd\x5f\xb2\xfe\x01\x34\ 233 | \xb3\x04\x5e\x7f\xfd\xf5\x37\x46\xa3\x11\xc6\xe3\x71\xeb\xe2\xe2\ 234 | \xc2\x9d\x5c\x5d\xc5\xe3\xcb\xb1\xb7\x5a\x2d\x82\xd1\x64\x1a\x2c\ 235 | \x97\x8b\xe0\x6a\x32\x69\xad\xd2\xd4\x9d\x4e\xa6\x5d\x63\x34\xd9\ 236 | \xbc\x21\xd1\x5a\x3b\xb6\x78\x99\xac\x49\x5a\x64\xba\x0f\x20\x76\ 237 | \xa0\x4e\xd5\x6a\x9a\x01\x20\x63\x0a\x60\x40\xf9\x75\x21\xed\x65\ 238 | \xbb\x1e\x43\xf5\x17\x29\xff\x03\x3d\xd7\xc8\x9a\x1c\xae\x83\xfd\ 239 | \x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\ 240 | " 241 | 242 | qt_resource_name = "\ 243 | \x00\x07\ 244 | \x07\x3b\xe0\xb3\ 245 | \x00\x70\ 246 | \x00\x6c\x00\x75\x00\x67\x00\x69\x00\x6e\x00\x73\ 247 | \x00\x09\ 248 | \x09\xb5\x3b\x7d\ 249 | \x00\x63\ 250 | \x00\x61\x00\x72\x00\x74\x00\x6f\x00\x67\x00\x72\x00\x61\x00\x6d\ 251 | \x00\x06\ 252 | \x06\x8a\x9c\xb3\ 253 | \x00\x61\ 254 | \x00\x73\x00\x73\x00\x65\x00\x74\x00\x73\ 255 | \x00\x08\ 256 | \x0a\x61\x5a\xa7\ 257 | \x00\x69\ 258 | \x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\ 259 | " 260 | 261 | qt_resource_struct = "\ 262 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ 263 | \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ 264 | \x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ 265 | \x00\x00\x00\x2c\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\ 266 | \x00\x00\x00\x3e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ 267 | " 268 | 269 | def qInitResources(): 270 | QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) 271 | 272 | def qCleanupResources(): 273 | QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) 274 | 275 | qInitResources() 276 | --------------------------------------------------------------------------------