Skip to main content
added 36 characters in body; edited tags; edited title
Source Link
Taras
  • 33.9k
  • 4
  • 73
  • 148

Concatenating string with spacespaces in QGIS Expression

I am adding a number ofseveral strings together to create a linestringLineString but as such I need spaces between the initial XY values and the end XY values, plus a comma in between the two halves.

Should result in LINESTRING(97763.88319 434314.9609 , 97620.90369 434175.115)LINESTRING(97763.88319 434314.9609 , 97620.90369 434175.115) but the space is not recognized likeas it would be in excelExcel I don't want to make another attribute which only holds a space to then include it as a variable.

This is the expression I used:

concat("LINESTRING(", "X", " ", "Y", " , ", "newX", " " , "newY")

concat("LINESTRING(", "X", " ", "Y", " , ", "newX", " ", "newY")

Field calculator

Concatenating string with space

I am adding a number of strings together to create a linestring but as such I need spaces between the initial XY values and the end XY values, plus a comma in between the two halves.

Should result in LINESTRING(97763.88319 434314.9609 , 97620.90369 434175.115) but the space is not recognized like it would be in excel I don't want to make another attribute which only holds a space to then include it as a variable.

This is the expression I used:

concat("LINESTRING(", "X", " ", "Y", " , ", "newX", " " , "newY")

Field calculator

Concatenating string with spaces in QGIS Expression

I am adding several strings together to create a LineString but as such I need spaces between the initial XY values and the end XY values, plus a comma in between the two halves.

Should result in LINESTRING(97763.88319 434314.9609 , 97620.90369 434175.115) but the space is not recognized as it would be in Excel I don't want to make another attribute which only holds a space to then include it as a variable.

This is the expression I used:

concat("LINESTRING(", "X", " ", "Y", " , ", "newX", " ", "newY")

Field calculator

Source Link
nashm999
  • 327
  • 1
  • 3
  • 10

Concatenating string with space

I am adding a number of strings together to create a linestring but as such I need spaces between the initial XY values and the end XY values, plus a comma in between the two halves.

Should result in LINESTRING(97763.88319 434314.9609 , 97620.90369 434175.115) but the space is not recognized like it would be in excel I don't want to make another attribute which only holds a space to then include it as a variable.

This is the expression I used:

concat("LINESTRING(", "X", " ", "Y", " , ", "newX", " " , "newY")

Field calculator