[mapserver-users] unable to build spatial index when running shptree from ArcGIS model
Matt Brown
mbrown at al811.com
Tue Jul 26 15:03:12 PDT 2016
Mark,
I just ran a test and was able to execute shptree through a script in
arcmap.
this is the script I ran:
import subprocess
subprocess.Popen(['D:/GIS/testqix.bat'])
which opened this batch file:
call d:\ms4w\setenv.bat
shptree d:\gis\nm.shp
I was also able to just point directly to the batch file when I defined the
script which also works for me.
Hope this helps,
Matt
Matt Brown
Technology Systems Director
Alabama 811
mbrown at al811.com
On Tue, Jul 26, 2016 at 2:25 PM, Mark Volz <MarkVolz at co.lyon.mn.us> wrote:
> 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*
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160726/12e7c59a/attachment.htm>
More information about the MapServer-users
mailing list