[Gdal-dev] convert a group of points (lat, lon) to a shape file

Frank Warmerdam fwarmerdam at gmail.com
Thu Jun 23 12:25:10 EDT 2005


On 6/23/05, Xiaodong Zhang <zhang at aero.und.edu> wrote:
> Hi Frank,
> 
> Thanks for the help. I'm almost there, but still have one problem. I can create
> a shapefile for points but get an error for polygon.

Xiaodong,

Doh!  I'm afraid I didn't read your original message carefully enough. 
I think you would have been better off with Perry's idea.   You could
still accomplish this using the csv driver and the .vrt file but you will
need to restructure your text file to use WKT format for the polygon.

eg. 

In VRT:
        <GeometryField encoding="WKT" field="wkt"/>

And your .csv file:
id, wkt
1, "POLYGON((-100 40, -90 40, -90 39, -100 39, -100 40))"

Sorry for misleading you before. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list