TransWikia.com

Displaying both data in different fields in QGIS

Geographic Information Systems Asked on April 19, 2021

I have a Shapefile that is automatically loaded in QGIS. While loading the data the coordinates x & y are automatically displayed.

In my attribute table I have lat_1, long_1 and lat_2, long_2 in the same row. How can I display both at the same time? Is there any solution for that in QGIS?

lat_1, long_1 is the main location. lat_2, long_2 is entry point location.

That means in attribute table field names should be unique right. So it will display only x and y. But in my attribute table there are entry points (lat, long) they are also coordinates. So I want the both x & y (main and entry) displayed. Added screenshot is the attribute table format

enter image description here

One Answer

There are several options to do that:

  1. If one of the points is already shown on the map and you want to include the other one, you can use your attribute values to create new geometries with expressions. In the screenshot you see how the red point is created in this way, the name of the attributes can be selected on the right side by expanding Fields and values where you see the values available. The blue point is the one based on POI_X and POI_Y values: enter image description here To create two points at once, you can use this expression - however the result will be a multipoint geometry. You can convert it to single points using Menu Vector / Geometry Tools / Multipart to Single parts:

    union (
        make_point ( "X1" , "Y1"),
        make_point (  "POI_X" , "POI_Y" )
    )
    
  2. Another option is to use Create points layer from table to create an additional layer, see here for more details: https://gis.stackexchange.com/a/392917/88814 With this solution, you might use batch mode to create several points at once, but each on a separate layer: enter image description here

  3. Export your shapefile as csv (delimited text), than add it to QGIS using Data source manager with the relevant settings, see screenshot. In this case however, you can load only one point per feature. enter image description here

Correct answer by Babel on April 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP