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.

Regards
Bo Victor Thomsen
Aestas-GIS
Denmark

Den 17-06-2014 09:09, Bernhard Ströbl skrev:
Hi,

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. IMHO the better way would be to create the dataset from within QGIS by digitizing the new polygon, though.

Bernhard

Am 17.06.2014 08:54, schrieb Carlos da Ponte:
Hi everyone,
Is there a way to add a shape (eg polygon) to a record in a database table added to QGIS, where the record was originally created in a database form
elsewhere.  (probably makes more sense as an example).

In my SQL Server database form I create a new record for a mine site in a
table that has a geography field.

I then go into QGIS, load the layer/table via the SQL Server connection. I now want to create a polygon shape associated with the new mine site record I created. Typically I would just edit the existing shape associated with
the record, but since there is no shape associated with this record, it
doesnt appear there is a way to create a shape to associate to an existing
record.

Is this possible (all of my attempts say no).  Is there a better way for
this workflow to happen. I could create a child table to house the geometry and then use a key relationship to associate it to the record but I want as few tables as possible as this adds tables & increases complexity for novice
users.

Thoughts?
C



--
View this message in context: 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
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


__________ Information from ESET Mail Security, version of virus signature database 9956 (20140617) __________

The message was checked by ESET Mail Security.
http://www.eset.com





__________ Information from ESET Mail Security, version of virus signature database 9956 (20140617) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to