Sunday, August 8, 2010

Automatically updating base layers from Shp Files in external sources.

So, I need to develop an automated process for going from a file on someone else's server to a working file that I can deal with. Unfortunately, this is going to take a few more steps than I am used to.

The file is here:

ftp://kcwppub3.co.kitsap.wa.us/gis/datacd/arcview/layers/parcel/footprints.zip

Step zed is to delete the existing data in the database, to allow for the inclusion of new stuff.
Step one is to retrieve the file and download it to a known location
Step two is to unzip the file in the known location
Step three is to convert that .shp file to data in a MYSQL database using shp2mysql utility into the existing database.

This will all be run through Cron as a shell script, with a new version of this data sync'ed every night.

This should work – and getting it working should be a pretty big achievement. Also, the code, once created, will serve to allow the importation of any similar data by only changing the filenames, directories, and database names. This procedure relies upon having a file with the same filename present on a server, and that it is that file which is continually updated, without the filename changing.

Ta-Da

Now I just have to get it to work, and to do so in an automated way.

Dom

No comments:

Post a Comment