[gdal-dev] create kml file using MySQL database or shape file

Luca Sigfrido Percich sigfrido at tiscali.it
Tue May 3 11:33:36 EDT 2011

Hi Murat,

Il giorno mar, 03/05/2011 alle 16.57 +0300, Murat Beyhan ha scritto:
> ogr2ogr -f KML simgmt.kml simgmt.shp -dsco NameField=RegionName
> this can create a file but strangely data collected at one point.

Probably it is a Spatial Reference System related problem: you should
specify the source shapefile SRS. Have a look at the KML file and see if
the points have different coordinates, and see what SRS has been
declared for it. Have a look at the -a_srs, -t_srs and -s_srs options of

> ogr2ogr -f KML sisint.kml MySQL :'host=localhost user=root
> password=mysql_pswd port=3306 dbname=afetler tables=sisint' -sql "SELECT
> latitude,longitude,sisint from sisint"

Try with no space between MySQL and :, and specifying the database name
before any other option:

ogr2ogr -f KML sisint.kml
MySQL:'afetler,host=localhost,user=root,password=mysql_pswd,port=3306,tables=sisint' -sql "SELECT latitude,longitude,sisint from sisint"

All the best


More information about the gdal-dev mailing list