Topic: 1km & 2km radius search for records of gridref

Can anybody point me towards a way of conducting a radius search without using 'trace' facility on basemaps.

Re: 1km & 2km radius search for records of gridref

I'm not aware of an easy way to run a radius search for any given grid reference within MapMate, but the following query will give you all the records within the supplied tetrad:

All Records for a <2km Square>
PARAMETERS [Enter a 2km square - eg ST15D] Text;
SELECT Records.[_guk], [Taxa].Code AS Code, [Taxa].Taxon, [Taxa].Vernacular, [Sites].Name AS Site, [Sites].OSGridRef AS Gridref, IIf([Sites].ViceCounty>200,'H' & [Sites].ViceCounty-200,[Sites].ViceCounty) AS [Vice County], Records.Quantity & IIf([*Sex]<>'u',' ' & [*Sex],'') AS Quantity, IIf([Records].DateTo-[Records].Date<27,Format([Records].Date,"dd mmm yyyy"),IIf([Records].DateTo-[Records].Date>32,Format([Records].Date,"yyyy"),Format([Records].Date,"mmm yyyy"))) AS [Date], Recorders.Name AS Recorder, Methods.Method, TaxonStage.Stage, RecordStatus.Status, Records.Comment
FROM (((((Records INNER JOIN Taxa ON Records.[*Taxon] = [Taxa].[_guk]) INNER JOIN Sites ON Records.[*Site] = [Sites].[_guk]) INNER JOIN Methods ON Records.[*Method] = Methods.[_guk]) INNER JOIN Recorders ON Records.[*Recorder] = Recorders.[_guk]) INNER JOIN TaxonStage ON Records.[*Stage] = TaxonStage.[_guk]) INNER JOIN RecordStatus ON Records.[*Status] = RecordStatus.[_guk]
WHERE ((([Sites].[2kSquare]) Like [Enter a 2km square - eg ST15D]));

It should be possible to do something similar for a 1km square, but the sites table does not contain 1km square information, so it would require a more complicated Where statement with lots of IIFs and string splitting/concatenating!

Dave

Dave Slade
Senior IT & Records Officer,  SEWBReC
13 St Andrews Crescent, Cardiff, CF10 3DB

Re: 1km & 2km radius search for records of gridref

Thanks for the info DaveSlade I will put that to work.

Re: 1km & 2km radius search for records of gridref

See below for query and subquery to produce a species list for a 1km square - this could be adapted to produce a list of records for a 1km sqaure, let me know if you need that as well.

It is possible to draw polygons onto a MapMate map and then use the polygons to query the underlying records, but this is quite fiddly to do and is also not well-documented. To draw a polygon you need to look at MapMate's Edit menu:
Edit - Tools - Draw Poly

Having drawn the polygon you can select it and query the records - it's a while since I've attempted to do that and can't remember how it's done, but it is possible!

Martin


1kSquareList

SELECT [Sites\Default].[_guk], IIf(Len([OSGridref])=4,Null,IIf(Len([OSGridRef])=6,[OSGridRef],IIf(Len([OSGridRef])=8,Left([OSGridRef],4) &
Mid([OSGridRef],6,2),Left([OSGridRef],4) & Mid([OSGridRef],7,2)))) AS [1k Square]
FROM [Sites\Default];


Species list for <1kSquare>

SELECT [Taxa\Default].Taxon, [Taxa\Default].Vernacular, [Taxa\Default].Authority, Count(Records.Quantity) AS Records, Sum(Records.Quantity) AS Individuals, Min(Year(Records.[Date])) AS [First Recorded], Max(Year(Records.Date)) AS [Last Recorded]
FROM ((Records INNER JOIN [Taxa\Default] ON Records.[*Taxon] = [Taxa\Default].[_guk]) INNER JOIN TaxonStatus ON [Taxa\Default].[*Status] = TaxonStatus.[_guk]) INNER JOIN [C\1kSquareList] ON Records.[*Site] = [C\1kSquareList].[_guk]
WHERE ((([C\1kSquareList].[1k Square])=[1km Square eg SU4619]))
GROUP BY [Taxa\Default].Taxon, [Taxa\Default].Vernacular, [Taxa\Default].Authority, [C\1kSquareList].[1k Square], [Taxa\Default].Code
ORDER BY [Taxa\Default].Taxon;

Martin Harvey

Re: 1km & 2km radius search for records of gridref

Hi Martin,

Thanks for info I will give it a go.

John.