1

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.

  • So I have the boundarys of many 'zones' along with the attributes for those zones, I just want to put it all together in a nice tidy shape file :) – JSz Nov 4 '13 at 13:58
3

Try with ogr2ogr using something like:

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

If you can read the mySQL file in QGIS, then just right-click and save as a shapefile

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

-2

Take look at this example: http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html

It's easy to go from CSV to MySQL in Java.

  • all the data is currently in mySQL so its just a matter of taking my data ( an array of lat lons ) then add a few attributes to this arrany... and then finally mosaic it all together – JSz Nov 4 '13 at 13:59
  • This appears to be addressing a question other than the MySQL to shapefile conversion that is being asked about. Also, your last paragraph links to a deleted question and so I have deleted that paragraph. – PolyGeo Sep 10 '14 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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