[QGIS-Developer] Paste geometry functionality

Keith Jenkins kgj2 at cornell.edu
Wed Nov 29 10:52:40 PST 2023


> I am aware of a python plugin for that but it does not work for
> large geometries as clipboard size limit is reached pretty fast on
> windows.

Hi, Tomas.

I just tested the "Geometry Paster" plugin and also ran into this
clipboard size limit.  It looks like the code for the plugin tries to
avoid this problem:

csv.field_size_limit(sys.maxsize)

But this doesn't seem to have the intended effect.  On my machine,
sys.maxsize is 9223372036854775807, which appears to be too large for
setting the csv.field_size_limit.  One workaround would be to open the
QGIS Python console and set it manually to the maximum longint value:

csv.field_size_limit(2147483647)

It looks like there is already a pull request to fix this in the
plugin, from just 3 days ago:
https://github.com/nextgis/qgis_geometry_paster/pull/12/files

Cheers,
Keith

On Tue, Nov 28, 2023 at 3:37 PM Tomas Straupis via QGIS-Developer
<qgis-developer at lists.osgeo.org> wrote:
>
> Hello
>
>   I was wondering, is there any reason why "paste geometry" (for
> vector features) is not implemented in QGIS? Or is it simply because
> nobody implemented it (I'm thinking of trying to do that)?
>
>   The use case is different government cadastres where geometry is
> provided by external institutions and institution responsible for
> maintaining the cadastre is adding the attribute values. While they
> can use full feature paste (with attributes) for initial record
> creation, updating requires the possibility to paste geometry only
> without changing any attribute values.
>
>   Thank you
>
> P.S. I am aware of a python plugin for that but it does not work for
> large geometries as clipboard size limit is reached pretty fast on
> windows.
>
> --
> Tomas
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list