Strange OGR VRT Issue

Pascoe,Tim [Burlington] Tim.Pascoe at EC.GC.CA
Thu Oct 12 14:08:52 EDT 2006


Frank,

	Sorry, yes I meant shp2img, which produced a proper png image of the layer. When you say Layer, do you mean the table name from the database? I replaced the view name, either way, as in the 'old' version, with the same result. I'm going to get a very recent build later today, and see if that has any impact on the behavior.

Timothy Pascoe
Environmental Systems Scientist

Environment Canada / Environnement Canada
Canada Centre for Inland Waters / Centre Canadien des Eaux Intérieures
867 Lakeshore Road / 867, chemin Lakeshore
Burlington, Ontario / Burlington (Ontario)
L7R 4A6

Tel/Tél: (905) 336-6239
Fax/Téléc: (905) 336-4699
E-mail/C. élec: tim.pascoe at ec.gc.ca
Government of Canada/Gouvernement du Canada
This e-mail represents the opinions and views solely held by its author and in no manner may be considered as representing those of his/her employer.


-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: October 12, 2006 1:53 PM
To: Pascoe,Tim [Burlington]
Cc: UMN MapServer Users List
Subject: Re: [UMN_MAPSERVER-USERS] Strange OGR VRT Issue

Pascoe,Tim [Burlington] wrote:
> I'm experimenting with placing my OVF file in line, in order to pass in 
> some variables for a custom WHERE Statement. The first step I took was 
> changing my OVF file to use the scrSQL tag with a very simple SQL 
> statement, instead of the srcLayer tag. Both OVF files point to the same 
> view, in the same database.
> 
> New File:
> <OGRVRTDataSource>
>     <OGRVRTLayer name="CABINPoints">
>         <SrcDataSource>ODBC:****/****@CABIN</SrcDataSource>
>         <SrcSQL>SELECT * FROM OGRPoints</SrcSQL>
>           <FID>sitedetailsid</FID>
>         <GeometryType>wkbPoint</GeometryType>
>         <LayerSRS>WGS84</LayerSRS>
>     <GeometryField encoding="PointFromColumns" x="longitude" y="latitude"/>
>     </OGRVRTLayer>
> </OGRVRTDataSource>
> 
> Old FIle:
> <OGRVRTDataSource>
>     <OGRVRTLayer name="CABINPoints">
>         <SrcDataSource>ODBC:****/****@CABIN,OGRPoints</SrcDataSource>
>         <SrcLayer>OGRPoints</SrcLayer>
>           <FID>sitedetailsid</FID>
>         <GeometryType>wkbPoint</GeometryType>
>         <LayerSRS>WGS84</LayerSRS>
>     <GeometryField encoding="PointFromColumns" x="longitude" y="latitude"/>
>     </OGRVRTLayer>
> </OGRVRTDataSource>
> 
> The problem is, the old OVF returns a proper image, while the new one 
> returns a blank image. I ran the new file through OGRInfo and shp2ogr, 
> and both behave properly.
> 
> So........why am I getting a blank image with the scrSQL tag? I'm using the 
> latest version of the MS4W file set, but running on IIS on Windows 2000. 
> Any suggestions would be great - it's probably somthing very simple I'm 
> missing :)

Tim,

I see no obvious reason it wouldn't work.  Do you mean shp2img when
you say shp2ogr?  If it works with shp2img at the commandline, but not
with mapserv then I would suspect some sort of subtle permissions
problem but it seems hard to understand why.

You might want to include the layer name in the SrcDataSource in the
"new" case otherwise OGR will try to collect info on all the tables
which may be slow, and perhaps is even contributing to the problem.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the mapserver-users mailing list