[mapserver-users] OGR VRT and mysql - Unable to identify source...
aracandrade at uol.com.br
aracandrade at uol.com.br
Sat Nov 21 15:02:20 PST 2009
Hi,
Sorry about crossposting, I posted this in MapFish users list but I realised that here is the correct place. Sorry also my bad english.
I'm learning OGR VRT and mysql, but can't undestand why this error occurs:
my html:
..........................
var basemap = new OpenLayers.Layer.MapServer("Anhumas",
"http://localhost:8080/cgi-bin/mapserv.exe?",
{map: 'G:/UsbWebserver/Root/mydata/config/Tremembe/tremembe-mysql.map',
layers: ['lotes', 'reserva', 'labels'],
format: 'png',
transparent: 'off',
maxExtent: new OpenLayers.Bounds(-51.543783, -22.985484, -51.508519, -22.936574)
,mode: 'map'
}, {singleTile: true}
);
map.addLayer(basemap);
map.setCenter(new OpenLayers.LonLat(-51.52669, -22.95777), 13.45);
map.addControl(new OpenLayers.Control.MousePosition());
}
..........................
my map:
.........................................
LAYER
NAME "lotes"
CONNECTIONTYPE OGR
CONNECTION "G:/UsbWebserver/Root/mydata/config/Tremembe/lotes.ovf"
TYPE polygon
STATUS ON
DATA "lotes"
METADATA
......................................
my ovl:
<OGRVRTDataSource>
<OGRVRTLayer name="lotes">
<SrcDataSource>MYSQL:assentamento,user=root,tables=tremembe_lotes</SrcDataSource>
<SrcSQL>SELECT * FROM tremembe_lotes</SrcSQL>
<GeometryType>wkbUnknown</GeometryType>
<GeometryField encoding="WKT" field="lotcoords"/>
</OGRVRTLayer>
</OGRVRTDataSource>
my orginfo:
G:\UsbWebserver\tools\gdal-ogr>ogrinfo MySQL:assentamento,user=root tremembe_lotes -so
INFO: Open of `MySQL:assentamento,user=root'
using driver `MySQL' successful.
Layer name: tremembe_lotes
Geometry: Polygon
Feature Count: 102
Extent: (-51.543783, -22.985484) - (-51.508519, -22.936574)
Layer SRS WKT:
(unknown)
FID Column = OGR_FID
Geometry Column = lotcoords
id: Real (10.0)
num_lote: Real (10.0)
nome_ass: String (40.0)
The Firebug answer:
<HTML>
<HEAD><TITLE>MapServer Message</TITLE></HEAD>
<!-- MapServer version 5.4.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG
OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG
INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->
<BODY BGCOLOR="#FFFFFF">
msDrawMap(): Image handling error. Failed to draw layer named 'lotes'.
msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `lotes'.
Unable to identify source field 'lotcoords' for geometry.
</BODY></HTML>
Can anyone please point me where to search for this error? Thanks in advance,
aracandrade
More information about the MapServer-users
mailing list