Thanks, Lars, Anand, and a SQL guru Neil (who is not on this list) for the
help.
You can create and manipulate data in an ado record set in vb and then add
that data to a table in spatialware, but there are some traps to avoid for
young players (like me - well inexperienced players anyway).
If you add data from the recordset to a spatialised table that has has
r-tree index built, it is mind-numbingly slow (probably better to type it
in).... We suspect that as each record is added from the recordset, the
triggers in spatialware are rebuilding the indices for each record rather
than once at the end.
You can do this process much quicker by using a different approach if your
data is points:
You first append the data from the recordset to a temp table of the same
structure as the target table which has has been spatialised, has lat long
columns, BUT NO r-tree INDEXES!!.
You can then generate the spatial data there by using a server side sql
like:
Update table set sw_geometry = dbo.ST_POint(xcol,ycol)
The data goes from the recordset into the data table quickly and then the
spatial data is created on the server quickly.
You then inert the data into the target table with an insert sql like:
Insert Into TargetTable (I_GPSLOCS_ID, SW_GEOMETRY)
Select I_GPSLOCS_ID, SW_GEOMETRY From TempTable
We suspect that the indexes in the target table are only updated once at
the completion of the insert, and this is the cause for the improvement.
An alternative to this is to add textural data to the temporary table and
then insert that data into the target table, creating the spatial object
as you go:
Insert Into TargetTable (I_GPSLOCS_ID, SW_GEOMETRY)
Select I_GPSLOCS_ID, dbo.ST_Point(F_LONG,F_LAT)
From TempTable
If you go this way, the temporary table does not need to be spatialised at
all.
Unfortunately it does not seem to be as easy to create polylines as the
function ST_Polyline is not as simple as ST_Point. Will summarise the
approach used for this later - when I work it out.
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: 16716