<html><body><div style="font-family: garamond,new york,times,serif; font-size: 12pt; color: #000000"><div>Hello,</div><div><br data-mce-bogus="1"></div><div>I think this is consistent to have a homogeneous geometry type since a linestring could intersect numerous polygons of a multipolygon. Did you tried the st_dump function on the resulting st_multilinestring ?</div><div><br data-mce-bogus="1"></div><div>(st_dump(multilinestring)).geom will return the different linestrings which compose the multi ones.</div><div><br data-mce-bogus="1"></div><div>Regards,</div><div><br data-mce-bogus="1"></div><div>Hugues</div><div><br></div><div data-marker="__SIG_PRE__"><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Hemant Bist" <hemantbist@gmail.com><br><b>À: </b>"PostGIS Users Discussion" <postgis-users@lists.osgeo.org><br><b>Envoyé: </b>Mercredi 12 Avril 2017 21:14:07<br><b>Objet: </b>[postgis-users] ST_intersection converting st_linestring to st_multilinestring<br></div><div><br></div><div data-marker="__QUOTED_TEXT__"><div dir="ltr"><div>Hi, </div><div>I am trying to figure out if this is expected behavior, or I am running into some bug / misinterpreting results.</div><br><div>I am doing st_intersection(st_linestring, st_multipolygon). This is latlon geometry(EPSG:4326). The multiploygon is actually a polygon (with only one polygon in multipolygon)</div><br><div>When I view the results as KML the intersection look correct, but the problem I see is that the resulting linestrings are unnecessarily getting split in mulilinestring.</div><br><div>1) Every linestring is converted to multilinestring resulting in large nubmer of st_numgeomtries for each multilinestring. (even when the linestring is contained in polygon)</div><div>2) ST_LineMerge on the resulting multilinestring does help but its far from "perfect" e.g. if the linestring is contained in polygon I expected the result to be one linesting, but the result of st_numgeometries() is more than 50.</div></div><br>_______________________________________________<br>postgis-users mailing list<br>postgis-users@lists.osgeo.org<br>https://lists.osgeo.org/mailman/listinfo/postgis-users<br></div></div></body></html>