Hi Robert,
You're not easily discouraged by the steepnes I see ;-)
MS/SQL doesn't understand the spatial functions (ST_POINT, ST_POLYLINE
etc.), they always need to be interpreted by SpatialWare, i.e. by
sp_spatial_query by passing the complete command to it as a command string.
The functions are not MS/SQL objects, hence it makes no sense to address
them with owner prefix (e.g. dbo).
The spatial fields typically named "sw_geometry" contain a binary blob,
which SpatialWare (i.e. the collection of stored procedures) can create and
interprete as required. It's not a text field containing a command to create
gemeortry, e.g. 'ST_POINT(123,456)', although such a value can be used to
populate a command string to send to sp_spatial_query.
The stored procedure sp_spatial_query receives a command string which it
decodes, changes to something MS/SQL can understand and execute, and passed
this changed command string to MS/SQL. The problem with older versions of
SpatialWAre was that this pre-decoding was more limited wrt. what MS/SQL
could handle, limiting the usefulness of the spatial extension. It's
supposedly much better in later versions.
I admit it's not very clear how the work is divided between MS/SQL and
SpatialWare, but generally sp_spatial_query needs a complete command string.
Have you tried this alternative for the first query you give ?
exec sp_spatial_query 'Insert Into [dbo].[T_GPS_LOCS] (I_GPSLOCS_ID,
SW_GEOMETRY) Select I_GPSLOCS_ID, ST_Point(' + CAST(F_LONG as varchar(25))
+',' + CAST(F_LAT as varchar(25)) + ') From TMP_GPS_LOCS'
Best regards / Med venlig hilsen
Lars V. Nielsen
--------------------------------------------------------
GisPro
----- Original Message -----
From: "Robert Crossley" <[EMAIL PROTECTED]>
To: "MapInfo List" <[email protected]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, June 07, 2005 8:46 AM
Subject: MI-L More spatialware stuff
Hi all,
I am working with spatialware and on a steep learning curve. I am trying
to create polylines into a table based on data from another. One error is
that ST_Polyline is an invalid object, and it isn't in the functions list
as is ST_Point. Where is it or can't I use this function in the same way
that I use ST_POINT. Another is that my approach may be totally invalid
for very obvious reasons that I am unaware of.
I first create a list of vertices in VB, and format these into a
C_VERTEX_LIST field. I was rather hoping that I could then use a simple
insert query like the one that I am using for a point insert query (that
works):
Insert Into [dbo].[T_GPS_LOCS] (I_GPSLOCS_ID, SW_GEOMETRY)
Select I_GPSLOCS_ID, dbo.ST_Point(F_LONG,F_LAT) From TMP_GPS_LOCS
But this is different to inserting a polyline, as the field that I am
passing contains functions themselves (ST_PATH, ST_POINT)
What I would like to do:
Insert Into T_GPS_TRACKS (I_GPS_TRACKS_ID, sw_geometry)
Select I_GPS_Tracks_ID, dbo.ST_Polyline(C_VERTEX_LIST) from tmp_gps_tracks
gives an invalid object name dbo.ST_Polyline
A record in the field C_VERTEX_LIST currently looks like:
ST_PATH(LIST{ ST_Point( 149.0716,-21.30197), ST_Point( 149.0715,-21.3025)})
If I run:
Insert Into T_GPS_TRACKS (I_GPS_TRACKS_ID, sw_geometry)
exec sp_spatial_query 'Select I_GPS_Tracks_ID,
dbo.ST_Polyline(C_VERTEX_LIST) from tmp_gps_tracks'
gives no errors, but doesn't put any data into T_GPS_TRACKS either.
Howerver, just running the select part of it (exec sp_spatial_query
'Select I_GPS_Tracks_ID, dbo.ST_Polyline(C_VERTEX_LIST) from
tmp_gps_tracks) gives the following error:
SW-70901: Syntax error detected at line 77: syntax error at '('.
r
--
________________________________________________
Robert Crossley
Agtrix P/L
9 Short St
PO Box 63
New Brighton 2483
Far Southern Queensland
AUSTRALIA
153.549004 E 28.517344 S
P: 02 6680 1309
F: 02 6680 5214
M: 0419 718 642
E: [EMAIL PROTECTED]
W: www.agtrix.com
W: www.wotzhere.com
skype: robertcrossley
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16698
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16703