The Python environment of ArcGIS is indeed easy to use.

Source: Internet
Author: User

# --------------------------------------------------------------------------- <Br/> # test. PY <br/> # created on: Wednesday, 2010 02:59:07 <br/> # (generated by ArcGIS/modelbuilder) <br/> # usage: test <v20070101_5_project_shp> <br/> # export <br/> # import system modules <br/> Import sys, String, OS, arcgisscripting <br/> # create the geoprocessor object <br/> Gp = arcgisscripting. create () <br/> # load required toolboxes... <br/> GP. addtoolbox ("D:/program files/ArcGIS/arctoolbox/toolboxes/analysis tools. tbx ") <br/> # Set the geoprocessing environment... <br/> GP. workspace = "E: // work // data // workspace // selectbylayer" <br/> # script arguments... <br/> # v20070101_5_project_shp = sys. argv [1] <br/> # If v20070101_5_project_shp = '#': <br/> # v20070101_5_project_shp = "E: // work // data // workspace // project // 20070101_5_project.shp "# provide a default value if unspecified <br/> # inputshp =" E: // work // data // workspace // project // 20070101_5_project.shp "<br/> # local variables... <br/> # v20070101_5_project_select30_shp = "E: // work // data // workspace // selectbylayer // 20070101_5_project_select30.shp "<br/> # expression ="/"minute/" = 30 "<br/> # process: select... <br/> tempenvironment0 = GP. workspace <br/> GP. workspace = "E: // work // data // workspace // selectbylayer" <br/> for J in range (5, 23): <br/> inputshp = "E: /// work // data // workspace // project // 20070101 _ "+ STR (j) +" _ project. SHP "<br/> Print 'inputshape = '+ inputshp <br/> for I in range (0, 60 ): <br/> Expression = "/" minute/"=" + STR (I) <br/> outputshp = "E: // work // data // workspace // selectbylayer/20070101 _ "+ STR (j) +" _ project_select "+ STR (I) + ". SHP "<br/> Print" outputshape = "+ outputshp <br/> GP. select_analysis (inputshp, outputshp, expression) <br/> else: <br/> Print 'the loop is end' <br/> else: <br/> Print "input shape is all done" <br/> # GP. select_analysis (v20070101_5_project_shp, v20070101_5_project_select30_shp, expression) <br/> GP. workspace = tempenvironment0 <br/> 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.