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.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Mar 22, 2011 at 15:35
1
  • 1
    Nope, this is a great question. 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

answered Mar 22, 2011 at 16:45
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"
answered Mar 22, 2011 at 17:53
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.

Glorfindel
1,0962 gold badges10 silver badges15 bronze badges
answered Mar 22, 2011 at 17:33
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

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.