Golden Software Blog

Helping you learn more about the latest product information, tips, tricks, techniques, and customer stories so you can visualize data and communicate results with ease.

Creating elevation contours within a house footprint from paper notes

Golden Software’s Surfer program can be used in so many applied-science industries for so many different uses, I sometimes forget that it is equally applicable to more business or art-oriented fields. I had a user contact me recently with the following request (paraphrased):

“I have a paper copy of the blueprint of a house, and on it I’ve written elevation measurements that I collected while surveying on the premises. I also have a DXF file of the floorplan of the house. How can I create elevation contours in Surfer and limit them to the shape of the house?”

What a neat application! From a piece of paper and one digital file, can Surfer generate a beautiful and informative contour map of elevation values? You bet it can!

There are a few steps to this process. You need to convert your paper data into digital x,y,z data, grid that x,y,z data, create a BLN file of the outline of the house, and blank the grid file with that outline. Then you can create a contour map of the blanked grid, and display the DXF of the floorplan overlaid on the contours if desired. The steps for each of these processes are detailed below, and sample files are attached so you can step through this process yourself.

  1. Import the DXF as a base layer:
    1. Click Map | New | Base Map.
    2. In the Import dialog, select floorplan.dxf (vectorized using Surfer’s Draw menu commands from a JPG I found here) and click Open.
    3. In the DXF Import Options dialog, leave the defaults and click OK.
    4. Click on the Map in the Object Manager.
    5. On the Limits page in the Property Manager, make note of the xMin, xMax, yMin, and yMax.

spatialextents.png

    1. Uncheck all four axes in the Object Manager.

floorplan1.png

  1. Draw the boundary and export to BLN:
    1. Click Draw | Polygon.
    2. Click around the outside of your floorplan, holding the CTRL key while you click to snap the line to perfectly horizontal, perfectly vertical, or at a perfect 45 degree angle.
    3. Double click on the last point to finalize the polygon and then press ESC to exit drawing mode.

floorplan_outline.png

    1. Uncheck the box next to the Base-floorplan.dxf layer in the Object Manager.
    2. Click File | Export.
    3. In the Export dialog, set the Save as type to BLN Golden Software Blanking (*.bln), give your file a name (like Blanking) and click Save.
    4. On the Scaling page in the Export Options dialog, change the Scaling source to Map: Base-floorplan.dxf.
    5. On the BLN Options page, in the Blank areas section, toggle Outside.
    6. Click OK to export the BLN file.
    7. If desired, uncheck or delete the Polygon from the Object Manager.
  1. Digitize the data:
    1. Click File | Import.
    2. Select the PaperNotes.pdf file (a ‘scan’ of the paper notes you made in the field) and click Open.
    3. Right click on the Image in the Object Manager and click Order Objects | Move to Back.
    4. Check the box next to the Base-floorplan.dxf layer in the Object Manager.
    5. Click and drag the handles on the image until the image lines up with the DXF.
    6. Select the Base-floorplan.dxf layer.
    7. Click Map | Digitize.
    8. Click on the first point on the map where you have recorded an elevation value.
    9. In the Digitized Coordinates dialog, type a comma and a space after the second value in row 1 and then type your elevation value. In this example, the elevation value is displayed in red text next to the point on the image.

floorplan_digitize.png

    1. Click to the next empty row (2 this time).
    2. Repeat steps 3h through 3j for the other elevation values you have recorded.
    3. In the Digitized Coordinates dialog, click File | Save As.
    4. In the Save As dialog, change the Save as type to Data Files (*.dat), give your file a name (like Elevation), and click Save.
    5. Click X in the upper right corner of the Digitized Coordinates dialog to close it, and press ESC to exit digitizing mode.
    6. If desired, you can now delete or turn off the Image.
  1. Grid the digitized DAT:
    1. Click Grid | Data.
    2. In the Open Data dialog, select your Elevation.dat file and click Open.
    3. In the Grid Data dialog,
      1. Make sure the X, Y, and Z Data Columns are set to Columns A, B, and C from your digitized DAT file.
      2. Set your Gridding method (I’ll leave the default, Kriging).
      3. Make sure the Maximum in both the X Direction and Y Direction of the Grid Line Geometry section is larger than the maximums you made note of in 1e, and verify that the Minimums are less than the minimums you made note of. Since our minimums are in the low single digits and the maximums are around 850, using 0 for the minimums and 900 for the maximums here is just fine.
      4. If desired, increase the # of Nodes or decrease the Spacing to get a higher-resolution grid file (I will decrease the Spacing to 3 in both directions).
      5. Click OK.

griddata.png

    1. Click OK in the dialog telling you the grid file was created.
  1. Blank the grid file:
    1. Click Grid | Blank.
    2. In the Open Grid dialog, choose your Elevation.grd file and click Open.
    3. In the Open dialog, choose your Blanking.bln file and click Open.
    4. In the Save Grid As dialog, give your output file a name (like Elevation_blanked.grd) and click Save.
    5. Click OK in the dialog telling you the grid file was blanked.
  2. Plot your contour map:
    1. Select your base map.
    2. Click Map | Add | Contour Layer.
    3. In the Open Grid dialog, select your Elevation_blanked.grd file and click Open.
    4. If prompted to expand the map limits, click No.

Now that your contour map is created, you can fill it as desired, and rearrange the layer ordering so the details in your floorplan display over top of the contours.

floorplan_final.png

It’s amazing how much you can do from so little. From one piece of paper with some elevation values jotted down, you can create a stunning and informative image like this one!

 

Comments

No comments made yet. Be the first to submit a comment
Guest
Tuesday, 17 January 2017

Captcha Image

Keep Reading

02 August 2016
Real Life Applications

I communicated with a user recently who wanted to find the area of overlap of one specific contour line on one contour map with a specific contour line on another contour map. In his case the first contour map was temperature and the second was rainfall. He wanted to find the area where temperature was above one value and rainfall was above another value. Whether this was for agriculture or for some other purpose I’m not sure, but it got me thinking that there could be many applications for a use like this. For example, you may have a contour map of density of one endangered species, and another for a second endangered species, and you’re trying to identify high populations of both in order to create a wildlife refuge. Or maybe you have population of people on one contour map and energy use on another, and you want to find areas with low population but high energy usage so you can send conservationists into that area to notify the population of smart practices. The uses are endless!

So that said, below are the steps to determine the area where two specific contour levels on two different maps intersect. In this case, I’ll be finding the area in Colorado where temperature is greater than 12oC and precipitation is less than 50 hundredths of inches, which may indicate an area that is more prone to wildfires. The data used in this article was obtained from NOAA. January 2015 – November 2015 data was averaged and then gridded in order to produce the attached grids.

  1. Click Map | New | Contour Map.
  2. In the Open Grid dialog, choose the rainfall_avg.grd file and click Open.
  3. In the Object Manager, select the Contours- rainfall_avg.grd layer.
  4. Click on the Levels tab in the Property Manager.
  5. Change the Level method to Advanced.
  6. Click the Edit Levels button.
      a. Click the Delete button until the top level listed is 50.
      b. Click on the next level (55) and click the Delete button until the 50 level is the only level.
      c. Make sure the Label column says No (if it says Yes, double click on the Yes in the Label column to turn it to a No).
      d. Double click on the line.
      e. Change the Color to Blue and click OK.
      f. Click OK.
  7. Click on the Set button on the Coordinate System page in the Property Manager. Setting the coordinate system of the layer will allow us to change the coordinate system of the Map so we can view the area of the overlap in meaningful units.
  8. Navigate to Predefined | Geographic (lat/lon) | World Geodetic System 1984 and click OK.
  9. Click Map | Add | Contour Layer.
  10. In the Open Grid dialog choose the temperature_avg.grd file and click Open.
  11. In the Object Manager select the Contours- temperature_avg.grd layer.
  12. Click on the Levels tab in the Property Manager.
  13. Change the Level method to Advanced.
  14. Click the Edit Levels button.
      a. Click the Delete button until the top level listed is 12.
      b. Click on the next level (12.5) and click the Delete button until the 12 level is the only level.
      c. Make sure the Label column says No (if it says Yes, double click on the Yes in the Label column to turn it to a No).
      d. Double click on the line.
      e. Change the Color to Red and click OK.
      f. Click OK.
  15. Click on the Set button on the Coordinate System page in the Property Manager.
  16. Navigate to Predefined | Geographic (lat/lon) | World Geodetic System 1984 and click OK.
  17. Click on the Map in the Object Manager.
  18. Click on the Change button on the Coordinate System page in the Property Manager.
  19. Navigate to Predefined | Projected Systems | World | Popular Visualisation CRS / Mercator (EPSG 3785) and click OK.

    If we were to fill the areas below the rainfall contour and above the temperature contour, it would look like this:
    image1.png
  20. Uncheck the boxes next to each of the four axes in the Object Manager.
  21. Click File | Export.
  22. In the Export dialog, set the Save as type to GSI Golden Software Interchange, give your file a name (like "overlap"), and click Save.
  23. In the Export Options dialog, make sure the Scaling source is set to Map: Contours-rainfall_avg.grd and then click OK.
  24. Click Map | Add | Base Layer.
  25. In the Import dialog, choose the GSI file and click Open.
  26. Click Yes if you are prompted to expand the map limits to include the new layer.
  27. In the Object Manager, uncheck the boxes next to the two contour maps to turn them off.
  28. Right click on the Base-<filename>.gsi layer in the Object Manager and click Edit Group.
  29. Delete the closed blue polylines that don’t overlap.
    image2.png
  30. Select one of the blue polylines and click Geoprocessing | Edit Boundaries | Break Polyline.
    image3.png
  31. Click where this line intersects with a red line.
  32. Repeat steps 30-31 for the rest of the blue lines, clicking anywhere the line intersects with a red line, until no blue line intersects a red line, but instead the red lines mark where one blue line ends and the next begins.
  33. Repeat steps 30-32 for each of the red lines, clicking at the same locations you clicked for the blue lines, so now no red line intersects a blue line, but instead where red and blue meet this marks the end of one red line and the start of the next.
  34. Select the portion of the polyline that is not part of the overlap (using the image from step 19 if needed) and press DELETE.
    image4.png
  35. Click Draw | Polyline and connect the ends of the two big incomplete polygon. Do the same for the red polyline in the upper right corner and press ESC to exit drawing mode.
    image5.png
  36. Click one polyline in the big area and rename it ‘1’ in the Object Manager.
  37. Click the next polyline in the clockwise direction and name it ‘2’, then click and drag it in the Object Manager so it’s just above ‘1’.
  38. Repeat step 37 for the rest of the polylines in the big area.
  39. Select all of the polylines that make up the big area and click Geoprocessing | Edit Boundaries | Connect Polylines.
  40. Repeat step 39 for the smaller area on the left and then the area in the upper right corner.
  41. Select all of the polylines and click Geoprocessing | Change Boundaries | Polyline to Polygon.
  42. With all polygons still selected, click Geoprocessing | Edit Boundaries | Combine Islands/Lakes.
  43. Right click on the Base layer in the Object Manager and click Stop Editing Group.
  44. You can turn on the axes and contour layers, change the Level method for each contour map back to Simple, and change the line and fill properties of the base layer overlap in the Property Manager, if desired.
  45. To get the area of this polygon, you can select the polygon and click to the Info tab in the Property Manager to view the perimeter and area in map units.
    image6.png

Although the process takes a little time it’s well worth the result. For practically any field of study, this process can be used to accurately identify where two variables intersect, allowing you to identify your region of interest for overlay with other informative maps in Surfer.

image7.png

1318 Hits 5 Comments Read More
19 July 2016
Surfer

As an avid outdoorsman in Colorado, I am always making sure I know what the current local weather pattern is going to do. Whether I’m going into Rocky Mountain National Park for a day hike, attending an outdoor show at Red Rocks amphitheater, or riding in the weekly Denver Cruiser ride, I have learned over the past 17 years that the weather in my colorful state is always unpredictable! I know I need to consult the forecast to see if I need to wear a rain jacket, pack a sweatshirt, cover myself with sunscreen, or a combination of all 3 before I embark on my journey. However, the past weeks and even few months seem to change this mode of thinking. The weather has been more predictable than past years; it’s going to be hot and dry.

There has been a lot of buzz in the media lately about El Niño and the global heatwave this summer. This piqued my interest; I was curious if Colorado was experiencing the same trend locally compared to previous years’ temperatures. My mapping professional side couldn’t balk at the opportunity to create some maps that compare the summer temperatures over past years in hopes to find some obvious temperature-increasing trends.

Mapping Approach:

For this mapping project, I have decided to use Surfer to create contour maps of Colorado’s monthly average temperate in July over the past 7 years to determine if we are seeing the same heatwave trend locally as what is being reported globally. I was able to access data from the NOAA Climate Prediction Center for the maximum daily temperature for July from 2010 through 2016. I downloaded the daily data in TIF grid format and used Surfer’s Grid | Math functionality to combine all of the data into a single, monthly average for each year. The data was also converted from Fahrenheit to Celsius for easier interpretation. To do so I used these steps:

  1. After the data was downloaded, I opened Surfer 13 and clicked Grid | Math.
  2. In the Grid Math dialog, I clicked the Add Grids button.
  3. In the Open Grids dialog, I selected all of the daily temp TIFs and clicked Open.
  4. I used the following equation for the function, named the resulting grid, and clicked OK: (((A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+AA+AB)/28) * 1.8 ) + 32
  5. I repeated these steps to create average maximum temperature grids for the rest of the years of data I downloaded.

Results:

Now all of the daily data has been averaged over the month of July for their respective years, I can create contour maps in Surfer for comparison. I created a separate contour map for each year, using the same contour interval and color map so that the maps could be easily compared to one another. The maps were scaled the same and posted next to each other to see if Colorado is on the same track as the rest of the globe. The resulting contour maps are below, showing that the monthly average temperature from year-to-year varies, but it is difficult to isolate a spatial trend between the years. I definitely cannot tell that this July is hotter than any other of the years I downloaded data for.

Surfer 2D & 3D Mapping: contour map depicting average maximum temperaturesA comparison of Contour Maps from Surfer that depict the average maximum temperatures in Colorado for July 2010 - 2016.

Mapping Approach, Part 2:

Because I was not able to see a trend across Colorado for the past 7 years from the contour maps, I decided to take a look at the data from another perspective. I wanted to see if there were any spatial temperature trends by differencing the average maximum temperature for this July to the average maximum temperature for the previous 6 years. This can easily be done by, again, using Surfer’s Grid Math feature. The monthly average temperature data can be combined into a single grid that represents the average temperature for July over the previous 6 years. The difference between the July 2016 temperature data and the 6-year average temperature data can be found by subtracting the two grids from one another. This gives me a grid of the temperature departures in July 2016 from the average over the last 6 years that can be visualized using a contour map.

To create the average monthly temperature grids for the previous 6 years:

  1. I clicked Grid | Math.
  2. In the Grid Math dialog, I clicked the Add Grids button.
  3. In Open Grid dialog, I navigated to all of the monthly temp grids and clicked Open.
  4. In the Grid Math dialog, I used (A + B + C + D + E + F) / 6 for the function, named the Output Grid File, and click OK.

To difference the monthly average grid and the July 2016 temperature grid:

  1. I clicked Grid | Math.
  2. In the Grid Math dialog, I clicked the Add Grids button.
  3. In the Open Grids dialog, I navigated to the average July grid and clicked Open.
  4. I clicked the Add Grids button again.
  5. In the Open Grids dialog, I navigate to the 6-year average grid and clicked Open.
  6. I clicked Grid | Math.
  7. In the Function box I entered A- B, I named the Output Grid File, and clicked OK.

Results, Part 2:

A contour map was generated in Surfer that shows the temperature departures for this July compared to the previous 6-year average; shown below. This map shows that the temperature in July has remained relatively unchanged for most of the central mountain region (central portion of the map) and the only notable temperature increases are in the southwest portion and on the eastern planes of Colorado.

Surfer 2D & 3D mapping software: contour map showing temperature differencesA contour map showing the degree departure in July 2016 from a 6-year average of maximum temperatures in July in Colorado.

Wrap-up:

As you can see, utilizing the differencing technique from Surfer’s Grid Math feature proved to be a better analysis approach for determining what areas in Colorado are seeing the same heatwave trend that is being reported across the US and globally than comparing contour maps. Surfer is developed by Golden Software, please feel free to take a look at the free demo version and place your orders at http://shop.goldensoftware.com.

07 July 2016
Real Life Applications

The United Kingdom (UK) voted on the United Kingdom European Union membership referendum, commonly referred to as the Brexit vote, on June 23, 2016. This referendum was to gauge citizen support for whether or not to remain a member of the European Union (EU), an economic and political partnership involving 28 European countries. Overall, the UK voted 51.9% to leave the EU, with 71.8% turnout. The world reacted when the news was announced on June 24. I've spent the last two weeks reading about this historic vote and what it means for the people of the UK, the EU, and the rest of the globe. It has already had some effects on international economic markets. It remains to be determined how it will affect the future, but I find this to be a fascinating time for trade, politics, economics, and international relations.

The first thing that interested me was the demographic breakdown of the vote. Various exit and other polls were done with information about how different demographics voted. I sifted through the information available at Lord Ashcroft Polls, and noticed some clear correlations between education level and age and how an individual in the poll voted. Older voters, less educated voters, and less employed voters were more likely to vote to leave the EU. I wondered if those in less-than-ideal socioeconomic situations were looking for anything different that may help provide a higher quality of life. Another issue that caught my attention was when voters made their decisions. Nearly 25% of those polled made their decision within the week before casting their votes! Just over 1/3 always knew how they would vote. The remaining ~40% made their minds up in the last 6+ months. To me, this shows some uncertainty about how to vote or perhaps uncertainty about what the effects of the vote would be on the individual and UK.

demographics4.png

Graphs showing the Brexit vote according to age, education level, employment level, and when the vote was decided. All graphs created in Grapher 12.

Another interesting aftershock of the Brexit vote is the economic repercussions. The day that the results of the referendum vote were released, Britain's pound took a nosedive. The pound has seen a few small climb attempts since the announcement, but the value has remained relatively low. I've created two different visualizations of the same data below: a 3D ribbon graph and a temporal map. I used a process similar to one used by Surfer user Richard Koehler to create the temporal map, based on months rather than years as Richard’s maps are. In the 3D ribbon plot, the large drop around June 23 is very noticeable. Other smaller dips are also noticeable, as is the long term drop that has been occurring since December 2015, when the official documents enabling the referendum was announced. In the image map, it's easy to see how changes happened day by day over the entire course of the months since December. It's easy to see the color change that took place from December to January in the image map that correlates with a dip in the 3D ribbon graph, when these key documents were filed.

Changes in the value of the British pound, as compared to the US dollar. 3D ribbon graph created in Grapher 12; temporal image map created in Surfer 13.

Changes in the value of the British pound, as compared to the US dollar. 3D ribbon graph created in Grapher 12; temporal image map created in Surfer 13.

I'm still not sure I fully understand the extents of this referendum's global effects, but I am eager to watch what happens in the world over the next few years as the UK exits the EU. Will the UK vote again to confirm the referendum? Will the UK move forward to actually exit, following Article 50 of the Lisbon Treaty? Will other nations follow the UK in leaving the EU? Will the pound recover? Will Northern Ireland leave the UK and rejoin Ireland? Will Scotland leave the UK? What worldwide economic effects will come? How will trade be affected? These are historic times we live in, and I'm excited to see what happens next! What are your thoughts on the UK's Brexit vote?

Like the graphs and maps you see in this blog? Download the free Grapher 12 and Surfer 13 demos to start creating your visualizations today!

Subscribe To Our Blog

Most Popular

This week many users experienced a GsDraw error (1): GenericError. This error began occurring follow...
This week's new feature series is a tutorial on how to use the new coordinate system dialogs in MapV...
Over the years, one of the most common questions asked is “How can I get my contour map out of Surfe...

Exceeding expectations

Go to top