[mapserver-users] unable to build spatial index when running shptree from ArcGIS model

Mark Volz MarkVolz at co.lyon.mn.us
Tue Jul 26 12:25:06 PDT 2016


Hello,

I am in the process of trying to automate the update process for my mapserver GIS data.  As part of the process I am using shptree to build spatial indexes.  I created a batch file (.bat) that will set all the paths and environment variables then run shptree on my new GIS layers.  This batch file works fine on its own.  My next that I would like to do is call this batch file from ArcGIS so that I can run the "update shptree" script immediately after I update my GIS data.  Although I can use python to open up my "update shptree"  batch file, it appears that shptree does not get run at all.

Please let me know If anyone has had any success in using ArcGIS to run shptree.exe.

Working Method
Window Explorer -->  UpdateShptree.bat:  Works great
Not Working
ArcGIS Catalog / Model Builder  -->Python Script to run UpdateShptree.bat  -->  UpdateShptree.bat:  does not work

Scripts:

Python file:
# Import native arcgisscripting module
import sys, string, os, arcgisscripting
# Create the geoprocessor object
gp = arcgisscripting.create()
os.system('C:\\ GIS\\ PublishUpdates\\UpdateMooseQIX.bat')
gp.SetParameterAsText(0,"True")

Batch file:
set PATH=C:\ms4w\Apache\cgi-bin;C:\ms4w\tools\gdal-ogr;C:\ms4w\tools\mapserv;C:\ms4w\tools\shapelib;C:\ms4w\proj\bin;C:\ms4w\tools\shp2tile;C:\ms4w\tools\shpdiff;C:\ms4w\tools\avce00;C:\ms4w\tools\demtools;%PATH%
set GDAL_DATA=C:\ms4w\gdaldata
set GDAL_DRIVER_PATH=C:\ms4w\gdalplugins
set PROJ_LIB=C:\ms4w\proj\nad
cd C:\ GIS\ PublishUpdates\MOOSEStagingArea\
shptree ParcelsLyon.shp
shptree Plats.shp
shptree Lots.shp


Sincerely,
Mark Volz, GISP
Lyon County GIS Coordinator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160726/2c387a47/attachment.html>


More information about the mapserver-users mailing list