Skip to main content
deleted 11 characters in body
Source Link
GforGIS
  • 3.3k
  • 4
  • 22
  • 39

I want to merge linestring in the correct order in postGIS, but sometime they are reversed so something like this :

select astext(linemerge(ST_union(
ST_GeomFromText('LINESTRING(3 3, 2 2)'),
ST_GeomFromText('LINESTRING(1 1, 2 2)'))));

returns this :

"LINESTRING(1 1,2 2,3 3)"

But I want this :

"LINESTRING(3 3, 2 2, 1 1)"

I really don't know what to do,

Thanks.

I want to merge linestring in the correct order in postGIS, but sometime they are reversed so something like this :

select astext(linemerge(ST_union(
ST_GeomFromText('LINESTRING(3 3, 2 2)'),
ST_GeomFromText('LINESTRING(1 1, 2 2)'))));

returns this :

"LINESTRING(1 1,2 2,3 3)"

But I want this :

"LINESTRING(3 3, 2 2, 1 1)"

I really don't know what to do,

Thanks.

I want to merge linestring in the correct order in postGIS, but sometime they are reversed so something like this :

select astext(linemerge(ST_union(
ST_GeomFromText('LINESTRING(3 3, 2 2)'),
ST_GeomFromText('LINESTRING(1 1, 2 2)'))));

returns this :

"LINESTRING(1 1,2 2,3 3)"

But I want this :

"LINESTRING(3 3, 2 2, 1 1)"

I really don't know what to do.

Tweeted twitter.com/#!/StackGIS/status/119124687438614528
Source Link
hokkos
  • 552
  • 1
  • 4
  • 11

Merge reversed linestring in correct order in postGIS

I want to merge linestring in the correct order in postGIS, but sometime they are reversed so something like this :

select astext(linemerge(ST_union(
ST_GeomFromText('LINESTRING(3 3, 2 2)'),
ST_GeomFromText('LINESTRING(1 1, 2 2)'))));

returns this :

"LINESTRING(1 1,2 2,3 3)"

But I want this :

"LINESTRING(3 3, 2 2, 1 1)"

I really don't know what to do,

Thanks.