php-mapscript w/ ogr ovt tables
Stephan Holl
stephan.holl at INTEVATION.DE
Thu Nov 16 23:25:50 PST 2006
Dear Mapserver gurus,
I am encountering a problem when using a ogrs vrt tables against a mysql DB.
The problem comes up when I try to access a table column which was create
through an alias. e.g:
select n2n_wert, n2n_idflm, n2n_wertdat, n2n_idflaeche, frmt_wert,
replace(replace(replace(format(n2n_wert,3),'.',';'),',','.'),';',',') as
format_wert from n2n_flmflaeche;
format_wert cannot be used as TEXT in my mapfile using settext() in
php-mapscript.
The error is as following:
Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named
'statistic'. in /var/www/web1/html/gis/config/test.php on line 6
Warning: [MapServer Error]: msOGRFileOpen(): Open failed for OGR connection
` /var/www/web1/html/gis/config/statistic.ovf select n2n_wert, n2n_idflm,
n2n_wertdat, frmt_wert, format_wert from bld join
'/var/www/web1/html/gis/tmp/4ad12f9b5095f134e17c06691f429037.ovf'.values on
AGS = n2n_idflaeche where AGS like '%' wkbPolygon GEOMETRY '. SQL statement
failed, or returned no layer result: select n2n_wert, n2n_idflm, n2n_wertdat,
frmt_wert, format_wert from bld join
'/var/www/web1/html/gis/tmp/4ad12f9b5095f134e17c06691f429037.ovf'.values on
AGS = n2n_idflaeche where AGS like '%'
in /var/www/web1/html/gis/config/test.php on line 6
The Layer-snippet from my mapfile:
LAYER
CONNECTION "<OGRVRTDataSource>
<OGRVRTLayer name='join'>
<SrcDataSource>/var/www/web1/html/gis/config/statistic.ovf</SrcDataSource>
<SrcSQL>select n2n_wert, n2n_idflm, n2n_wertdat, frmt_wert, format_wert
from bld join
'/var/www/web1/html/gis/tmp/4ad12f9b5095f134e17c06691f429037.ovf'.values
on AGS = n2n_idflaeche
where AGS like '%'
</SrcSQL>
<GeometryType>wkbPolygon</GeometryType>
<GeometryField>GEOMETRY</GeometryField>
</OGRVRTLayer>
</OGRVRTDataSource>"
CONNECTIONTYPE OGR
DATA "join"
If I hardcode it in my mapfile and use the mapserv-CGI, everything works as
expected.
Does anybody has any similar experiences?
TIA and best regards
Stephan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20061117/9ba90b01/attachment.sig>
More information about the MapServer-users
mailing list