[Qgis-user] Dynamic Line

Nicolas Cadieux njacadieux.gitlab at gmail.com
Sat Nov 14 07:36:10 PST 2020


Hi,

Any csv with a wkt field will behave just like any shape file. Since we can’t add a new field to a csv as it’s in read only mode, you have to export it to an editable format like a virtual layer, dbf, or SpatiaLite and then create the geometries.

Nicolas Cadieux

> Le 13 nov. 2020 à 09:24, Andreas Neumann <a.neumann at carto.net> a écrit :
> 
> 
> Hi Nicolas,
> 
> Yes - but that doesn't magically turn a "non geometry" table into a "geometry table" - as far as I know. So you probably need to create a "Virtual Layer" and create the geometry similar to what you propose.
> 
> Andreas
> 
> Am 13.11.20 um 15:22 schrieb Nicolas Cadieux:
>> Hi,
>> You can create a geometry from WKT if you have x and y fields using and expression in the field calculator.
>> geom_from_wkt('POINT('||"x"||' '||"y"||')')
>> 
>> https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry
>> 
>> Nicolas Cadieux
>> 
>>> Le 13 nov. 2020 à 09:07, Andreas Neumann <a.neumann at carto.net> a écrit :
>>> 
>>> 
>>> Hi
>>> 
>>> Neither GeometryGenerators nor Vector Field Markers work on tables without geometry, unfortunately. You didn't inform us, that you don't have geometry in your table.
>>> 
>>> You can, however, create a "Virtual Layer" and write some SQL to create a geometry from your attributes: menu "Layer" --> "Create Layer" --> "New Virtual Layer" - where you can use your existing tables and create a new geometry column with SQL. See https://docs.qgis.org/testing/en/docs/user_manual/managing_data_source/create_layers.html#creating-virtual-layers
>>> 
>>> Or, if your table is a CSV file, then you can assign attribute columns to a point geometry and then just hide the point rendering if you don't need it.
>>> 
>>> This is an unfortunate limitation of QGIS, that there is no "easy" way to add a geometry column to table that doesn't have geometry (or if it is possible, then I don't know it).
>>> 
>>> Hope this helps you,
>>> 
>>> Andreas
>>> 
>>> Am 13.11.20 um 14:52 schrieb L.W.:
>>>> Does it works on Layers with no geometry?
>>>> 
>>>> My layers do not have a geometry.
>>>> 
>>>> 
>>>> 
>>>> Am 13.11.2020 um 11:56 schrieb Andreas Neumann:
>>>>> Yes, you need point data to start from, but then vectors can bei/are generated from the attributes you mentioned.
>>>>> 
>>>>> Andreas
>>>>> 
>>>>> Am 13.11.20 um 11:47 schrieb L.W.:
>>>>>> from the docs ...
>>>>>> 
>>>>>> ****It can only be used to render point data****
>>>>>> 
>>>>>> 12.2.2.2.6. The Vector Field Marker
>>>>>> 
>>>>>> The vector field marker is used to display vector field data such as earth deformation, tidal flows, and the like. It displays the vectors as lines (preferably arrows) that are scaled and oriented according to selected attributes of data points. ****It can only be used to render point data****; line and polygon layers are not drawn by this symbology.
>>>>>> 
>>>>>> The vector field is defined by attributes in the data, which can represent the field either by:
>>>>>> 
>>>>>> cartesian components (x and y components of the field)
>>>>>> or polar coordinates: in this case, attributes define Length and Angle. The angle may be measured either clockwise from north, or Counterclockwise from east, and may be either in degrees or radians.
>>>>>> or as height only data, which displays a vertical arrow scaled using an attribute of the data. This is appropriate for displaying the vertical component of deformation, for example.
>>>>>> The magnitude of field
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Am 13.11.2020 um 11:34 schrieb Andreas Neumann:
>>>>>>> Or even easier: use the "Vector Field Marker": 
>>>>>>> 
>>>>>>> https://docs.qgis.org/3.10/en/docs/user_manual/style_library/symbol_selector.html?#the-vector-field-marker 
>>>>>>> 
>>>>>>> Am 13.11.20 um 11:33 schrieb Andreas Neumann: 
>>>>>>>> Hi, 
>>>>>>>> 
>>>>>>>> Yes - you can use Geometry Generators for that. Use the make_point() and make_line() expressions for that. 
>>>>>>>> 
>>>>>>>> See https://docs.qgis.org/3.10/en/docs/user_manual/style_library/symbol_selector.html?highlight=geometry%20generator#the-geometry-generator
>>>>>>>> 
>>>>>>>> Greetings, 
>>>>>>>> Andreas 
>>>>>>>> 
>>>>>>>> Am 13.11.20 um 11:26 schrieb L.W.: 
>>>>>>>>> Hi, 
>>>>>>>>> 
>>>>>>>>> is it possible to draw automatically a line between two points defined 
>>>>>>>>> by 4 fields (x1,y1 - x2,y2) in an attributetable? 
>>>>>>>>> 
>>>>>>>>> but I do not want to add a line-layer based on this table nor want to 
>>>>>>>>> draw the line by hand. 
>>>>>>>>> 
>>>>>>>>> thanks 
>>>>>>>>> 
>>>>>>>>> _______________________________________________ 
>>>>>>>>> Qgis-user mailing list 
>>>>>>>>> Qgis-user at lists.osgeo.org 
>>>>>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user 
>>>>>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user 
>>>>>>>> _______________________________________________ 
>>>>>>>> Qgis-user mailing list 
>>>>>>>> Qgis-user at lists.osgeo.org 
>>>>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user 
>>>>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user 
>>>>>>> _______________________________________________ 
>>>>>>> Qgis-user mailing list 
>>>>>>> Qgis-user at lists.osgeo.org 
>>>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user 
>>>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> Qgis-user mailing list
>>>>>> Qgis-user at lists.osgeo.org
>>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Qgis-user mailing list
>>>>> Qgis-user at lists.osgeo.org
>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Qgis-user mailing list
>>>> Qgis-user at lists.osgeo.org
>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20201114/0f34b37a/attachment.html>


More information about the Qgis-user mailing list