<div dir="ltr">I have seen this case scenario before, and I think this can be a good Plugin Idea. something that would allow to:<div><br></div><div>- Add a geometry to a record\feature without any geometry (must have a geometry column already);</div>
<div>- Replace an existing geometry (having a "dummy" geom at some time you will want to give a proper one);</div><div>- remove the geometry from the record\feature;</div><div><br></div><div>Alexandre Neto</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 9:53 AM, Bo Victor Thomsen <span dir="ltr"><<a href="mailto:bo.victor.thomsen@gmail.com" target="_blank">bo.victor.thomsen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can create a SQLServer based insert trigger, that checks the new record. If the record doesn't contain a geometry object (geometry is null) it can create a "dummy" geometry before inserting the record in the database, for example a polygon square. The position of the square should be determined by some other information in the new record, so every dummy square has an unique position.<br>

<br>
Regards<br>
Bo Victor Thomsen<br>
Aestas-GIS<br>
Denmark<br>
<br>
Den 17-06-2014 09:09, Bernhard Ströbl skrev:<div class="HOEnZb"><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
not sure about MySql (I use PostgreSQL). How if you define a default polygon that is used upon inserting a new dataset with null polygon (needs a trigger maybe). You can later change that polygon in QGIS.<br>
IMHO the better way would be to create the dataset from within QGIS by digitizing the new polygon, though.<br>
<br>
Bernhard<br>
<br>
Am 17.06.2014 08:54, schrieb Carlos da Ponte:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everyone,<br>
Is there a way to add a shape (eg polygon) to a record in a database table<br>
added to QGIS, where the record was originally created in a database form<br>
elsewhere.  (probably makes more sense as an example).<br>
<br>
In my SQL Server database form I create a new record for a mine site in a<br>
table that has a geography field.<br>
<br>
I then go into QGIS, load the layer/table via the SQL Server connection.  I<br>
now want to create a polygon shape associated with the new mine site record<br>
I created.  Typically I would just edit the existing shape associated with<br>
the record, but since there is no shape associated with this record, it<br>
doesnt appear there is a way to create a shape to associate to an existing<br>
record.<br>
<br>
Is this possible (all of my attempts say no).  Is there a better way for<br>
this workflow to happen.  I could create a child table to house the geometry<br>
and then use a key relationship to associate it to the record but I want as<br>
few tables as possible as this adds tables & increases complexity for novice<br>
users.<br>
<br>
Thoughts?<br>
C<br>
<br>
<br>
<br>
-- <br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Add-a-shape-within-QGIS-to-a-record-already-in-a-database-layer-table-SQL-SERVER-tp5146218.html" target="_blank">http://osgeo-org.1560.x6.<u></u>nabble.com/Add-a-shape-within-<u></u>QGIS-to-a-record-already-in-a-<u></u>database-layer-table-SQL-<u></u>SERVER-tp5146218.html</a><br>

Sent from the Quantum GIS - User mailing list archive at Nabble.com.<br>
______________________________<u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a><br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus signature database 9956 (20140617) __________<br>
<br>
The message was checked by ESET Mail Security.<br>
<a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
<br>
<br>
</blockquote>
<br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus signature database 9956 (20140617) __________<br>
<br>
The message was checked by ESET Mail Security.<br>
<a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
<br>
<br>
______________________________<u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a><br>
</div></div></blockquote></div><br></div>