[mapserver-users] ogr connection failed

Jeff McKenna jmckenna at gatewaygeomatics.com
Mon Aug 2 06:04:13 PDT 2010


Hello,

My comments are inline below:

Murat Beyhan wrote:
> Hi All,
> 
> I have installed rpm package of Mapserver 5.6.3
> adn I have installed gdal 1.7.2 by using tar.gz file 
> 
> when I attempt to open map file from webpage I faced the following error
> message
> msDrawMap(): Image handling error. Failed to draw layer named 'Dhuman'.
> msOGRFileOpen(): OGR error. Open failed for OGR connection in layer
> `Dhuman'. Failed to open datasource
> `MYSQL:turkey,user=root,password=mysqlpass,host=localhost,port=3306,tables=d_damage m_village'. 
> 
> but when I use terminal for ogrinfo I can connect to database
> successfully
> 
> What is wrong could you help me please
> 
> 
> [murat at sakura cgi-bin]$ ogrinfo
> "MYSQL:turkey,user=root,password=mysqlpass,host=localhost,port=3306,tables=d_pgadata"
> INFO: Open of
> `MYSQL:turkey,user=root,password=mysqlpass,host=localhost,port=3306,tables=d_pgadata'
>       using driver `MySQL' successful.
> 1: d_pgadata (None)
> [murat at sakura cgi-bin]$ 

OGR returns "d_pgadata (None)" which means OGR does not find any 
geometry associated with that "d_pgadata" layer.  What does ogrinfo 
return for the "d_damage m_village" table?

The following document explains how to display MySQL layers (with and 
without geometry fields): http://www.mapserver.org/input/vector/mysql.html

> 
> 
> 
> or 
> 
> 
> 
> [murat at sakura cgi-bin]$ ogrinfo
> "MySQL:testogr,user=root,password=mysqlpass" 
> INFO: Open of `MySQL:testogr,user=root,password=mysql_123'
>       using driver `MySQL' successful.
> 1: deniz (Polygon)
> 2: il_merkezleri (Point)
> 3: il_sinirlari (Polygon)
> 4: ilce_merkezleri (Point)
> 5: ilce_sinirlari (Polygon)
> 6: iller (Polygon)
> 7: iller_sil (Polygon)
> 8: komsular (Polygon)

Again what about the "d_damage m_village" table?

> 
> 
> these works fine.
> 
> 
> ogr also support these formats
> [murat at sakura cgi-bin]$ ogrinfo --formats
> Supported Formats:
>   -> "ESRI Shapefile" (read/write)
>   -> "MapInfo File" (read/write)
>   -> "UK .NTF" (readonly)
>   -> "SDTS" (readonly)
>   -> "TIGER" (read/write)
>   -> "S57" (read/write)
>   -> "DGN" (read/write)
>   -> "VRT" (readonly)
>   -> "REC" (readonly)
>   -> "Memory" (read/write)
>   -> "BNA" (read/write)
>   -> "CSV" (read/write)
>   -> "GML" (read/write)
>   -> "GPX" (read/write)
>   -> "KML" (read/write)
>   -> "GeoJSON" (read/write)
>   -> "GMT" (read/write)
>   -> "SQLite" (read/write)
>   -> "ODBC" (read/write)
>   -> "PGeo" (readonly)
>   -> "OGDI" (readonly)
>   -> "MySQL" (read/write)
>   -> "PCIDSK" (readonly)
>   -> "XPlane" (readonly)
>   -> "AVCBin" (readonly)
>   -> "AVCE00" (readonly)
>   -> "DXF" (read/write)
>   -> "Geoconcept" (read/write)
>   -> "GeoRSS" (read/write)
>   -> "GPSTrackMaker" (read/write)
>   -> "VFK" (readonly)
> 

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/





More information about the MapServer-users mailing list