ST_intersection converting st_linestring to st_multilinestring

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ST_intersection converting st_linestring to st_multilinestring

Hemant Bist-2
Hi, 
I am trying to figure out if this is expected behavior, or I am running into some bug / misinterpreting results.

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)

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.

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)
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.

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ST_intersection converting st_linestring to st_multilinestring

François Hugues
Hello,

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 ?

(st_dump(multilinestring)).geom will return the different linestrings which compose the multi ones.

Regards,

Hugues



De: "Hemant Bist" <[hidden email]>
À: "PostGIS Users Discussion" <[hidden email]>
Envoyé: Mercredi 12 Avril 2017 21:14:07
Objet: [postgis-users] ST_intersection converting st_linestring to        st_multilinestring

Hi, 
I am trying to figure out if this is expected behavior, or I am running into some bug / misinterpreting results.

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)

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.

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)
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.

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Loading...