[Mapserver-users] Virtual Spatial Data from SQL Server
IMD Listuser
imd_listuser at comcast.net
Tue Jun 8 05:25:38 PDT 2004
I'm confused!
Ive followed the instructions in the wiki at
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?VirtualSpatialData
>From what I can tell, the .ovf file needs to contain an element
<OGRVRTLayer> which specifies the name of the Layer analogous to the
NAME element in a LAYER section in a .map file. Is this incorrect?
Also, the <SrcLayer> element is intended to specify the table in which
the x and y columns for the <GeometryField> element exist, no?
As an alternative to <SrcLayer>, my understanding is that <SrcSQL>
element can be used to pass a SQL statement to retrieve a subset of
columns or rows accordin to the SQL itself. Please correct me if I am
wrong.
So, I do not understand what you mean by:
"create a new database and put ur table there ur ODBC is pointing to the
wrong table by default"
My sense is that the ODBC does not actually point to the table, rather
the database
Thanks
Charlie
Charlie Van Dusen
charlie at im-design.net
-----Original Message-----
From: Jenu Abraham [mailto:jenu_ab at hotmail.com]
Sent: Monday, June 07, 2004 11:43 PM
To: IMD Listuser
Subject: RE: [Mapserver-users] Virtual Spatial Data from SQL Server
"ogrinfo VesselServer.ovf" command gave a line in the end
1: VPosition (Point)
what is that?
because in ur query u have given table name as "position"
VPosition is another table in ur database and ogrinfo is trying to
access that table...
---------------------------------------------
try this ovf file...
witht he command "ogrinfo VesselServer.ovf"
<OGRVRTDataSource>
<OGRVRTLayer name="VPosition">
<SrcDataSource>ODBC:userid/password at Vessels</SrcDataSource>
<SrcLayer>position</SrcLayer>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>WGS84</LayerSRS>
<GeometryField encoding="PointFromColumns" x="longitude_dd"
y="latitude_dd"/>
</OGRVRTLayer>
</OGRVRTDataSource>
-------------------------------------------------
and again if u see
C:\Inetpub\wwwroot\VESSEL~1>ogrinfo VesselServer.ovf 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.
1: VPosition (Point)
instead of
C:\Inetpub\wwwroot\VESSEL~1>ogrinfo VesselServer.ovf 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.
1: position (Point)
then ur trouble lies here..............
as i said earlier.....create a new database and put ur table there ur
ODBC is pointing to the wrong table by default
-------------------------------------
>From: "IMD Listuser" <imd_listuser at comcast.net>
>To: "Jenu Abraham" <jenu_ab at hotmail.com>
>Subject: RE: [Mapserver-users] Virtual Spatial Data from SQL Server
>Date: Mon, 7 Jun 2004 20:55:09 -0400
>
>
>Hi
>
>What is the proper GDAL DLL. The one I have is 1.1
>
>I have changed my setup and simplified. I have a table with 100 records
>each having id, latitude_dd, and longitude_dd (with test data)
>
>My .ovf file:
>
><OGRVRTDataSource>
> <OGRVRTLayer name="VPosition">
> <SrcDataSource>ODBC:userid/password at Vessels</SrcDataSource>
> <SrcSQL>select * from position where id = 10</SrcSQL>
> <GeometryType>wkbPoint</GeometryType>
> <LayerSRS>WGS84</LayerSRS>
> <GeometryField encoding="PointFromColumns" x="longitude_dd"
>y="latitude_dd"/>
> </OGRVRTLayer>
></OGRVRTDataSource>
>
>Tha map file layer:
>
> LAYER
> NAME "VPosition"
> TYPE POINT
> CONNECTIONTYPE OGR
> CONNECTION "C:\Inetpub\wwwroot\VesselServer\VesselServer.ovf"
> DATA "VPosition"
> STATUS ON
> 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
>
>
>Here are the results shown
>
>***********************************************************************
*
>******
>***********************************************************************
*
>******
>C:\Inetpub\wwwroot\VESSEL~1>ogrinfo VesselServer.ovf
>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.
>1: VPosition (Point)
>
>C:\Inetpub\wwwroot\VESSEL~1>ogrinfo VesselServer.ovf VPosition
>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: VPosition
>Geometry: Point
>Feature Count: 1
>ERROR 1: SetAttributeFilter() not supported on ExecuteSQL() results.
>Extent: (11.222492, 54.580212) - (11.222492, 54.580212)
>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)
>longitude_dd: Real (0.0)
>latitude_dd: Real (0.0)
>ERROR 1: SetAttributeFilter() not supported on ExecuteSQL() results.
>OGRFeature(VPosition):0
> id (Integer) = 10
> longitude_dd (Real) = 11.22249187974292
> latitude_dd (Real) = 54.58021225220185
> POINT (11.22249188 54.58021225 0.000)
>
>C:\Inetpub\wwwroot\VESSEL~1>
>***********************************************************************
*
>******
>***********************************************************************
*
>******
>
>This shows what I would expect from the sql supplied.
>
>Any other ideas?
>
>Charlie Van Dusen
>charlie at im-design.net
>
>-----Original Message-----
>From: Jenu Abraham [mailto:jenu_ab at hotmail.com]
>Sent: Monday, June 07, 2004 6:11 PM
>To: IMD Listuser
>Subject: RE: [Mapserver-users] Virtual Spatial Data from SQL Server
>
>
>i dont think its a problem with mapserver version,,..it looks fine to
>me, if u had installed the proper gdall DLL in ur winNT directory
>
>that "Error- 1" u see two times when running the command "ogrinfo
>VesselServer.ovf VesselPosition " is a problem... it shouldnt be
>there....
>i also faced that ....
>
>try to make if simple at first and move up...
>
>try the <SrcLayer>..</SrcLayer>
>-----------------------------
>when you give the command "ogrinfo VesselServer.ovf " what do you
>see...??????????
>do you see the name of the table you are going to query???? OR do you
>see some other table from the database...
>
>that might be the PROBLEM
>---------------------
>
>try this....
>
>made a new database....create a new table in there....make sure the
ODBC
>points to that database... and try running ogrinfo....
>
>if it runs without the Error 1 in it then u are fine....
>try then with the map...
>
>write back.. about the progress...
>
>Jenu
>
>_________________________________________________________________
>Getting married? Find great tips, tools and the latest trends at MSN
>Life Events. http://lifeevents.msn.com/category.aspx?cid=married
>
>
_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from
McAfee(r)
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
More information about the MapServer-users
mailing list