Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am confused by the output I'm getting from ogr2ogr when converting a shapefile to WKT. What I'm expecting to see is something in the form below (from Wikipedia):

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

What I'm getting out of ogr2ogr -f CSV out.wkt source.shp -lco GEOMETRY=AS_WKT, in very abbreviated form, is this:

"MULTIPOLYGON (((-120.6 50.8, ...)", 33.9, 137.1, 2, 1,1,1

I do not understand how to interpret the final six numbers, which are not enclosed in brackets and fall outside the quotation marks. Can someone explain this or point me towards the appropriate documentation?

share|improve this question
You should have the ogr2ogr command included which produced that output. That's way how people how haven't seen your previous post understands what you have done. –  LauriK Mar 20 '13 at 17:22
add comment

1 Answer

up vote 5 down vote accepted

Ogr2ogr translates vector data sources between different formats. Shape file is one kind of data source format but WKT is not. WKT is just a way to represent geometries in a human understandable way. Data source consists of features/objects that consists of a geometry and attributes.

The ogr2ogr command you specified in your previous question translates that shape file which have some attributes to a csv file. In that csv file you have geometries as a WKT and attributes of features as a comma separeted values.

share|improve this answer
In all fairness, LauriK, although you do mention in your previous answer that shapefiles contain attribute information, your subsequent words ("converts now the geometry") suggest that the conversion process only converts the geometric information. Editing your answer there might help avoid such confusion in the future. –  whuber Mar 20 '13 at 17:37
You are right @whuber. That was unclear from me. It's now corrected. –  LauriK Mar 20 '13 at 17:45
Of course, I'm embarassed that I didn't realize that! –  pyrogerg Mar 20 '13 at 20:55
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.