[mapserver-users] OGR problem connecting to mdb using ovf

Dejan.Gambin at pula.hr Dejan.Gambin at pula.hr
Tue Jan 27 10:23:16 EST 2009


Hi,

I need to connect to Access database that has (among the other columns) 
spatial data in two columns named "x coord" and "y coord". I am trying to 
implement Virtual Spatial Data according to 
http://www.mapserver.org/input/vector/VirtualSpatialData.html. 

I have made ovf file like this:

<OGRVRTDataSource>
        <OGRVRTLayer name="krk">
        <SrcDataSource>ODBC:@Krk</SrcDataSource>
        <SrcLayer>baza</SrcLayer>
        <GeometryType>wkbPoint</GeometryType>
        <GeometryField encoding="PointFromColumns" x="x koord" y="y 
koord"/>
        </OGRVRTLayer>
</OGRVRTDataSource>

and map file layer like this (using p.mapper):

LAYER # kc
  CONNECTION "krk.ovf"
  CONNECTIONTYPE OGR
  NAME  "krk"
  DATA  "krk"
  STATUS       ON
  TYPE         POINT
  METADATA 
    "DESCRIPTION" "KC"
    "LAYER_ENCODING" "WINDOWS-1250"
  END  # Metadata 
  CLASS
    Name 'Kc broj'
    COLOR 0 0 0
    SYMBOL 'circle'
    SIZE 10
    TEMPLATE void
  END  # Class
END

I have also made use and system dsn connection named "krk".

Testing with ogrinfo works fine, for example:

C:\Projekti\GIS\WebGIS\podaci\krk>ogrinfo krk.ovf krk|more
ERROR 4: Update access not supported for VRT datasources.
Had to open data source read-only.
INFO: Open of `krk.ovf'
      using driver `VRT' successful.

Layer name: krk
Geometry: Point
Feature Count: 2
Extent: (5000450.000000, 4997536.000000) - (5196390.000000, 
5000300.000000)
Layer SRS WKT:
...
...

But trying to run on web I am getting internal server error: CGI/FastCGI 
has encountered a problem and needs to close...". Also, my php error log 
file says:

[27-Jan-2009 16:21:45] PHP Warning:  [MapServer Error]: msOGRFileOpen(): 
Open failed for OGR connection 
`C:/Projekti/GIS/WebGIS/podaci/krk/krk.ovf'.
Unable to initialize ODBC connection to DSN for @Krk,
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

 in C:\ms4w\apps\pmapper\pmapper-3.2.0\incphp\initgroups.php on line 239
[27-Jan-2009 16:21:45] PHP Stack trace:
[27-Jan-2009 16:21:45] PHP   1. {main}() 
C:\ms4w\apps\pmapper\pmapper-3.2.0\map.phtml:0
[27-Jan-2009 16:21:45] PHP   2. include_once() 
C:\ms4w\apps\pmapper\pmapper-3.2.0\map.phtml:51
[27-Jan-2009 16:21:45] PHP   3. Init_map->initAllParameters() 
C:\ms4w\apps\pmapper\pmapper-3.2.0\incphp\init\init.php:34
[27-Jan-2009 16:21:45] PHP   4. Init_map->_initGroups() 
C:\ms4w\apps\pmapper\pmapper-3.2.0\incphp\init\initmap.php:60
[27-Jan-2009 16:21:45] PHP   5. Init_groups->Init_groups() 
C:\ms4w\apps\pmapper\pmapper-3.2.0\incphp\init\initmap.php:292
[27-Jan-2009 16:21:45] PHP   6. Init_groups->_createGroups() 
C:\ms4w\apps\pmapper\pmapper-3.2.0\incphp\initgroups.php:48
[27-Jan-2009 16:21:45] PHP   7. Init_groups->_initResultFields() 
C:\ms4w\apps\pmapper\pmapper-3.2.0\incphp\initgroups.php:117
[27-Jan-2009 16:21:45] PHP   8. ms_layer_obj->open() 
C:\ms4w\apps\pmapper\pmapper-3.2.0\incphp\initgroups.php:239

Any help would be greatly appreciated

Thanks very much

regards, dejan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090127/671ecff0/attachment-0001.html


More information about the mapserver-users mailing list