SQL WHERE in OGR VRT

Frank Warmerdam fwarmerdam at GMAIL.COM
Wed Apr 27 17:33:21 EDT 2005


On 4/27/05, Fawcett, David <David.Fawcett at state.mn.us> wrote:
>  
> As an update, this is the OVF file that I was using: 
>   
> <OGRVRTDataSource>
>      <OGRVRTLayer name="facilities">
>       <SrcDataSource>ODBC:myname/mypass at mydsn</SrcDataSource>
>       <SrcSQL>SELECT FClass, UTMX, UTMY, NameShort FROM tlkpDestFac WHERE
> FClass = 1</SrcSQL>
>       <LayerSRS>epsg:32615</LayerSRS> 
>       <GeometryType>wkbPoint</GeometryType>
>       <GeometryField encoding="pointFromColumns" x="UTMX" y="UTMY"/>
>      </OGRVRTLayer>
> </OGRVRTDataSource> 
>   
> After removing the line 
>   
> <LayerSRS>epsg:32615</LayerSRS> 

David,

If this fails, it generally means that the GDAL/OGR code was unable
to find the supporting EPSG data files such as pcs.csv and gcs.csv.
These are distributed in gdal/data (in source dists.) and you can 
point to them with the GDAL_DATA environment variable. 

> It works.  Fortunately, for this application, I don't need to project the
> data.  

Right.  Also, in a mapserver context the OGR coordinate system is
ignored, and you need to specify things in the .map file in a projection
block.  So OGR's concept of the coordinate system is normally only
important if you are using external ogr utilities or other OGR applications.

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    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list