Search This Blog

Monday, August 6, 2007

How to create a shape file without the help of commercial software?

Shape files are so-called vector databases, describing the location of points (e.g., collecting locations), polylines (e.g., roads) or areas (or polygons, e.g., soil types, countries). A shape file actually consists of three separate files with the same name but with different extensions (SHP, SHX and DBF), but they are treated as one file. ESRI, a leading GIS software company. They were initially developed for use in ArcView, but now nearly all GIS programs can either directly use them, or import them.

Shape files can be prepared with the help of any commercial software and also by some free software. Before going to the main tutorial a more detail concept of shape file is needed.

Shape file mainly consist co-ordinates and value/s attached. By far the most accurate representation of elevations is done with shape files. In this case co-ordinates and elevation of that point is recorded in the shape file.

For an example, try to answer the following question?

How can a man who can not read words but only numbers will find your house ?. The answer is simple: he will want to know the co-ordinates of your house. When you give the coordinates he can easily find your house. Now look into the following picture, how can you best describe the location of point ‘A’?

See Fig.1

If you assign the location of left – down corner as 0,0 then you can easily found the location of point ‘A’(Fig.1).

So, every point or points can be represented by co-ordinates. Shape files just store a value of parameters specific to that coordinate so that you can represent them graphically.

Now that you have an idea of shape file let us begin the tutorial:

1. Say, you want to measure the depth of a pond and represent variation of them graphically on a digital photograph of the water body.

2. Visit the place with a GPS meter (an instrument that will communicate with satellite and fetch ‘your’ co-ordinate) and an eco-sounder (an instrument which can measure the depth of any water body).

3. Measure the depth and the corresponding co-ordinate of that place. Also collect the co-ordinates of the borders of the pond.

4. With the help of this readings create an excel sheet where the first and second column has the latitudes and longitudes respectively. The 3rd column must carry the values of depth. Remember to give 0 depths for the border co-ordinates.

5. Save the excel sheet as CSV(Comma delimited).(Go to File > Save As, from the drop down menu select CSV(comma).Click Save.)

6. Go to http://www.diva-gis.org .Download DIVA-GIS.

7. If you downloaded DIVA from the Internet, you need to unzip the downloaded files
first (use e.g. pkzip; www.pkware.com). Then you should click on setup.exe to install DIVA; also click on this file if you are installing from a CD-ROM. You will be asked in
what directory (folder) you want to install the program. As you can install the program in any directory you like, in this manual we will refer to this directory as the . By default, DIVA will be installed in the C:\program files\DIVA-GIS\directory.

8. Open DIVA.Click on ‘Data’ in the top most toolbar. Select ‘Import Points To Shape File’.

9. Select ‘From Text file’.

10. A pop up will appear.(See Fig.2).Click on the input button. Select the CSV file (Step – 5).

11.The data set in the csv will be now imported into the bottom blank place(See Fig.3).Carefully monitor whether X column contain the Latitude and the Y column the Longitude. The last column must hold the values of the corresponding depth.

12. Click Output button and give a name to your shape file. Choose a location to save the file.

13. Click ‘Apply’

14. Your shape file will be created and saved in the location you choose in Step-12

Voila: Your shape file is created and ready to be imported into any GIS modeling software.

The above steps will create a shape file out of a bathymetry data set. Though you can create shape files of any type of data set. Just remember to include the Lat-Long column.

In the above example the shape file has only one value. But you can off course include as many parameters as you wish. Though it is better to create one shape file per parameter so that you can represent all of them properly.