I have a table with multilinestrings and I would like to find a line which starts at a certain point. I am using:
gis=> select * from (select gid, ST_StartPoint(ST_LineMerge((geom))) as start from aw_pipes) s where s.start = '0101000020E6100000D050E433E678D73F71F37608AF284A40' order by gid;
gid | start
------+----------------------------------------------------
1458 | 0101000020E6100000809BB933E678D73FE3D07608AF284A40
(1 row)
The problem here is the result has different geom. It is not what I asked for. It doesn't event contain the geom I was searching for.
gis=> select geom from aw_pipes where gid = 1458;
geom
--------------------------------------------------------------------------------------------------------------
0105000020E610000001000000010200000002000000809BB933E678D73FE3D07608AF284A40CDD4B35E4E7BD73F62DB7D83AD284A40
(1 row)
gis=> select ST_DumpPoints('0105000020E610000001000000010200000002000000809BB933E678D73FE3D07608AF284A40CDD4B35E4E7BD73F62DB7D83AD284A40');
st_dumppoints
--------------------------------------------------------------
("{1,1}",0101000020E6100000809BB933E678D73FE3D07608AF284A40)
("{1,2}",0101000020E6100000CDD4B35E4E7BD73F62DB7D83AD284A40)
(2 rows)
My postgis version is:
gis=> select PostGIS_Version ();
postgis_version
---------------------------------------
2.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
Any idea what I am doing wrong or any suggestion what I may change in my query?