I'm trying to convert a shapefile into the simple Well-Known-Text (WKT) format in the example below (from http://en.wikipedia.org/wiki/Well-known_text).
MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), ((20 35, 45 20, 30 5, 10 10, 10 30, 20 35), (30 20, 20 25, 20 15, 30 20)))
I know that I use QGIS to save the shapefile as a CSV, and I can use ogr2ogr to do any number of conversions. In fact:
ogr2ogr -f CSV out.wkt source.shp -lco GEOMETRY=AS_WKT
gets me as close as I've come so far, but not quite there. Any suggestions?
As noted by @Mapperz, this thread is very similar to this one. That thread, while it provided the ogr2ogr approach that I noted above, did not solve this particular challenge. The ogr2ogr output I'm getting looks like this (I've truncated the lines). Apparently, I just haven't figured out how to get ogr2ogr to use MultiPolygon.
WKT,AREA,PERIMETER,PINUPOND_,PINUPOND_I,CODE "POLYGON ((-120.630531650950061 50.838562484449184, . . . "POLYGON ((-123.206067372148397 51.038984074378327, . . .