[Gdal-dev] line to polygon with ogr2ogr?

Frank Warmerdam warmerdam at pobox.com
Tue Mar 25 11:42:18 EST 2003


Vincent Schut wrote:
> Just to be really sure I thought I'd ask...:
> 
> Is it possible to convert a line (multiline) shapefile to a polygon shapefile 
> using ogr2ogr?
> I have a shapefile (I did not create myself, of course...) which was for some 
> (none) reason saved as line, but should be polygon. All lines are closed as 
> far as I could see, but the type is just wrong and I can't add it to my main 
> polygon table for this theme in postgis. Can I change this with ogr2ogr, or 
> do I need some other trick?

Vincent,

This can't be fixed with ogr2ogr.  It could, in theory, be fixed with a
python script as long as the dataset isn't too extraordinarily large, or
it could be fixed in a C/C++ program.

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