MapTools.org

[maplab-users] ODBC connection via OGR

Zak James zak-ms@hoppsan.org
Fri, 19 Mar 2004 12:25:53 -0500
Joanne,

Is it possible that mapserver wasn't relinked against a version of gdal 
that includes the VRT support? What is the source of your mapserver and 
gdal binaries?

The other possibility is that there is a difference between the 
environment that ogrinfo is running in and the one available to the 
webserver (and mapserver). On unix platforms, this usually means 
different environment variables - I don't have experience getting this 
to work on Windows or with Access so I'm not sure if that's applicable.

zak

--
Zak James
Applications and Software Development
DM Solutions Group Inc.
http://www.dmsolutions.ca


On Mar 19, 2004, at 10:19 AM, joanne cook wrote:

> Hi All,
>
> I am a bit of a newbie to maplab and mapserver, and while I've seen 
> this question partially answered I can't seem to get my setup to work!
>
> Basically I am trying to connect to a microsoft access database to get 
> points from a set of x,y coordinates via ogr as described in 
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?VirtualSpatialData. I 
> have tested my ovf file with ogrinfo and it works fine, and I can 
> display the points in openev. When I try and display my map in 
> mapserver everything apart from the virtual layer displays and I get 
> no error messages. When I try and display it in mapbrowser the map 
> doesn't display at all. When I try and preview the map in mapeditor I 
> get the following error messages:
>
> Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named 
> 'OAN Sites'. in 
> c:\inetpub\wwwroot\maplab-2.1-RC3\htdocs\mapedit\preview.php on line 
> 469
>
> Warning: [MapServer Error]: msOGRFileOpen(): Open failed for OGR 
> connection `virtual.ovf'. File not found or unsupported format. in 
> c:\inetpub\wwwroot\maplab-2.1-RC3\htdocs\mapedit\preview.php on line 
> 469
>
> Fatal error: Call to a member function on a non-object in 
> c:\inetpub\wwwroot\maplab-2.1-RC3\htdocs\mapedit\preview.php on line 
> 474
> Now, I'm sure this is something to do with the connection parameters 
> etc so I've tried many different options but get the same answer each 
> time, so here are the relevant sections of my map file:
> MAP
>   NAME "test"
>   STATUS ON
>   EXTENT 338779.212856774 555322.261461872 341264.94672821 
> 557186.754081183
>   SIZE 800 600
>   SHAPEPATH "C:/Inetpub/wwwroot/jo/carlisle/shapefiles/"
>   LAYER
>     NAME "OAN Sites"
>     STATUS ON
>     DATA "nmr data"
>     TYPE POINT
>     CONNECTIONTYPE OGR
>     CONNECTION "virtual.ovf"
>     UNITS METERS
>     SIZEUNITS PIXELS
>     LABELITEM "nmrdata.Project_Sitecode"
>     TOLERANCE 0
>     TOLERANCEUNITS PIXELS
>     PROJECTION
>       "init=epsg:4326"
>     END
>     CLASS
>       LABEL
>         TYPE BITMAP
>         SIZE MEDIUM
>         POSITION CC
>         OFFSET 0 0
>         BUFFER 0
>         MINDISTANCE -1
>         MINFEATURESIZE -1
>         COLOR 0 0 0
>         PARTIALS TRUE
>         FORCE FALSE
>       END
>     END
>
> My ovf file is in the shapefiles folder, and looks like this:
> <OGRVRTDataSource>
>     <OGRVRTLayer name="nmr data">
>         <SrcDataSource>ODBC:user/pass@SitesDatabase</SrcDataSource>
>  	<SrcLayer>nmrdata</SrcLayer>
> 	<FID>nmrdata.Project_SiteCode</FID>
> 	<GeometryType>wkbPoint</GeometryType>
>         <LayerSRS>WGS84</LayerSRS>
> 	<GeometryField encoding="PointFromColumns" x="Easting" y="Northing"/>
>     </OGRVRTLayer>
> </OGRVRTDataSource>
> I hope someone can help!
> Thanks to everyone for all the great advice that I've already got from 
> these forums!
> Jo
>
>
> _______________________________________________
> Maplab-users mailing list
> Maplab-users@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/maplab-users
>



This archive was generated by Pipermail.