
I wrote this facility using Visual Basic within MS Access purely because my data was already in Access, and I was familiar with the VB language. It could have been written in many other languages, e.g. Java, and the result may have been a better product. As it is, the code is rather monolithic, but does the job. I am contemplating re-writing it (better) in REALbasic - one day (perhaps - when I've learned the language!!).
I offer it as-is, with no warranties. Use it as you wish. I have made it available as free-ware, but I would ask that this note is kept with the Access file and documentation should you pass it on.
The processes include lots of validation but they are (probably) not bomb-proof.
It may sound obvious, but you will need MS Access installed to use this facility. You will also need a passing knowledge of Access to bring in the required data.
DisMap is distributed as a Zip file containing the DisMap.mdb Access database which includes all required VB code. The Zip also contains this documentation HTML page, the graphics files it calls upon, and style sheet to make it look nice!. All of these files need to to be extracted to the same folder to function together.
Though I have no plans to amend or upgrade DisMap, any constructive suggestions would be welcome, preferably together with amended code!!!. An email link is available on my web site www.middlea.freeserve.co.uk (along with a copy of the DisMap zip file (just follow the Software link)) .
The mapping is based on data from three columns in an Access Table or Query - the Eastings Column, Northings Column and Values Column.
DisMap works in two modes - Grid and Exact - and the use of these columns differs according to the chosen mode ...
In Grid Mode, Eastings and Northings should be integer values that are (normally) Ordnance Survey National Grid 'Eastings' and 'Northings' values at a resolution of 1km. Since the map treats this data simply as numbers they could relate to any similar grid reference system. They define the SouthWest corner of a grid square to which the Value data relates. The grid square will usually have a size of one 'unit' (km.) but this can be overridden (e.g. to map data for 5km squares). The Values Column may be any numeric value relating to the grid square (e.g. hectares of grassland per square, census headcount, a numeric indicator of primary soild type, etc.). A symbol will be drawn in the centre of the grid square with a size based on the value column.
In Exact Mode, Eastings and Northings represent the exact location to which the Value data relates and do not need to be integer. A map symbol will be drawn centred at this location with a size based on the value column
The DisMap.zip file should be unzipped and the DisMap.mdb database file should be opened in Access. The required data can then be brought into DisMap by any available means, e.g.
By Designing a new table into which the data is then typed. Probably not the preferred method.
By Importing data from a CSV, text or Excel data file into a new table.
By copying an existing Access table from another database, either by drag-and-drop or by copy-and-paste.
By creating a Linked Table from an existing Access table from another database. This is probably the preferred approach if such a table exists.
Information on these approaches can be found in the MS Access Help options.
Alternatively, other data can be brought in as tables (as above) and the data to be mapped can then be derived in a Query.
The resulting data needs at least the three columns described above, but they can be of any suitable type (e.g. Single or Double precision) and with any name. Additional columns can be present - e.g. a single table can contain several data values.
In Grid Mode it is not necessary to provide a data row (record) for every grid square of the map area, 'Undefined' squares can be accommodated and can be highlighted in the map if required.
Data values can be negative, zero or positive. Up to six band ranges can be defined manually when creating the map, but if you ask the software to define the bands it will place all negative values into the first band. This can be overridden before drawing the map.
The zipped database file includes sample data taken from the Countryside Information System (from www.cis-web.org.uk) and a simple query to derive further data.
Having set up the data, open the CreateMap Form from the Forms tab in the Database window or from the Menu opened on loading the database.
This is a simple (!) form that defines all the data needed to draw the map ...

The dimensions are defaulted to produce a map to fit an A4 page.
Map Title provides a main title to be printed at the point size given by TitleSize (pt). All other text - e.g. grid values and the symbol key - are printed at a point size given by Other Text (pt).
Sub Title can be any text needed below the main title, possibly a definition of the units of the mapped data (as suggested by default).
Map Width (mm) is defaulted to 140mm to produce a map that neatly fills the width of an A4 page. This can be reduced if the North-South range is such that the map would not fit vertically in the page. You may then want to reduce the text font sizes.
Outline (px) and Other Lines (px) define the width of lines to be drawn on the map (in pixels). 'Other Lines' refers to grid lines, the inner 'outline' and the lines of 'Cross' symbols. The 'Outline' thickness relates to an outer outline drawn around the map. These can be adjusted to improve presentation - e.g. if the map is to be reduced for reproduction.
Table/Query provides a pull down list of the tables and queries set up within the database (as described above). This list is set up on loading the form. If a new Table or Query is created, the form should be closed and re-opened.
Having selected a Table or Query from the list, the pull down lists behind the next three Column fields will be updated and the fields will be cleared. You should then select the three columns to be used for Eastings, Northings and the data Values. The three names must be different.
Data/Map Mode defaults to Grid. In Grid mode, the Value data relates to grid squares with their SouthWest corner defined by the E/N data. These squares will normally be 1km unit squares, but can be other multiples as defined by the Grid Size box - in such a case the E/N data will be validated to ensure that it is exact multiples of the Grid Size.
Data/Map Mode can be changed to Exact. In this mode, the data in mapped at the exact location given - e.g. when mapping observations rather than statistical data.
Min and Max Eastings and Northings values can then be provided to define the map area. By default these are set to the recording area for the Sorby Natural History Society based in Sheffield (http://www.sorby.org.uk/).
Grid lines will be drawn on the map at an Easting/Northing spacing given by Grid Space. This defaults to 10 but can be set as appropriate. The grid lines will be defined by multiples of this value, not necessarily starting at the minimum E/N value.
Having defined the source data and the map area, the rest of the data can be left at default values, or can be overtyped. Alternatively, by setting the Initial No of Bands (2-6) and clicking the Reset Bands button, the bands will be redefined to provide an even spread of data. This will ...
Create a first band to hold all negative values (if any are present in the selected table, columns and map area). If so, the next band will start at zero. If there is no negative data, the first band will start at the lowest value found.
It will spread positive values over the requested number of bands (or one less if it was used for negative data). As an example, requesting 4 bands (with no negative data) will effectively divide the data into quartiles.
It will also set-up all positive bands to map as Filled Circles, with their size increasing through the bands. A negative band will be set-up to map as a Cross. Symbol sizes are set in the range 0-1 as proportions of the Grid Size.
Zero values can be included in the mapping (i.e. in the band starting at zero) or can be left blank according to the setting of the Blank for zero values tick box. This can be set before or after clicking Reset Bands.
Band colours are initially set-up as Black (i.e. 0,0,0 in the Red/Green/Blue columns). Initially the data is also set-up to print any undefined grid squares (in Grid Mode) as White (i.e. 255,255,255 in the Red/Green/Blue columns). All of these colours can be overridden as required - e.g. 255,0,0 gives Red, 255,255,0 gives Yellow.
All other band data can also be overtyped. Later actions will check that the band boundaries are in ascending order - unused bands need to be set to zero. Symbol Shape can be Square, Round or Cross. The Fill check boxes can be set to fill Sqaure and Round symbols, or un-checked to leave them as an outline (which is possibly of more use in Exact Mode where symbols can overlap). Symbol Size must be in the range 0-1 (which represents a proportion of Grid Size), and Colour values must be 0-255.
If any band minima or Blank for zero values are changed, the number of data rows (records) falling into each band can be recalculated by clicking the Check Counts button. Note that this is only for information to show the distribution of the data - it is not necessary.
Finally click on the Format Map button. After checking the data, this will open the ReportLayout report. If you were to examine this report in design mode, it appears to be a blank page. On formatting, the map is generated by Visual Basic code held in the database and is drawn onto this blank background.
That's it - Go Play!!
Once you have finished with a map, close the report page and you can then select new data or amend any of the parameters.
Reports can be printed from Access and used as they are, or the paper copy could be scanned if the map is required as a graphic file or within a document (e.g. in Word).
An alternative which I have used is to print the report to a PDF file using the 'PDF XChange Lite' program which is sometimes available on magazine cover CDs. (or at a cost from http://www.docu-track.com/).
The PDF can then be opened using Adobe Photoshop or Photoshop Elements (and possibly by other packages) so that the map can be manipulated and saved as a graphic file.