Question: 1. Rewrite the following script, replacing the FOR -loop with a WHILE -loop. Save your file as whileLoopino.py for n in range(-50,150,5): print n Note:

1. Rewrite the following script, replacing the FOR -loop with a WHILE -loop. Save your file as whileLoopino.py for n in range(-50,150,5): print n Note: The comma at the end of the print statement in NOT a typo. Its a way to make consecutive print statements appear on the same line separated by a space.

2. Rewrite the following script, replacing the WHILE -loop with a FOR -loop and use the built-in range function. Save your file as forLoopino.py index = 9 while index <= 99: print index index = index + 10

3. Write a script (loopDistance.py) to find a set of distance tables from fire stations to schools in the feature classes in C:/gispy/data/county.gdb (Download from Bb lab 7 data). Use the Point Distance (Analysis) tool to determine the distance from the fire stations (input point features) to schools (near features) and use a WHILE -loop to run the tool with ten different search radius values: 500 meters, 1000 meters, , 5000 meters. Use C:/gispy/scratch as the output directory for the ten output tables, instead of creating them inside the file geodatabase. Name the output files using the numerical distance as dist500.dbf, dist1000.dbf, dist1500.dbf, and so forth. Hard-code the input features, near features, and output directory in this script, so that no script arguments are needed.

4. To investigate the results of using the Simplify Line (Cartography) tool with various tolerance values, write a script (loopSimplify.py) that simplifies lines in parkLines.shp with four different tolerance values. Use the built-in range function and a FOR -loop to perform line simplification for tolerance values: 30 feet, 60 feet, 90 feet, and 120 feet. Use the POINT_REMOVE algorithm. Name output as simp30.shp, simp60.shp, simp90.shp, and simp120.shp.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The question is complete here are the answers to each part 1 Rep... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!