<div dir="ltr">Thanks for that, Jukka, and sorry for the vagueness of my original post... I was under a very tight deadline to finish something on Thursday before being away for a long weekend.<div><br></div><div>I got the same result as you without the -lco option. The output file just contained the same MULTIPOLYGONS, although the file was not identical (I presume due to precision of some of the numbers).</div><div><br></div><div>Adding that option, however, still doesn't create a third column, at least not with my file, which I also neglected to say is very wide (hundreds of thousands of small POLYGONs in each MULTIPOLYGON).</div><div><br></div><div>The file is private data, so I can't post it, I'm afraid.</div><div><br></div><div>In the end, I wrote a script to just read in the file as text and chop up the lines, basically splitting on ")),((".</div><div><br></div><div>I'll have a play with geopandas too.</div><div><br></div><div>SE</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 11, 2019 at 6:09 AM jratike80 <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Here is a partial solution or workaround<br>
<br>
Take this as input<br>
<br>
id,wkt<br>
1,"MULTIPOLYGON ((( 296 643, 623 660, 531 484, 349 507, 296 643 )), (( 681<br>
635, 895 588, 632 432, 681 635 )))"<br>
<br>
Run this <br>
ogr2ogr -f csv -lco geometry=as_wkt -explodecollections wkt_expl.csv wkt.csv<br>
<br>
Get this result<br>
<br>
WKT,id,wkt<br>
"POLYGON ((296 643,623 660,531 484,349 507,296 643))","1","MULTIPOLYGON (((<br>
296 643, 623 660, 531 484, 349 507, 296 643 )), (( 681 635, 895 588, 632<br>
432, 681 635 )))"<br>
"POLYGON ((681 635,895 588,632 432,681 635))","1","MULTIPOLYGON ((( 296 643,<br>
623 660, 531 484, 349 507, 296 643 )), (( 681 635, 895 588, 632 432, 681 635<br>
)))"<br>
<br>
So, the original multigeometry is included in both lines but an additional<br>
WKT columns contains the exploded polygons. Without -lco geometry=as_wkt<br>
just the the multipolygon geometry is written into both lines.<br>
<br>
id,wkt<br>
"1","MULTIPOLYGON ((( 296 643, 623 660, 531 484, 349 507, 296 643 )), (( 681<br>
635, 895 588, 632 432, 681 635 )))"<br>
"1","MULTIPOLYGON ((( 296 643, 623 660, 531 484, 349 507, 296 643 )), (( 681<br>
635, 895 588, 632 432, 681 635 )))"<br>
<br>
<br>
So something happened but not exactly what I would have guessed. Use case is<br>
a bit special but perhaps this is buggy behavior.<br>
<br>
-Jukka Rahkonen-<br>
<br>
<br>
<br>
jratike80 wrote<br>
> Hi,<br>
> <br>
> Please provide some test data and explain in details what did you try.<br>
> Spending some time for making an answerable question would certainly be<br>
> the<br>
> best way for getting fast and usable help.<br>
> <br>
> -Jukka Rahkonen-<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="margin:0px;padding:0px 0px 20px;width:2544px;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium"><div><div style="font-size:12.8px;margin:8px 0px 0px;padding:0px"><div><div dir="ltr"><span><font color="#888888"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><table cellpadding="0" cellspacing="0" border="0" style="font-family:Times;width:2544px"><tbody><tr><td align="left" style="vertical-align:top;font-size:0px"><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td align="left" style="padding:0px 15px 0px 0px;vertical-align:middle"><font face="arial, helvetica, sans-serif" size="2"><a href="http://www.omnisci.com/" target="_blank"><img src="http://www2.omnisci.com/l/298412/2018-09-18/3sqpg/298412/61753/OmniSci_Email_Header2.png"></a><br></font></td><td align="left" style="padding:0px 0px 0px 15px;vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="width:215px"><tbody><tr><td align="left" style="vertical-align:top"><span style="white-space:nowrap;color:rgb(0,0,1)"><span style="color:rgb(14,76,144);font-weight:700"><font face="arial, helvetica, sans-serif" size="2">Simon Eves</font></span></span></td></tr><tr><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td align="left" style="vertical-align:top"><span style="white-space:nowrap;color:rgb(0,0,1)"><font face="arial, helvetica, sans-serif" size="2">Senior Graphics Engineer, Rendering Group<br>100 Montgomery St (5th Floor), San Francisco, CA 94104, USA<br></font></span></td></tr></tbody></table></td></tr><tr><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td align="left" style="padding:0px;vertical-align:top"><br></td><td align="left" style="padding:0px;vertical-align:top"><br></td></tr><tr><td align="left" style="padding:0px;vertical-align:top"><span style="white-space:nowrap;color:rgb(0,0,1)"><font face="arial, helvetica, sans-serif" size="2">Email: <a href="mailto:simon.eves@omnisci.com" target="_blank">simon.eves@omnisci.com</a> | Cell: </font></span></td><td align="left" style="padding:0px;vertical-align:top"><span style="white-space:nowrap;color:rgb(0,0,1)"><font face="arial, helvetica, sans-serif" size="2">415.902.1996</font></span></td></tr></tbody></table><br></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><br></div></div></div></div></div></div></div></div></div></div></font></span></div><div></div></div></div><div></div></div></div></div></div></div></div></div></div>