[Mapserver-users] Virtual Spatial Data from SQL Server

IMD Listuser imd_listuser at comcast.net
Thu Jun 3 17:14:58 EDT 2004


Greetings all,

I would like to plot point data that is stored in a single table in my
sql server db. According to
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?VirtualSpatialData, I have
configured what I believe that I need:

My mapserver is:
<!-- MapServer version 4.0.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=FREETYPE
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL
INPUT=SHAPEFILE -->

My VesselServer.ovf file contains:
<OGRVRTDataSource>
    <OGRVRTLayer name="VesselPosition">
 
<SrcDataSource>ODBC:VSClient/VSClient at VesselTracking</SrcDataSource> 
	<SrcSQL>SELECT * FROM Log WHERE ID = 496600</SrcSQL>
	<GeometryType>wkbPoint</GeometryType> 
        <LayerSRS>WGS84</LayerSRS>
	<GeometryField encoding="PointFromColumns" x="longitude_dd"
y="latitude_dd"/> 
    </OGRVRTLayer>
</OGRVRTDataSource>

My Map file contains a layer as follows:

  LAYER
    NAME "Vessel"
    TYPE POINT
    CONNECTIONTYPE OGR
    CONNECTION "C:\Inetpub\wwwroot\VesselServer\VesselServer.ovf" 
    DATA "VesselPosition"
    STATUS ON
    LABELITEM log.timestamp_local 
    CLASS
      COLOR 255 255 0
      OUTLINECOLOR 0 0 0
      SYMBOL 'circle'
      SIZE 12
      LABEL
	SIZE MEDIUM
	TYPE BITMAP
	COLOR 0 0 0
      END
    END
  END
 
Im able to confirm that the OGR driver works by using ogrinfo as
follows:
C:\Inetpub\wwwroot\VESSEL~1>ogrinfo VesselServer.ovf VesselPosition
ERROR 4: Update access not supported for VRT datasources.
Had to open data source read-only.
INFO: Open of `VesselServer.ovf'
using driver `VRT' successful.

Layer name: VesselPosition
Geometry: Point
Feature Count: 1
ERROR 1: SetAttributeFilter() not supported on ExecuteSQL() results.
Extent: (24.973143, 74.614543) - (24.973143, 74.614543)
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG","4326"]]
id: Integer (10.0)
timestamp_local: String (23.0)
vessel_id: String (36.0)
coordinate_utc: String (23.0)
latitude_dd: Real (0.0)
longitude_dd: Real (0.0)
heading_degrees: Real (0.0)
speed_knots: Real (0.0)
ERROR 1: SetAttributeFilter() not supported on ExecuteSQL() results.
OGRFeature(VesselPosition):0
  id (Integer) = 496600
  timestamp_local (String) = 2004-06-03 16:52:53.907
  vessel_id (String) = 1DD0D82A-ADC1-4237-BF28-2DCC0CBC9D52
  coordinate_utc (String) = 2004-06-03 20:52:53.907
  latitude_dd (Real) = 74.61454299820765
  longitude_dd (Real) = 24.97314251396685
  heading_degrees (Real) = 3
  speed_knots (Real) = 63
  POINT (24.97314251 74.61454300 0.000)

But, I am unable to see the results in a map :(

Any suggestions, anyone?

TIA

Charlie





More information about the mapserver-users mailing list