If the order of the sites in your table is random in itself, you can use this approach:

select * from mytable where rowid mod 10=0

This will select record 10, 20, 30 etc.

If you want to get a better spatially spread, start by ordering the sites according to centroidx() and centroidy().

The random function in mapbasic isn't of such great quality, which can be seen here: www.routeware.dk/mapbasic_rnd.png
A better one, called from a DLL: www.routeware.dk/delphi_rnd.png

The source code for this can be found here: www.routeware.dk/download/randompoints.zip

Regards
Uffe

----- Original Message ----- From: "John Nott" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, October 26, 2005 11:37 AM
Subject: MI-L Selecting a Random Sample from a Table


Hello List,

I have a table of about 5,000 sites. What I would like to do is select a
spatially random distribution of about say10% or so of these. Does
anyone know a way of doing this in MI. I suppose I could add a row ID
and do a random number generation is Excel but it would be useful for
future reference.

Thanks for any help you can offer!!

All the best,
- John

John Nott
Consultant/GIS Analyst

ROGER TYM & PARTNERS

Fairfax House, 15 Fulwood Place, London, WC1V 6HU

t       020 7831 2711
f       020 7831 7653
e      [EMAIL PROTECTED]
w     www.tymconsult.com



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

Reply via email to