[mapserver-users] RE:mapserver + MS SQL

Ivan Mincik ivan.mincik at gmail.com
Wed Sep 24 09:09:53 PDT 2008


I have started testing OGR ODBC connection from linux to MS SQL on win.
There is polygon layer at MS SQL.

*** I have configured ovf file:

<OGRVRTDataSource>
    <OGRVRTLayer name="ku2">
        <SrcDataSource>ODBC:test/test at win</SrcDataSource> 
    <GeometryType>wkbPolygon</GeometryType> 
        <LayerSRS></LayerSRS>
    <GeometryField encoding="wkb" field="geom"/>
    <SrcSQL>select geom from ku2</SrcSQL>
    </OGRVRTLayer>
</OGRVRTDataSource>

*** With ogrinfo -ro -al test.ovf I get:

OGRFeature(ku2):1599
  geom (Binary) = 000000000104BA0000003EB1148070BF20C15D1DF97FB5C832C11B1727C08FBF20C16F23...
  POINT (0.0 -0.0)

OGRFeature(ku2):1600
  geom (Binary) = 000000000104C8010000C23023A08D2C19C1BC001400308E32C1C84A35A0372C19C1CF70...
  POINT (0.0 -0.0)

OGRFeature(ku2):1601
  geom (Binary) = 0000000001047905000038864D009A7818C19A41F1FF68B732C19092B3BF6C7818C10808...
  POINT (0.0 0.0)


*** In the mapfile :

LAYER 	
    NAME 'ku2'
  	DEBUG 5
    	TYPE LINE
	CONNECTIONTYPE OGR
	CONNECTION "test.ovf"
    	DATA "ku2"
        	STATUS ON
        	PROJECTION
                	"init=epsg:2065" 
        	END
        	METADATA
                	"DESCRIPTION"   "test"
                 	'wms_title' 'test'
                 	"wms_format"          "image/png"
        	END
        	CLASS
                	NAME "test"
                STYLE
                        OUTLINECOLOR  239 110 115
                        COLOR 204 204 204
                        WIDTH 8
                END
        END
END

*** shp2img -m test.map -o test.png will run without error, but output image is BLANK.  Any idea ?
I have tried this with 2 different layers, different coordinate systems.




>Hi list,
>At first, I would like to say that I am not a fan in replacing perfect PostGIS database to MS SQL, but I must to adapt to customer's needs.
>I would like to ask if somebody has experience with loading data to mapserver from MS SQL Spatial 2008.
>Now, in 5.2 there is possibility to use new PLUGIN for MS SQL, which is only for Windows ....
>Other possibility is to use ODBC connection through OGR which can be working also in Linux.
>
>So my questions are :
>1. Is there any other possibility ?
>2. What is Your experience with performance when using ODBC connection through OGR ? 
>3. What is Your experience with performance when using new PLUGIN for MS SQL in 5.2 ?
>
>Thanks a lot 
>-- 

>Ivan 




More information about the MapServer-users mailing list