<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Please <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Please get me out of the mailing list<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>thank you very much<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Belén Cálcena<o:p></o:p></span></p><p class=MsoNormal><b><span lang=ES-PY style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>MERIT Paraguay S.A.<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>RF. Engineer<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Rivarola Matto 5837 c/ R.I. 6 Boquerón<o:p></o:p></span></p><p class=MsoNormal><span lang=ES style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Asuncion, Paraguay<o:p></o:p></span></p><p class=MsoNormal><span lang=ES style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Landline/FAX: +595-21-606-</span><span lang=ES-PY style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>691/92<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Cellular: +595-994-355-735<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><img width=208 height=148 id="Picture_x0020_1" src="cid:image001.jpg@01CFC78E.7F8AF3D0" alt="LOGO 2"><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Max Demars [mailto:burton449geo@gmail.com] <br><b>Sent:</b> Wednesday, September 03, 2014 3:45 PM<br><b>To:</b> PostGIS Users Discussion<br><b>Subject:</b> Re: [postgis-users] ST_AsGeoJson output geometry type not the same as input<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Thank you very much, this is what I was looking for.<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>-Cheers<o:p></o:p></p></div><p class=MsoNormal>-Max Demars<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Wed, Sep 3, 2014 at 3:55 AM, Sandro Santilli <<a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a>> wrote:<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>On Tue, Sep 02, 2014 at 01:19:55PM -0400, Max Demars wrote:<br>> Hi list,<br>><br>> I am using postgis to split a multipolygon feature by a linestring. Both<br>> feature are geojson inputs.<br>><br>> However the outputs returns a geojson that is a geocollection of two<br>> polygon features. In fact this is correct, but for consistency I would like<br>> to keep the the splitted features into a single Multipolygon (even if there<br>> is only one linear ring in it). Is it possible?<o:p></o:p></p></div><p class=MsoNormal>Possible, but such a multipolygon would be invalid.<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>> This is my query:<br>><br>> SQLQuery = '''SELECT<br>> ST_AsGeoJSON(ST_Split(ST_GeomFromGeoJSON('%s'),ST_GeomFromGeoJSON('%s')))::json<br>> As f''' % (feature,blade)<o:p></o:p></p></div><p class=MsoNormal>Make it:<br><br>SELECT<br>ST_AsGeoJSON(<br> ST_Collect(geom) FROM (<br>  SELECT (<br>    ST_Dump(<br>      ST_Split(ST_GeomFromGeoJSON('%s'), ST_GeomFromGeoJSON('%s'))<br>    )<br>  ).geom<br> ) foo<br>)::json As f<br><br>ST_Collect will create a MULTIPOLYGON if all inputs are of the POLYGON type.<br><br>--strk;<br><br> ()  ASCII ribbon campaign  --  Keep it simple !<br> /\  <a href="http://strk.keybit.net/rants/ascii_mails.txt" target="_blank">http://strk.keybit.net/rants/ascii_mails.txt</a><br>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><o:p></o:p></p></div><p class=MsoNormal><br><br clear=all><br>-- <o:p></o:p></p><div><div><div><div><p class=MsoNormal>Stack Overflow: <a href="http://stackoverflow.com/users/1914034/burton449" target="_blank">http://stackoverflow.com/users/1914034/burton449</a><o:p></o:p></p></div></div><p class=MsoNormal>GIS Overflow: <a href="http://gis.stackexchange.com/users/14426/burton449" target="_blank">http://gis.stackexchange.com/users/14426/burton449</a><o:p></o:p></p></div><p class=MsoNormal>LastFm: <a href="http://www.lastfm.fr/user/burton449" target="_blank">http://www.lastfm.fr/user/burton449</a><o:p></o:p></p></div></div></div></body></html>