Hi all,

Thanks for the answers to the queries on spatialware so far, particularly lars and anand. I will post a summary of the strategy used and the tricks learned once I get a bit more understanding of what I have actually done.

I can join 2 tables with a spatial query as follows:
exec sp_spatial_query '
   select a.C_LINKCODE, b.I_GPSLOCS_ID
        from T_AMAL_HARV_OPS a, T_GPS_LOCS b where
                 ST_Contains(a.sw_geometry, b.sw_geometry)'

My latest problem is to try to update a column with the value from field from another table, but where the join is by a spatial relationship.

Logically, it should be something like:

Update T_GPS_LOCS , T_AMAL_HARV_OPS
SET T_GPS_LOCS.C_PAD_ID = T_AMAL_HARV_OPS.C_LINKCODE
Where dbo.ST_Contains(T_GPS_LOCS.SW_GEOMETRY, T_AMAL_HARV_OPS.SW_GEOMETRY)

but have been trying:

exec sp_spatial_query '
Update T_GPS_LOCS , T_AMAL_HARV_OPS
SET T_GPS_LOCS.C_PAD_ID = T_AMAL_HARV_OPS.C_LINKCODE
Where dbo.ST_Contains(T_AMAL_HARV_OPS.SW_GEOMETRY, T_GPS_LOCS.SW_GEOMETRY)'

OR

exec sp_sqlexec '
Update T_GPS_LOCS , T_AMAL_HARV_OPS
SET T_GPS_LOCS.C_PAD_ID = T_AMAL_HARV_OPS.C_LINKCODE
Where dbo.ST_Contains(T_AMAL_HARV_OPS.SW_GEOMETRY, T_GPS_LOCS.SW_GEOMETRY)'

OR

Update T_GPS_LOCS , T_AMAL_HARV_OPS
SET T_GPS_LOCS.C_PAD_ID = T_AMAL_HARV_OPS.C_LINKCODE
Where 'ST_Contains('+CAST(T_AMAL_HARV_OPS.SW_GEOMETRY AS varchar(25))+', '+CAST(T_GPS_LOCS.SW_GEOMETRY AS varchar(25))+ ')'

Any leads?

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: 16671

Reply via email to