简体   繁体   中英

Any solutions to interpolate MULTILINESTRING?

Here is some part of my table

the_new_geom    
MULTILINESTRING((100.594606800391 13.872016439113...    
LINESTRING(100.622342929363 13.9502950094115,100....    
LINESTRING(100.618133904403 14.1676090338694,100....    
LINESTRING(100.823426479749 14.2959151254166,100....    
MULTILINESTRING((100.823426479749 14.295915125416...    

It contains BOTH LINESTRINGs and also MULTILINESTRINGs

I would like to do the ST_line_interpolate_point to these dataset

BUT

ST_line_interpolate_point required only LINESTRING on the 1st argument.

So are there any solutions to convert from MULTILINESTRING to a single LINESTRING ?

OR

How to check that the MULTILINESTRING can be convert ?

Yes, there is a way to check if a multiline can be converted to a Line, first you try to convert it, and then you check the number of geomtries. If the number of geometries is equal to 1 it means a successful conversion from multiline to line:

SELECT * FROM mytable WHERE ST_NumGeometries(ST_LineMerge(the_geom)) = 1 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM