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.

How do I create a single shapefile (with associated dbf and shx files) to contain this data using ogr2ogr?


2 Answers 2


Try with ogr2ogr using something like:

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

Here it worked with:

ogr2ogr -f "ESRI Shapefile"  C:/......./pms/pms.shp MySQL:dbgeom,host=webgis.bla.intern,user=bla,password=bla tablename -lco engine=MYISAM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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