Giter VIP home page Giter VIP logo

cartogram3's People

Contributors

christophfink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cartogram3's Issues

move ALL blocking functions into Worker

At the moment we create a memory layer in the main thread. This potentially blocks the ui for a noticable.
we can also move this into the worker, and iterate over all fieldNames there
also, split up the main threads workerFinished into layerFinished and workerFinished

implement Opti-DNC

In this article Dougenik et al.’s algorithm is improved and optimised:

First, it provides a mathematical condition
for topology preservation. Second, new transformation equations that meet this condition are deduced from
mathematics, which simultaneously optimize the global elasticity coefficient, a key parameter that greatly
impacts the convergence rate of the rubber-sheet algorithm and the topological integrity of its generated
cartograms. Last, the new algorithm simplifies the way of generating transforming forces in DCN and
improves its efficiency of geometric transformation.

TypeError: QgsMapLayer.exportNamedStyle(): not enough arguments

Hi,

When I compute cartogram3 (the version you put on the "TypeError: QgsMapLayer.exportNamedStyle(): argument 2 has unexpected type 'str'" thread) on the austrian data and my own data, I have this error message.

2018-11-26T14:10:47 WARNING Traceback (most recent call last):
File "C:/Users/ndevienne/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cartogram3\cartogram3.py", line 317, in run
self.inputLayer.exportNamedStyle(self.inputLayerStyle)
TypeError: QgsMapLayer.exportNamedStyle(): not enough arguments

I tried to understand the code, but I don't read Python ^^

Could you help me ?

Crashing

I tried installing cartogram3 on QGIS 3.20.0-Odense on MacOS 11.4. If I try to activate it QGIS crashes unceremoniously

Handling Null Values

The plugin requires all fields be assigned a value (i.e., cannot handle null values). This requires the user to either manually enter 0 or to use a layout with the areas with null values being omitted. It'd be great to have an option to treat nulls as 0 or to leave the areas with null values unchanged in area.

Add sample data

It would be nice if users can quickly load a sample data set to try out the plugin (the QGIS2 plugins had this feature)
A nice place would be to add a button to the "you need at least one polygon layer" error message.

Bug on MacOS

Hi there,

I installed the plugin through the QGIS plugin downloader and it keeps crashing, opening 10 new QGIS windows and actually not running the cartogram algorithm.
I tried downloading directly the latest version using the source code zip, but I get this error:

Couldn't load plugin '__MACOSX/cartogram3-3.1.2' 
ModuleNotFoundError: No module named '__MACOSX/cartogram3-3' 

Wondering if it's just a MacOS issue as I have not found anyone else complaining about this online.

I teach GIS and have been using this plugin last year, was hoping I could keep teaching it to the current and next cohorts!

Thanks

Cartogram computation never moves beyond 1%

Hi

Thanks also for the work. I am on Catalina using 3.22 and although Cartogram no longer seems to crash QGIS loading other layers (or at least vector ones), when I try to compute a cartogram it seems to enter into a perpetual loop. I get the progress bar and then nothing happens. The test layer is small - 300K with 151 features. Most are convex so the calculations should be straightforward. I’m not sure if others have been having this issue.

Best Regards,

David Walker

Mailing, mailing over the EM waves.

Originally posted by @djwalkr in #22 (comment)

TypeError: QgsMapLayer.exportNamedStyle(): argument 2 has unexpected type 'str'

bug report submitted via e-mail:

When trying to use cartogram I get following message (my data and demo dat)
Any idea to resolve this ?

2018-11-19T13:13:40 WARNING Traceback (most recent call last):
File "C:[…]/python/plugins\cartogram3\cartogram3.py", line 317, in run
self.inputLayer.exportNamedStyle(self.inputLayerStyle, "")
TypeError: QgsMapLayer.exportNamedStyle(): argument 2 has unexpected type 'str'

Plugin does not work on Python < 3.8

Hi,
I heard and seen a lot of good things about the cartogram3 plugin, thank you for that. Unfortunately it wasn't possible for me to install it on various machines. I tried it on different PCs, all Win10.
When I try to install the plugin (doesn't matter which version of the plugin, or QQIS version, I tried 5 different ones, 3.24 down to 3.1). The error message is always the same:

Konnte Erweiterung 'cartogram3' nicht laden aufgrund eines Fehlers beim Aufruf der classFactory() Methode

SyntaxError: invalid syntax
Traceback (most recent call last):
File "C:/PROGRA1/QGIS31.16/apps/qgis-ltr/./python\qgis\utils.py", line 334, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cartogram3_init
.py", line 34, in classFactory
from .cartogram3 import Cartogram
File "C:/PROGRA1/QGIS31.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cartogram3\cartogram3.py", line 9, in
from .lib import CartogramUserInterfaceMixIn, CartogramWorkOrchestratorMixIn
File "C:/PROGRA1/QGIS31.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cartogram3\lib_init
.py", line 5, in
from .cartogramprocessingprovider import CartogramProcessingProvider
File "C:/PROGRA1/QGIS31.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cartogram3\lib\cartogramprocessingprovider.py", line 12, in
from .cartogramprocessingalgorithm import CartogramProcessingAlgorithm
File "C:/PROGRA1/QGIS31.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cartogram3\lib\cartogramprocessingalgorithm.py", line 24, in
from .cartogramfeatures import CartogramFeatures
File "C:/PROGRA1/QGIS31.16/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cartogram3\lib\cartogramfeatures.py", line 31
def _cache(user_function, /):
^
SyntaxError: invalid syntax

Python-Version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS-Version: 3.16.6-Hannover Hannover, bfd36fddc9

Python-Pfad:
C:/PROGRA1/QGIS31.16/apps/qgis-ltr/./python
C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA1/QGIS31.16/apps/qgis-ltr/./python/plugins
C:\PROGRA1\QGIS31.16\apps\Python37
C:\PROGRA1\QGIS31.16\apps\Python37\Scripts
C:\Program Files\QGIS 3.16\bin\python37.zip
C:\PROGRA1\QGIS31.16\apps\Python37\DLLs
C:\PROGRA1\QGIS31.16\apps\Python37\lib
C:\Program Files\QGIS 3.16\bin
C:\Users\USER\AppData\Roaming\Python\Python37\site-packages
C:\PROGRA1\QGIS31.16\apps\Python37\lib\site-packages
C:\PROGRA1\QGIS31.16\apps\Python37\lib\site-packages\win32
C:\PROGRA1\QGIS31.16\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA1\QGIS31.16\apps\Python37\lib\site-packages\Pythonwin
C:/Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\mmqgis/forms

On one machine the installation works, but when I start a process it just doesn't do anything. (the task is at 0% processor usage) and there is no change or process, that also happens when I start it from the toolbox.

Am I missing something here? It seems I am the only or first one to have this trouble, I didn't find a similar thread anywhere.

Anyways I would be very glad if you could help me, maybe (hopefully) it's something obvious and I am just an idiot.
Thanks in advance.
KaR

Save iteration progress after crash?

QGIS will usually crash for me when I try to do a cartogram with lots of features and a large number of iterations (right now, for instance, I'm trying to do 100 iterations on 2850 features). I'm presuming it has something to do with memory or cpu or something. (I'm using cartogram 3.0 from the plugin manager on QGIS 3.0.3 on Windows 10.)

My main request though is, for instance, if it crashes during, say, iteration 30 of 100, can I get a dump of iteration 29? Because it might be good enough, but I don't want to run the whole thing again just to have it crash again on iteration 23 for instance.

Memory management on Windows

It seems (rel. issue #16) that we can run out of memory on Windows despite deleting/unsetting unused objects for Python garbage collection to kick in.
What can we do to avoid running out of ram?

Just hangs in 0% with this dataset

Is something wrong with the data? Too big?

Cartogram either hangs in 0% or crashes immediately QGIS (tested with 3.13 and 3.14 on mac). With the bundled sample data on same QGIS cartogram works fine.

image

Archive.zip

improve performance

The current solution of sending WKT strings into the worker’s queues performs almost as bad as the original one-threaded implementation.
We don’t use QgsGeometry, because its asPolygon() and asMultiPolygon() segfault on some platforms (http://hub.qgis.org/issues/16198) – without a chance of catching an exception.

A QgsFeature’s QgsGeometry can return its QgsAbstractGeometry, which in turn allows to directly access its vertices. That’s exactly what we want!

http://qgis.org/api/classQgsGeometry.html
http://qgis.org/api/classQgsAbstractGeometry.html

Update translations

Update translations for:

  • German
  • Spanish
  • Danish (who contributed this?)

Maybe add new translations for:

  • French
  • Finnish
  • ...

QgsGeometry.set() is deprecated

2019-05-22T21:52:45 WARNING warning:/home/christoph/.local/share/QGIS/QGIS3/profiles/default/python/plugins/cartogram3/cartogram_worker.py:298: DeprecationWarning: QgsGeometry.set() is deprecated
features[featureId].set(abstractGeometry)

         traceback: File "/home/christoph/.local/share/QGIS/QGIS3/profiles/default/python/plugins/cartogram3/cartogram_worker.py", line 135, in run
          self.transformFeatures()
          File "/home/christoph/.local/share/QGIS/QGIS3/profiles/default/python/plugins/cartogram3/cartogram_worker.py", line 298, in transformFeatures
          features[featureId].set(abstractGeometry)

AttributeError: type object 'QgsMessageBar' has no attribute 'INFO'

Fresh install of QGIS3, and tried to run Cartogram 3, but throwing error:

Traceback (most recent call last): File "C:/Users/skipp/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\cartogram3\cartogram3.py", line 346, in run QgsMessageBar.INFO AttributeError: type object 'QgsMessageBar' has no attribute 'INFO'

Using the Austria example dataset...

Fix invalid polygons in input data set

Some input data sets, including some versions of the Natural Earth adm0 layers, seem to contain invalid polygons, and it is still surprisingly easy to produce invalid geometries, e.g., when reprojecting data sets.

Let’s apply a zero-width buffer to any input data set in order to fix the most common problems. This is not very costly in terms of computation, and helps avoid frustration down the road.

Plugin crash in Qgis 3.22

Hello, I have a problem with the Cartogram plugin in QGIS 3.16.12 , 12 and 13.
It seems that the grass plugin is the problem.
In a test with QGIS 3.16.8 with Grass 7.8.5 cortogram works.
Does the method of calling GRASS change between these versions?

I also tried to start cartogram from the github master, it does not work.

Sincerely Alexandre Granié

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.