Masthead

Assignment: Writing Synthetic Data to Text Files

1. Introduction

You've seen that writing out text files in Python is relatively easy and you can create your own files that contain anything you want them to. Now it's your turn to create two files that contain spatial data that you define.

Note: The files below will not have a defined spatial reference (i.e. "prj" file). This is OK for this exercise.

2. Writing CSV Files

For this portion of the assignment, create one script that outputs the two data sets below and stores the result in the "C:/Temp" folder as "Part_1_1.csv". and "Part_1_2.csv".

Part 1. Excel data

Create a csv file that creates an interesting pattern of at least 5 columns of data that can be loaded into Excel. You can use code from pervious assignments for this.

Part 2. Point data

Create a CSV fie that has an interesting pattern of coordinate values for longitude and latitude. Load this data into ArcGIS as "X,Y" data and make sure the data looks correct.

3. A Synthetic Raster

Write a second script that creates a raster that is at least 10 x 10 pixels and contains data defined by you. The data can contain a athematic function, random data, or random data modulated by a mathematical function. Have the script output the file as "Part_2.asc". Make sure you load the file into ArcMap and it looks good.

Remember to take your time, go step by step, and make sure each piece works before moving on. Also remember to load the file into ArcGIS or another GIS package to make sure it works.

Turn In

Turn in the two script files for this project (you don't need to turn in the output files). I'll run the programs to see the outputs. Your documentation should include a description of what the scripts do.

Remember: Please write the files to "C:/Temp/" to make them easier to grade.

© Copyright 2018 HSU - All rights reserved.