[GIS] Create ESRI shapefile with attributes from theSQL

MySQLogr2ogrshapefile

I have some geometry which can be perceived as regions within a country and wish to create a shapefile which contains all the regions along with some attributes (e.g. name, population, area code, etc.)

I have the geometry from the regions in x,y WGS84 lat lon (not polygons so cannot be sure they are closed loops which is priority) currently stored in mySQL.

I wish to be able to create a single shp (with associated dbf and shx files) to contain this data.

Any pointers on command line tools and methods to do this would be gratefully received.

Best Answer

Try with ogr2ogr using something like:

ogr2ogr output.shp MYSQL:dbname,user=userid,password=password,host=host,port=3306 tablename