3

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

Bruno B
  • 839
  • 3
  • 13
  • 3
    "how can i display both at the same time" ... what do u mean ? are they two different points to display ? – Snaileater Apr 01 '21 at 06:43
  • 2
    Or is it a line – nmtoken Apr 01 '21 at 07:12
  • @snaileater yes they are two different points – Bruno B Apr 01 '21 at 09:27
  • you can use geometry generator, if its for display purposes only. – MrXsquared Apr 01 '21 at 11:05
  • @MrXsquared can you please elaborate – Bruno B Apr 01 '21 at 11:07
  • Bruno ... you ask people to 'elaborate' ... at this stage it is your turn to elaborate your question a bit so that the question can be reopened ... – Snaileater Apr 01 '21 at 12:59
  • What kind of data file format do you have and how do you load it to QGIS? – Babel Apr 03 '21 at 12:16
  • @babel the file is in .shp format. Shapefile is automatically loaded in the qgis. while loading the data the coordinates x & y is automatically displaying. – Bruno B Apr 03 '21 at 12:19
  • I added that info to the question. Rather edit your question that adding comments to increase chances that the question will be re-opened. Please (again) visit the [tour] to see how this site works to avoid frustration for closed or un-ansered questions. As long as the question remains closed, it's not possible to add an answer. Maybe it would help adding a screeshot. – Babel Apr 03 '21 at 12:38

1 Answers1

1

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

Babel
  • 71,072
  • 14
  • 78
  • 208