6

I hesitated a bit before asking this, as it isn't necessarily a GIS specific question, though I'm using it to update geodatabases. I have found plenty of hits on a Google search, but frankly, many of the websites out there for .bat files are hacky and not real trustworthy.

Do you have a resource that you use for database manipulation through batch files?

Any GIS/Geodatabase specific resources for .bat's?

A little background, I'm just starting to dabble in batch files. I'm aware that I can automate many things that are done manually, but am terrified of doing anything I shouldn't be doing/cannot undo. I have found introductory sites that don't give much more information than printing to the console. I'm looking for something that goes into detail about databases.

1
  • 1
    Nope, this is a great question.
    – jvangeld
    Commented Mar 22, 2011 at 18:08

3 Answers 3

7

I don't have any specific links for you, but I think that you should look into the tools that already exist in ArcGIS Desktop.

Have you looked into using Geoprocessing tools & models via python? A good place to start would be to make your Geoprocessing model & then export the model to Python. You can get more information here:http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002w00000031000000.htm

3

Here is discussion of scripts (.bat files) for ArcGIS Server on EC2.

Also, .bat files for starting/stopping arcgis services, as describe by Dave Bouwman:

arcstart.bat

net start MSSQLSERVER
net start esri_sde
net start "ESRI Image Server"
net start "ESRIImageServerReporter"
net start "ESRI Image ServiceProvider: 3983"
net start ArcServerObjectManager

arcstop.bat

net stop ArcServerObjectManager
net stop esri_sde
net stop MSSQLSERVER
net stop "ESRIImageServerReporter"
net stop "ESRI Image ServiceProvider: 3983"
net stop "ESRI Image Server"
3

A good place to start is the OGR toolset. This is a set of command line tools that can interact with spatial databases and could easily be formed into a batch file of commands. The ogr2ogr tool can be used to transform one dataset into another, whilst executing basic select queries or even arbitrary SQL. It acts as a single interface to lots of different types of spatial database.

Most databases have at least some support for executing SQL on the command line. For example using Postgresql you can use the psql with the -c option to execute a single command. This can be chained in a batch file with the shp2pgsql and pgsql2shp commands to load and export data.

1
  • 2
    I agree that OGR can be used well for converting data layers. I would also recommend you look into FWTOOLS which bundles the OGR tools and some other libraries into one easy to use package. I created a very basic python script & UI that you can use to call FWTools very easily from ArcGIS. gis.stackexchange.com/questions/5922/… Commented Mar 22, 2011 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.