Topic: Lat Long Fields in GRID_SQUARE table

I've written a batch update to populate the GRID_SQUARE table with one km squares for our locations generated from our GIS. The batch update seems to work fine - when I try to enter a record for a location that is outside the square loaded for the location Recorder  produces the expected error. My question is what is the point of the Lat Long fields in the GRID_SQUARE table? My batch update does not attempt to populate them and Recorders valid square check still works. Am I missing something that might come back to bite later?



Re: Lat Long Fields in GRID_SQUARE table

Most of the spatial checking in R6 is based on Lat/Long so I would think this is the problem. use UDF  [dbo].[LCGRToLLGBNI] to populate the lat/Long

Mike Weideli


Re: Lat Long Fields in GRID_SQUARE table

Thanks for the reply Mike. Are you suggesting I use the UDF as a precautionary measure as Recorders valid grid square check works even when the lat long fields are NULL for the location when entering data using 'enter species for place and enter a species record'.


Re: Lat Long Fields in GRID_SQUARE table

I think it would be wise to populate the lat/Long fields. As a general rule it isn'ta good idea to do anything through a Batch update which can't be done through the application.  It may have an unexpected effect. 

You may already be aware of it or it isn't relevant, but if any Grid Squares are populated for a Location then the actual Location Grid reference, must also be in as  Grid Square.

Mike Weideli


Re: Lat Long Fields in GRID_SQUARE table


To carry out a similar process I imported a layer from MapInfo in to the Recorder mapping system and matched the names of Locations against the imported polygons automatically (in most cases, it doesn't like names with apostrophes) and then created the grid squares from there. The GRIDSQUARE table is fully populated with lat/long field.

Gordon Barker
Biological Survey Data Manager
National Trust


Re: Lat Long Fields in GRID_SQUARE table

Thanks Gordon, I hadn't thought of doing it like that. I've amended my batch update to populate the lat/long fields using Mike's udf which seems to work well although the lat/long values it produces are very similar but not the same as those when the squares are entered manually! I was working on this at home yesterday and stupidly have left the results behind. I'll post them later.


Re: Lat Long Fields in GRID_SQUARE table

The discrepancy may be down to the value you give the fourth parameter of the function. Setting this as Zero will return the lat or long of the southwestern corner of the grid square, while a 1 will return that for the centre. Not sure which recorder uses by default here, but you should try to use the same I guess.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre


Re: Lat Long Fields in GRID_SQUARE table

Recorder always uses the SW Corner. Think that there can be very minor differnces ( a few cm's) in the Lat/Long produced by the UDF and the one in Recorder, however, this isn't significant. If you have larger differences let me know.

Mike Weideli


Re: Lat Long Fields in GRID_SQUARE table

I chose the SW corner. I've pasted the results below:

51.9258841847324 -0.109208525104051 manual
51.9258841847324 -0.109208525104052 batch update

51.9152189432718 -0.00785944369748746  manual
51.9152189432718 -0.00785944369748727  batch update

As Mike says just minor differences in the Long field.  Incidentally when manually adding the 1km grid squares to locations with an existing six figure centroid I did not have to add the centroid as a grid square (Recorder