MapTools.org

[maplab-users] ODBC connection via OGR

Zak James zak-ms@hoppsan.org
Fri, 26 Mar 2004 13:42:20 -0500
Unfortunately, most changes to GDAL necessitate replacing mapserver as 
well as the gdal dll. I think it is likely that you have a mismatch 
there if ogrinfo can make the connection but mapserver can't.

I have discussed this with one of our windows developers and he will 
post a set of windows binaries with tested support for the virtual 
driver in the near future. I will let you know when they are available 
so you can see if this solves your problem.

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


On Mar 25, 2004, at 7:47 AM, joanne cook wrote:

> Hi Jeff,
>
> Thanks for your advice. I have tried this, and get the same error 
> unfortunately!
>
> Jo
>
> -----Original Message-----
> From: Jeff McKenna [mailto:jmckenna@dmsolutions.ca]
> Sent: 24 March 2004 22:26
> To: joanne cook
> Cc: maplab-users@lists.maptools.org
> Subject: Re: [maplab-users] ODBC connection via OGR[Scanned for viruses
> by OA]
>
>
> Hi Joanne,
>
> Is it possible that the error "Open failed for OGR connection
> `virtual.ovf'. File not found or unsupported format" means that the ovf
> file is in the wrong location?  Try placing the ovf file in the same
> folder as the mapfile and specifying "CONNECTION "virtual.ovf" in the
> mapfile.
>
>
> jeff
>
>
>
>
> joanne cook wrote:
>> Zak, and list,
>>
>> I'm using the latest version of mapserver and mapscript from:
>> http://www.maptools.org/dl/mapserver-4.1-dev-win32-php4.3.4.zip
>>
>> That says it was compiled with support for gdal and ogr, so I moved 
>> the relevant dlls over to the correct directory, which I assume is 
>> all I needed to do... Previously I was using the earlier stable 
>> version. That version seemed to conflict with the version of openev 
>> that I was using as the two programs seemed to want different 
>> versions of the same dll file (gdal11). I don't have the knowledge or 
>> the tools to get into compiling software from source, so in order to 
>> start afresh with the latest version of mapserver and mapscript I 
>> simply deleted all of the old software and dlls, rebooted and started 
>> again. That seems to have resolved some of the problems (openev and 
>> mapserver now seem to coexist quite happily) but I'm still having the 
>> same problem with my ovf file. I have tested my ogr connection from 
>> mapserver by making an ogr connection to a shapefile, and that seemed 
>> to work just fine, so it's just the virtual data  that I'm having 
>> problems with. I'd ask my question over o
> n !
>> the mapservers list only I seem to be having a bit of trouble 
>> subscribing to that!
>>
>> Thanks
>>
>> Jo
>>
>> -----Original Message-----
>> From: Zak James [mailto:zak-ms@hoppsan.org]
>> Sent: 19 March 2004 17:26
>> To: joanne cook
>> Cc: maplab-users@lists.maptools.org
>> Subject: Re: [maplab-users] ODBC connection via OGR[Scanned for 
>> viruses
>> by OA]
>>
>>
>> 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
>>>
>>
>>
>>
>
>
> _______________________________________________
> Maplab-users mailing list
> Maplab-users@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/maplab-users
>



This archive was generated by Pipermail.