[Qgis-user] Add a shape within QGIS to a record already in a database layer/table (SQL SERVER)

Alexandre Neto senhor.neto at gmail.com
Tue Jun 17 02:03:30 PDT 2014


I have seen this case scenario before, and I think this can be a good
Plugin Idea. something that would allow to:

- Add a geometry to a record\feature without any geometry (must have a
geometry column already);
- Replace an existing geometry (having a "dummy" geom at some time you will
want to give a proper one);
- remove the geometry from the record\feature;

Alexandre Neto


On Tue, Jun 17, 2014 at 9:53 AM, Bo Victor Thomsen <
bo.victor.thomsen at gmail.com> wrote:

> 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 at 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 at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140617/cd4a2e82/attachment.html>


More information about the Qgis-user mailing list