Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question is related to Shapefiles to Text. I have a csv file, with one column, where all the rows correspond to WKT POLYGON()'s:


I'm familiar with how to convert from shp file to wkt, but I need to go the other way around. I tried playing around with ogr2ogr's settings/flags, but didn't really get anything useful. I also know I can use QGIS to do this, but it freezes/crashes since the dataset is fairly large. I'd appreciate any suggestions/advice.

share|improve this question
up vote 3 down vote accepted plus should have everything you need to describe the layout of your data and import it. In short, you need to create a OGR VRT file that describes things using details from the CSV driver page.

share|improve this answer

I had to solve the same problem today, so here is my answer, which gives a complete solution:

I have a lineWKT.csv file stored in F:\Data\ folder, with the data like this:

0,"LINESTRING (30 10 0, 10 30 0, 40 40 5)"

I have a vrt file like this:

    <OGRVRTLayer name="lineWKT">
 <GeometryField encoding="WKT" field='gm' > </GeometryField >

With this configuration, I can create a shapefile with the following command:

ogr2ogr line.shp test.vrt

share|improve this answer

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.