Re: Location batch import
Whats the easiest way to batch import a list of hundreds of locations?
Information Officer
Greater Lincolnshire Nature Partnership
The technical forum of the NBN Trust for use by the Network. It includes discussions and announcements on the NBN Atlas, Recorder 6 and Indicia |
You are not logged in. Please login or register.
Forum → Recorder Troubleshooting and Bug Reports → Location batch import
Whats the easiest way to batch import a list of hundreds of locations?
Good question!
Good question!
Awww... There was me thinking someone had an answer! :D
I don't think there is an easy way. The answer would have to be manually. I would do it via the Access database. Import the list as a new table into the Access db, rearrange the columns and add additional ones to mimic the structure of the LOCATION table, create unique, sequential LOCATION_KEY values (I wrote some code to do this), fill in any of the other columns which you are able, use an update query to fill in LAT & LONG (again using some code). Eventually when it all looks right, back up the db and then paste the data into LOCATION. Then start working on any associated tables (LOCATION_DESIGNATION etc). Not forgetting to run the Update Last Key addin after you have finished. Simple?
Actually I've done loads of similar jobs and I find it pretty easy now, but you want to be pretty sure you know what you are doing before you get stuck in.
So there's your answer, not pretty but it is the only solution apart from entering them by hand as far as I can see.
If you're serious about doing it and want some help, drop me a line and I'll go through the detail with you.
On second thoughts, if you only have very basic info to import (Name & GR) you could make your list of sites into a list of dummy species records (using a species you aren't likely to find in your area perhaps and then run the import wizard and let it create all the locations for you. Then you just need to fill in all the other information you need, oh and delete those dummy records
On second thoughts, if you only have very basic info to import (Name & GR) you could make your list of sites into a list of dummy species records (using a species you aren't likely to find in your area perhaps and then run the import wizard and let it create all the locations for you. Then you just need to fill in all the other information you need, oh and delete those dummy records
Yeah, I was thinking that's probably the easiest way to go (the only extras I want are site type which I can do via SQL)....:rolleyes:
Just realised you don't need to import the species records of course - after the creation of the locations, just cancel the import.
Of course
I have a batch update which will do this based on a csv file. It can be dowloaded at www.lfield.co.uk/downloads/LClocations.zip The Batch Update takes a csv file with Location Name, Spatial Ref and Location type (as a key). It creates the keys using the standard method, but it needs to work out the Lat/Long and to do this it uses, a user defined function (included in the zip file) which needs to be installed first using the SQL Server Management tools. Also inluded in the zip file is a sample of the csv file required.
The advantage of the Batch update over the import wizard method is that it can populate fields like Location type which the Import Wizad can not. The Batch Update could also be abapted in a number of ways. For example it could populate additional table associated with Location, such as Site Status, Features etc. and could be used to create a hierarchy.
I have tested the Batch Update and it appears to work, but if you do use it do take a back up first and check the results, restoring if necessary. Like most Batch Updates of this type it doesn't validate the data, so make sure your import file is correct before trying it. If anyone who tries it can let me know how they get on, I will fix/improve as required.
Mike
.
I have a batch update which will do this based on a csv file
Made my day :D
Mike seems to have removed the file from his website: www.lfield.co.uk/downloads/LClocations.zip
There is a new Batch Update which adds Samples to an existing Survey Events but nothing for locations. If someone still has the locations batch update could they provide it to me?
thanks
It is still there, but as I have switched to a Unix based web server the file names are case sensative. Try
www.lfield.co.uk/downloads/LCLocations.zip
Forum → Recorder Troubleshooting and Bug Reports → Location batch import
Powered by PunBB 1.4.6, supported by Informer Technologies, Inc.