Locations
Tools > Locations is used to import and export locations stored in the database.
There are a number of reasons why you might want to do this:
- Backup your database to ensure no loss of data in the event of a hard drive failure.
- Upgrade from your current version of Locator to a newer version.
- Bulk load data from another application into the Locator database.
- Share data with another user of Locator.
- Edit data in a specialized application like a spreadsheet or text editor.
- Generate reports with a specialized report generator.
Prior to importing any locations into the database it is highly
recommended that you make a copy of the database using Windows
Explorer. This is a commonly used and well understood method that
ensures safety of your data. You may want to consider doing this
periodically.
Database Copy
The database is stored in the 'locator-db' folder.
To
locate this folder right-click the Locator icon on your desktop.
Select the 'Properties' menu item. Take note of the 'Start
In' folder.
To make a copy of the database use Windows
Explorer to navigate to the 'Start In' folder. Right-click the
'locator-db' folder and select 'Copy'. Navigate to the file
system where you want to store the database backup. A network
drive or USB drive is a safe place to put this. Right-click and
select 'Paste'. A copy of 'locator-db' will be made.
The
file size is at least 400 MB so you may want to consider using an
archive tool like 7-Zip or WinZip to compress the file. The 7-Zip
Ultra compression mode will compress to less than 20 MB. 7-Zip is
a free, open source application.
The file size generated with
this method is large because both user data and system data is copied.
The system data has surveyed coordinates for all sections in the
four western provinces of Canada. The method described next only
copies the user entered data and this is therefore much smaller in size.
Locations > Export
This
will output the locations in CSV format to a file of your choice. CSV
files are text files with comma separated values.
These files can be edited with a text editor like NotePad or
NotePad++ or opened with a spreadsheet application like Microsoft Excel
or Open Office Calc. After exporting you should view the CSV
file to ensure all your data has been exported.
Locations > Import
Make
sure you have made a database copy (see the 'Database Copy' section
above) before you do this. This is optinal but will help you easily recover your
oiginal data. The imported locations are added to the database. This may result
in a duplicate if a location that is imported is already in the database. You
can eliminate duplicates after the import is complete by using Find > Delete. You
can also remove any possible duplicate in advance using this method. You can
also edit the locations file and remove them from the file before importing.
To import use the file chooser to navigate to the
folder containing the files that were previously exported.
See the Locations File topic for a
detailed description of the fields in the file.
CSV Format
If
you modify or add locations you will need to understand the
comma-separated value format. This is a widely used format.
Each line of text consists of values separated by commas.
There are no spaced before and after each comma. The first
line has a list of field names. These correspond to database
field names. Each line of text after the first consists of a set
of text and numeric values separated by commas and terminated by a
newline character. The rules for these lines are:
- If a field has no value then do not put anything between the commas or put two quotes together between the commas.
- If a field is numeric there is no need for quotes but quotes are permitted.
- If a field is a text field and has no commas embedded in it then quotes are not needed but are permitted.
- If a field is a text field and has one or more commas then it must be delimited by quotes.
- Do not add more fields or remove existing fields.
- Do not change the order of the fields.
- The quote character is the double-quote character, ".
- The grid type, surface grid latitude, and surface grid longitude are mandatory.
- The '^' is used as a separator in the comments field and the URL field.
The
spreadsheet applications, Microsoft Excel and OpenOffice Calc, will
input and output data in this format. If you need to modify
locations or add new locations you should consider using one of these
applications. If you use NotePad or NotePad++ then you need to be
careful to obey these rules when making changes to the files.
Do
not create a file from scratch yourself. Instead, do an export
then modify the file. This will ensure you have an example of the
correct format and that all the field names on the first line are
present and in the correct order. Do not change the names of the files.
The official CSV specification is RFC 4180 and is available on the Internet at http://tools.ietf.org/html/rfc4180. There is an entry for 'comma-separated values' at http://www.wikipedia.com.