1

Re: Location batch import

Whats the easiest way to batch import a list of hundreds of locations?

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

2

Re: Location batch import

Good question!

Charles Roper
Digital Development Manager | Field Studies Council
http://www.field-studies-council.org | https://twitter.com/charlesroper | https://twitter.com/fsc_digital

3

Re: Location batch import

charlesr wrote:

Good question!

Awww... There was me thinking someone had an answer! :D

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

4

Re: Location batch import

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

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

5

Re: Location batch import

RobLarge wrote:

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:

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

6

Re: Location batch import

Just realised you don't need to import the species records of course - after the creation of the locations, just cancel the import.

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

7

Re: Location batch import

Of course

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

8

Re: Location batch import

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   



.

Mike Weideli

9

Re: Location batch import

MikeWeideli wrote:

I have a batch update which will do this based on a csv file

Made my day :D

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

10

Re: Location batch import

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

CyprianPayne
CCW

11

Re: Location batch import

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

Mike Weideli