I’ll follow up my own post regarding getting ODBC access to work in mapserver under Debian “sarge”, since I now have this working (and so others who might later search for a solution to this can be encouraged).

 

Straight recompilation proved to be an easy ticket to getting mapserver working with Debian+Sarge+ODBC (and I upgraded to mapserver 4.8.1 in the process, which may also have helped).  I was a bit intimidated about recompilation from having tried this once before when I was running on ‘woody’ (older Debian version), and then had to deal with backports and other such ugliness.  The present process is pretty painless since all the required support libraries are already built in suitable development versions as Debian packages.

 

So it really just boiled down to unpacking the mapserver source distribution into a suitable directory, doing “./configure”  a few times with suitable options turned on (and getting the missing packages as they were identified) and finally doing a “make”.  After everything compiled, I just copied the revised mapserver into my cgi-bin folder under a new name (so the old mapserv is still there just in case) and I’m now happily displaying X/Y map points from a MySQL data table (even using a rather more complicated query than shown originally).

 

I hope someone benefits from this someday…

---

Jeremy Raw

Transportation Systems Engineer / City of Durham / DCHC MPO

919-560-4366 ext. 308 / [EMAIL PROTECTED]

 


From: UMN MapServer Users List [mailto:[EMAIL PROTECTED] On Behalf Of Raw, Jeremy
Sent: Friday, February 03, 2006 4:02 PM
To: [email protected]
Subject: [UMN_MAPSERVER-USERS] OGR+ODBC with Debian Sarge Mapserver

 

Question:

 

Does OGR ODBC access to a database table containing X/Y data work in the standard Debian sarge Mapserver package (as opposed to having to compile it from the ground up myself)?

 

Details:

 

I’ve been happily running the Debian sarge standard package of Mapserver (version 4.4.1) for a number of months.  The data sources for this project have (until now) all been in shapefiles and inline features (passed in via CGI).  I’m now trying to enlarge the application to display point data from a MySQL database table containing X/Y data.  Following the terse but workable how-to on the Mapserver website, I’ve got ODBC up and running and verified it all the way through using ogrinfo (from the standard sarge gdal package) to access the data.  Unfortunately, my mapserver (and also shp2img) perform a segmentation fault every time they try to access the ODBC layer, with no indication of what’s wrong.

 

All I’d really like to know is if someone has gotten this to work (or equally, if someone knows for sure that the standard sarge package does not have suitable capabilities compiled in, or if it conflicts with something else etc.) before I set about building the whole mapserver setup from scratch.

 

Here’s the test.ovf file (OGR Connection definition), which as I noted works fine with ogrinfo (the file lives in my SHAPEPATH):

 

<OGRVRTDataSource>

    <OGRVRTLayer name='mypoints'>

    <SrcDataSource>ODBC:user/[EMAIL PROTECTED]</SrcDataSource>

    <SrcSQL>Select * from mypoints where (ptid&lt;100) </SrcSQL>

    <GeometryField encoding='PointFromColumns' x='xcoord' y='ycoord' />

    <GeometryType>wkbPoint</GeometryType>

    </OGRVRTLayer>

</OGRVRTDataSource>

 

Here’s the (very basic) layer definition from the mapfile – the “circle” symbol is defined and works in other layers.

 

LAYER

    NAME "mypoints"

    CONNECTIONTYPE OGR

    CONNECTION "test.ovf"

    DATA "mypoints"

    STATUS DEFAULT

    TYPE POINT

    CLASS

        STYLE

            COLOR 0 0 0

            SIZE 2

            SYMBOL "circle"

        END

    END

END

 

Any help or advice much appreciated.

Jeremy

---

Jeremy Raw

Transportation Systems Engineer / City of Durham / DCHC MPO

919-560-4366 ext. 308 / [EMAIL PROTECTED]

 

 

Reply via email to