Monday, June 25, 2012

Creating Shapefiles from Google Earth

I was working on a research paper on the South Saskatchewan River Basin in Alberta, Canada and I needed to show all the major water reservoirs and lakes in the basin map. I tried to get that information through different sources; however, I did not able to collect all reservoir polygons.  Then I thought, why don't I try to extract those reservoirs maps from Google Earth and then find some way to convert those polygons to shape file format in ArcGIS. As Google Earth extracted map has geo-referencing in it, I thought definitely there are some ways to do it. Then I browsed through net and find a very useful tool which can convert the Google Earth extracted polygons/lines/points to relevant shapefiles with the aid of ArcGIS. As I find it helpful, I'll try to explain the procedure with example so that other fellows working on similar problem may get help from this post.


Example Project:  In this project we'll extract the Gleniffer Reservoir, Alberta, Canada Polygon from the Google Earth and then convert it to Shape file (*.shp) along with proper geo-referencing.

Software Requirement: Google Earth, ArcGIS 9.X, DNRGarmin 5.4.1

Procedure:

Step1: The first thing is to download and install the required softwares. It should be noted that Google Earth and DNRGarmin 5.4.1 are free software and you can download them from the provided link below. However, regarding ArcGIS, the user needs to buy the registered copy of the software from ESRI.

Google Earth -LINK IS HERE
DNRGarmin 5.4.1- LINK IS HERE

Step 2: You need to search the reservoir location (or any point of interest for your project) in the Google Earth. To do this, open the Google Earth and search the location on the top left portion of the window. For my case, I searched the keyword: "Gleniffer Lake". When I did search the keyword, the Google Earth Automatically located the area and zoom in the lake location. Please see the Figure 1 below to see  the zoomed location of the Gleniffer Reservoir.


Figure 1

Step 3: Next, we need to draw the polygon using very simple tool embedded in Google Earth. Start with clicking the "Add Polygon" tool (See Figure 2) on the top of the Google Earth tool menu.



Figure 2

Eventually to add a point entity, and a line entity you need to use the "Add Place mark" (left), and  "Add Path" (right) respectively.  After clicking the "Add Polygon" tool, a new window will be opened and will prompt for the name of the Polygon. Give a name (e.g. Gleniffer Lake for this example) and DONT click OK. Click the "Style, Color" Tab of the new window and select 'Lines Color': Red and 'Area' as 'Outlined'. Then, extract the polygon by clicking point to point. For a better accuracy, zoom in the map to get the detailed shape of your desired polygon. When you are done, double click the final point (which is same/ close to the initial point for a polygon entity). Figure 3 shows the final extracted map for the Glenffier Reservior.


Figure 3
Click OK to finish the extraction. It should be noted that, the map will be stored on the Left Panel of the Google Earth under 'Places' > 'My Places'  and you should save this Place by clicking File>Save>Save My Places so that anytime you can see this polygon and edit it accordingly.

Step 4: Now we need to convert the extracted polygon in KML (Keyhole Markup Language) format used by Google Earth. The extension for this type of file is *.kml. To do this just right click the saved polygon on the left panel of Google Earth and then click 'Save Places As'. A new window will be opened and just give a name of the polygon (Figure 4). Make sure to select '.klm' as the default is '.kmz'.


Figure 4

Step 5: In this step, we'll use DNRGarmin 5.4.1 to convert the '*.kml' file to '*.shp' and associated files so that we can open the map in ArcGIS for further analysis. Open the DNRGarmin first. Sometimes it shows one or more error message regarding 'Port', just ignore those messages. If you don’t want to get those message again, click GPS>Set Port> USB.

To open the map in DNRGarmin, click: File>Load From> File. A new window will be open for browsing the file. Make sure to select the ' Google Earth Format (*.kml)' as the file type. When you locate the extracted polygon file, it'll prompt for the required 'Output Shape' in a new window whether it's a Point, Line or Polygon. For this example we'll select it as "Polygon" (Figure 5).



Figure 5

After clicking OK, a new window will open showing all the points forming the polygon and their lat/lon. In most cases the first point may not have the Lat/Lon. We need to select that row and delete it to avoid error message in ArcGIS (Figure 6).



Figure 6

Then we need to convert the polygon into shapefile. To do this click: File>Save To>File. It'll prompt for a name and file format. Select ArcView Shapefile (Projected) (*.shp) as the file format and give a name (Figure 7).

Figure 7

When you click 'Save', it'll again prompt for the type of entity and select Polygon for this particular example. The default setting of projection is UTM, however, anyone can set the projections by clicking File>Set Projections.

Step 6: Finally, open ArcGIS/ArcMAp to add the shapefile. The final product will look like Figure 8.


Figure 8

NB: You can also use ArcView 3.x to do the similar steps.

0 comments:

Post a Comment