<div dir="ltr"><div dir="ltr">Hi Tomas,<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(0,0,0)">  Let's say we have a layer L (PostgreSQL/PostGIS) with features A, B<br></span><blockquote><span style="color:rgb(0,0,0)">and C with corresponding attribute values set.<br></span><span style="color:rgb(0,0,0)">  Now some external party sends us a shapefile S with an updated<br></span><span style="color:rgb(0,0,0)">geometry G which we want to apply to feature B.</span><br style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">  We want to:<br></span><span style="color:rgb(0,0,0)">  1. Select G in layer S and press Ctrl+C<br></span><span style="color:rgb(0,0,0)">  2. Select feature B in layer L (layer is in edit mode).<br></span><span style="color:rgb(0,0,0)">  3. Do "Paste geometry" which should change geometry of feature B but<br></span><span style="color:rgb(0,0,0)">leave all attribute values intact. This must be an update (not<br></span><span style="color:rgb(0,0,0)">delete/insert) operation for record B in database table, as database<br></span><span style="color:rgb(0,0,0)">would usually have different sequences, triggers with business logic<br></span><span style="color:rgb(0,0,0)">etc.</span></blockquote></blockquote><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Do you happen to have a common field in your layers L and S, which allows you to know that geometry G goes to feature B?</span></div><div><span style="color:rgb(0,0,0)">If that's the case, you could apply all geometry updates at once, based on this common field.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">In its current version (v1.5.0), t</span><span style="color:rgb(0,0,0)">he plugin "Append Features To Layer" can update features based on common field values (e.g., an ID or a code).</span></div><div><span style="color:rgb(0,0,0)">It'd be simple to add a "Only update geometries" option. I've just created a feature request [1], feel free to join if you'd like to help testing a dev version.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)"><i>Disclaimer: I wrote the plugin :)</i></span></div><div><span style="color:rgb(0,0,0)"><i><br></i></span></div><div><span style="color:rgb(0,0,0)">Regards,</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Germán</span></div><div>-----------</div><div>[1] <a href="https://github.com/gacarrillor/AppendFeaturesToLayer/issues/22" target="_blank">https://github.com/gacarrillor/AppendFeaturesToLayer/issues/22</a></div></div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié, 29 nov 2023 a las 13:52, Keith Jenkins via QGIS-Developer (<<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> I am aware of a python plugin for that but it does not work for<br>
> large geometries as clipboard size limit is reached pretty fast on<br>
> windows.<br>
<br>
Hi, Tomas.<br>
<br>
I just tested the "Geometry Paster" plugin and also ran into this<br>
clipboard size limit.  It looks like the code for the plugin tries to<br>
avoid this problem:<br>
<br>
csv.field_size_limit(sys.maxsize)<br>
<br>
But this doesn't seem to have the intended effect.  On my machine,<br>
sys.maxsize is 9223372036854775807, which appears to be too large for<br>
setting the csv.field_size_limit.  One workaround would be to open the<br>
QGIS Python console and set it manually to the maximum longint value:<br>
<br>
csv.field_size_limit(2147483647)<br>
<br>
It looks like there is already a pull request to fix this in the<br>
plugin, from just 3 days ago:<br>
<a href="https://github.com/nextgis/qgis_geometry_paster/pull/12/files" rel="noreferrer" target="_blank">https://github.com/nextgis/qgis_geometry_paster/pull/12/files</a><br>
<br>
Cheers,<br>
Keith<br>
<br>
On Tue, Nov 28, 2023 at 3:37 PM Tomas Straupis via QGIS-Developer<br>
<<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a>> wrote:<br>
><br>
> Hello<br>
><br>
>   I was wondering, is there any reason why "paste geometry" (for<br>
> vector features) is not implemented in QGIS? Or is it simply because<br>
> nobody implemented it (I'm thinking of trying to do that)?<br>
><br>
>   The use case is different government cadastres where geometry is<br>
> provided by external institutions and institution responsible for<br>
> maintaining the cadastre is adding the attribute values. While they<br>
> can use full feature paste (with attributes) for initial record<br>
> creation, updating requires the possibility to paste geometry only<br>
> without changing any attribute values.<br>
><br>
>   Thank you<br>
><br>
> P.S. I am aware of a python plugin for that but it does not work for<br>
> large geometries as clipboard size limit is reached pretty fast on<br>
> windows.<br>
><br>
> --<br>
> Tomas<br>
> _______________________________________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>-----------<br></div><div>   |\__  <br>(:>__)(<br>   |/    <br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br><a href="http://twitter.com/GeoTux2" target="_blank">https://twitter.com/GeoTux2</a></div><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div></div></div></div></div></div></div><div><div><br></div><div><a href="http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo" target="_blank"><img src="http://gis.stackexchange.com/users/flair/4972.png"></a></div></div></div></div></div></div></div></div>