Using ODBC/OVF with MS SQL

mikiet mike.talbutt at DOTTEDEYES.COM
Tue Feb 6 10:58:33 EST 2007


Hi all, 

Can anyone point me in the correct direction. 

I had a MySQL database that I was plotting points on using ODBC/OVF and
everything worked fine. We have now migrated to an MS SQL database, I have
created a DSN and a new OVF. 

<OGRVRTDataSource>

    <OGRVRTLayer name="incidentdata">
        <SrcDataSource>ODBC:nyf/nyf at WMF</SrcDataSource> 
 	<SrcSQL>SELECT XCOORD, YCOORD, incident_no FROM
cleansed_incidents2508</SrcSQL>
	<GeometryType>wkbPoint</GeometryType> 
	<LayerSRS>epsg:27700</LayerSRS>
	<GeometryField encoding="PointFromColumns" x="XCOORD" y="YCOORD"/> 
    </OGRVRTLayer>

</OGRVRTDataSource>

When I run OGRINFO on my OVF I successfully connect to the database and get
my data back. However when I run 

shp2img -m uk.map -o test.png

The points are not plotted on my map, however no errors are thrown. The same
happens when I view my map through mapserv.exe over apache.

here are the details from the ogrinfo....

>ogrinfo incidents.ovf incidentdata
Layer name: incidentdata
Geometry: Point
Feature Count: 8100
Extent: (363118.000000, 415323.400000) - (513125.300000, 518908.200000)
Layer SRS WKT:
PROJCS["OSGB 1936 / British National Grid",
    GEOGCS["OSGB 1936",
        DATUM["OSGB_1936",
            SPHEROID["Airy 1830",6377563.396,299.3249646,
                AUTHORITY["EPSG","7001"]],
            AUTHORITY["EPSG","6277"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.01745329251994328,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4277"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",49],
    PARAMETER["central_meridian",-2],
    PARAMETER["scale_factor",0.9996012717],
    PARAMETER["false_easting",400000],
    PARAMETER["false_northing",-100000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","27700"]]
XCOORD: String (8000.0)
YCOORD: String (8000.0)
incident_no: String (8000.0)
OGRFeature(incidentdata):0
  XCOORD (String) = 429252.6
  YCOORD (String) = 454477.2
  incident_no (String) = 03-00002
  POINT (429252.59999999998 454477.20000000001 0)

etc.......


the layer in my map file is defined as follows....

 LAYER
     NAME "incidents"
     STATUS ON
     TYPE POINT
     CONNECTIONTYPE OGR  
     CONNECTION "C:/incidents.ovf"
     DATA "incidentdata"
     TEMPLATE "ffff"    
     PROJECTION
           "init=epsg:27700"
     END
     CLASS
     		SYMBOL "incident"
     		COLOR 0 0 0
     		OUTLINECOLOR 0 0 0
     END
 END  


Many Thanks

Mike.

-- 
View this message in context: http://www.nabble.com/Using-ODBC-OVF-with-MS-SQL-tf3181356.html#a8828463
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list