GIS Stuff and Rocky Road Take Two!

To start today’s post, I thought I would put on some stuff that you can do with ArcGIS that new or occasional users of GIS may not know how to do. I think these things are buried within the help files somewhere but to make it easier for you. I have put it here.



Adding the x,y coordinates of the centroid of a polygon layer to a new field

  1. Click Editor on the Editor toolbar and click Start Editing.
  2. You can make calculations without being in an editing session; however, in that case, there is no way to undo the results.
  3. Right-click the layer you want to edit and click Open Attribute Table.
  4. Right-click the field heading for the X field and click Calculate Values.
  5. If there is no field for X values, you can add a new field for X by clicking the Options button and selecting Add Field. However, to add a new field, you need to exit the editing session.
  6. Check Advanced.
  7. Type the following VBA (Visual Basic) statement in the first text box



Dim dblX As Double


Dim pArea As IArea

Set pArea = [Shape]

dblX = pArea.Centroid.X

8. Type the variable dblX in the text box directly under the X field name. Click OK.

9. Right-click the field heading for the Y field and click Calculate Values. If there is no field for Y values, you can add a new field for Y by clicking the Options button and selecting Add Field. However, to add a new field you need to exit the editing session.

10. Click Calculate Values. Check Advanced.

Type the following VBA statement in the first text box:



Dim dblY As Double


Dim pArea As IArea

Set pArea = [Shape]

dblY = pArea.Centroid.Y



11. Type the variable dblY in the text box directly under the Y field name.
Click OK.



Please note: The property for X and Y returns a field type of double. For best results, your X and Y fields should also be a double field type

Calculating area for polygons

Creating an “area” field in your attribute table if you don’t already have one

If your attribute table does not already have an “area” field, you need to create one before doing the area calculations. You can create the new field in ArcCatalog or ArcMap. Note you can add an acres field using these same directions.

To create a new attribute field for “area” in ArcMap, follow these directions – note you cannot be in an editing session to do this (don’t ask me why):

1. Open the layer’s attribute table in ArcMap

2. Click on the Options tab

3. Choose Add Field

4. Name it Area

5. For Type, choose Double

6. Don’t put anything under Precision or Scale.

7. Click OK

Calculating area for polygons

1. Open the attribute table of the layer you want to edit.

2. Right-click the field heading for area (if there is no field for area values, you can add a new field for area by clicking the Options button and selecting the new field option).

3. Click Calculate Values.

4. Checkmark the Advanced box (this is important – dont’ forget this!)

5. Type the following VBA statement in the first text box (you should be able to copy and paste):



Dim dblArea as double

Dim pArea as IArea

Set pArea = [shape]

dblArea = pArea.area

6. Type the variable dblArea in the second text box (near the bottom of the dialog box) directly under the area field name.

7. Click OK.

I hope that they will help someone in learning GIS. Anyway, my previous post was when I revealed my Rocky Road recipe, that I adapted from Nigella Lawson. I discussed the recipe on Twitter with @geokaren and she suggested that it could be turned into an Ice Cream. I had never thought of this before. I have now had a chance to think about it and I can suggest two ways of making Rocky Road Ice Cream. I have not had chance to try these out myself yet so if you have a go, please let me know how you get on.

Version 1: Lazy Rocky Road Ice Cream

Ingredients

Very good chocolate ice cream, such as Carte D’or

Mini marshmallows

digestive biscuits, bashed up into bits

chocolate sauce, to serve

Method

Take ice cream out of freezer, allow to melt slightly. Add marshmallows and digestives biscuits. Either refreeze or serve immediately in bowls, with chocolate sauce over the top. Easy!

Version 2: Proper Rocky Road Ice Cream

Ingredients

2 oz (1/3 cup) chocolate

1/3 cup cocoa powder

1 1/2 cups milk

2 large eggs

1 cup granulated sugar

1 cup heavy cream

1 tsp vanilla extract

1/3 cup digestive biscuits, bashed up in bits

1/4 cup chocolate chunks or chocolate chips

2/3 cup mini marshmallows

Method

  1. Melt chocolate in a double boiler.
  2. Slowly add cocoa powder, stirring until smooth.
  3. Using a whisk, stir in milk. Stir until mixture is blended and smooth.
  4. Remove from heat. Cool.
  5. Meanwhile, beat eggs 1-2 minutes until they are light and fluffy.
  6. Gradually stir in sugar and whisk for 1 minute.
  7. Add heavy cream and vanilla extract.
  8. Stir in cooled chocolate mixture.
  9. Chill 1-2 hours until cold.
  10. Pour this mixture into your ice cream maker.
  11. Churn for 20-25 minutes or according to manufacturer’s instructions.
  12. Add digestive biscuits and chocolate chunks.
  13. Churn 5 more minutes.
  14. Remove from ice cream maker and place in a storage container.
  15. Stir in marshmallows immediately.
  16. Enjoy your home-made ice cream!



If you do not have an ice cream maker (I don’t), follow the recipe until step 8. Then, put mix in freezer for 1-2 hours to chill. After 1-2 hours the ice cream will not be completely frozen. Stir in the marshmallows, digestive biscuits and chocolate chunks. Allow to freeze for an hour or two more and then serve and enjoy!

Version 2 recipe is adapted from here.

I forgot to mention in my GIS section above, that there is a place where you can find lots of GIS professionals who can give you advice and help. This place is The GIS Forum. Please check it out. It is run by some very nice people.

That’s all for today folks!

Happy Cooking or Geospatialing!

Jo

PS: Sorry for any weird changes in font. I am still getting used to HTML!


var addthis_pub=”jo6789″;

Bookmark and Share


Related Posts Plugin for WordPress, Blogger...

2 Responses to GIS Stuff and Rocky Road Take Two!

  1. Or you can use the .cal files…
    http://www.ian-ko.com/downloads/EasyCalculate/EasyCalculate50.zip
    (too many too list)
    Credit to Ianko
    http://www.ian-ko.com/
    EasyCalculate

    Which Polygon Centroid is that? Gravity or Label (Inside) – Gravity can be outside the polygon!

    Mapperz
    http://mapperz.blogspot.com/

  2. The centroid is inside the polygon (label). I did not know about EasyCalculate.

    Many Thanks for your comment

    Jo

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *

CommentLuv badge