Hi.
I believe the quickest way to add features to a layer in MapX is to use
layerinfo and a features collection, although I havent tested against the
adding a feature at a time approach.
So rather than doing an ADDFEATURE for each object, append the objects to a
features collection and then add this to a new layer using the layerinfo
object  and LAYERS.ADD method.

Following (in Progress) was the basis of a MapX pack table, but is roughly
what's required:

    CREATE "mapx.layerinfo.4" linfPacked.
    linfPacked:Type = {&miLayerInfoTypeNewTable}.
    linfPacked:AddParameter ("Fields", newfields).
    linfPacked:AddParameter ("Features", allFtrs).
    linfPacked:AddParameter ("Filespec", Newpath).
    linfPacked:AddParameter ("OverwriteFile", "1").
    linfPacked:AddParameter ("Name", "temp_pack").
    Map1:Layers:ADD (linfPacked) NO-ERROR.              /* create table */

If you create a a table type of ...TYPETEMPTABLE, you can use the memtable
option which may be faster.
If you have stand-alone feature objects, you may need to do an f:attach
before adding to the features collection.

Phil.


----- Original Message -----
From: "Karlsson,Niklas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 19, 2002 8:56 PM
Subject: MI-L MapX performance - Layer.AddFeature (#2)


(sorry, previous mail was sent prematurely)

Hi,

I have a large amount of data (approx. 100000 points and 5000 rectangles)
which I want to display using Delphi and MapX. As of now I've assumed that I
could simply create a feature using featurefactory and add it to a temporary
layer. This seems however to be very slow.

Some profiling reveals that adding 1000 small rectangles to a layer takes
~27 seconds. 98% of the time is spent on the function call
"Map1.Layers.Item['Temp Layer'].AddFeature(f, EmptyParam);". Creating the
feature as such seem to be quite fast. I'm running it on a P3/1GHz.

Is there a smarter (=faster) way to this? I assume there is since I've seen
other mapinfo applications which seem pretty fast. Either a quicker to add a
feature to a given layer or a better/faster way to add objects (point &
rectangles) to mapinfo.

Thanks in advance!

Best regards // Niklas




---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 3147

Reply via email to