Posts

How to Pull a House Number Out of an Address

One of the most common tasks associated with addresses, is how to pull the house number out of an address. First, create a new field in your data.  Name it House_Number. Next, copy the parcel address into this new field. Then, if you haven't done so already, start an edit session. Open Field Calculator for House_Number.  Using VBA type:            split([field], " ")(0) This is telling the field to delete everything after the first space, giving you the house number. Happy GIS-ing! Lindsy Bentley

How to Create a 3D Surface

In my last post, I talked about going 3D with your GIS.  But how do you do it? Let's say you want to create a 3D surface and use it in a 3D scene online, and you have a Microstation XML in Utah State Plane Central Foot. Where do you start? Open a new Pro project.   First, you will convert the XML to a TIN. Convert TIN to Raster Change the sample distance to cell size  Sampling Value is 1 foot Optional - Mosaic to new Raster If you are working with multiple surfaces, it is easiest to mosaic them into one raster at this point. Doing this allows the remaining steps to be done on one raster, instead of multiple. Change the pixel type to 32 bit float to maintain the elevation. Define Projection Up to this point in the conversion process, it is finally time to tell the data where in the world it is located.  Use the Define Projection tool and set it to Utah State Plane Central Foot. Project Raster Since you will be using your 3D surface in an online map, conve

3D GIS

Image
There is a big push in the GIS world to go 3D.  But this is being met with quite the resistance.  The reasons I hear are that organizations don't have time, resources, the right programs, money, and the biggest reason, why? The conversion process can take a long time, but the results are incredible. The first time I was tasked with converting something to 3D, it was daunting.  Nobody had done it before.  There wasn't any documentation online about how to do so.  Tech support was no help. First, I started with LiDar points, and pulled out trees and buildings.  I spent 2 weeks learning how to change the roof types and directions, the tree heights and canopy spreads.  I felt like I was building a video game (does anyone remember Half Life?). I finally got it to work.  And I was proud of figuring it all out. A random engineer came to my desk to ask for a map.  He saw my screen and asked "What is that?"  I told him all about it.  How long it took and how difficul

Rename Sub Folders in A Directory With Python

Here's a little bit of code that renames sub folders in a directory with python. import os import os.path for (dirpath, dirnames, filenames) in os.walk(r'O:\!2016\your folder path here):     for idx in range(len(dirnames)):         print(dirnames[idx])         newname = dirnames[idx].split(' ')[0].upper() + " " + dirnames[idx].split(' ')[1].upper()         os.rename(os.path.join(dirpath, dirnames[idx]), os.path.join(dirpath, newname))         dirnames[idx] = newname

Harvey

My friend Harvey is retiring. I learned one of the most valuable GIS lessons of my career so far from Harvey. I met Harvey about a year into my GIS career.  Harvey was a cowboy fireman with the most impressive mustache.  He was in the office on light duty following a surgery. We were paired up to work on a few projects together, creating spreadsheets and maps. Harvey has bad eye sight.  The mapbook I made for the fire department had 27 pages covering the city.  But Harvey couldn't see it and would throw the mapbook at someone else to look at it while on their way to a call.  For Christmas later that year, we made Harvey his own special mapbook, with 108 pages covering the city.  He chuckled.  And used it. To this day, every map I make, I make with Harvey in mind.  Harvey is an old soul that doesn't like computers.  He has no use for complex maps.  While GIS is complex and ever-growing, I try to make every map a map that Harvey will understand.  It is easy for us GIS-e

Sequential Numbers

In ArcMap, here is how you can calculate sequential numbers using Field Calculator. Set field calculate to python. Paste this in pre logic script: rec=0 def autoIncrement():  global rec  pStart = 1   pInterval = 1  if (rec == 0):    rec = pStart   else:    rec += pInterval   return rec Paste this in second box autoIncrement() Check out one of my other posts about how to Convert from Degrees Minutes Seconds to Decimal Degrees in Python here . Happy GISing! Lindsy Hales Bentley

How to pull numbers out of a string

Here’s a little function to pull numbers out of a string. import re def calculate(value):   newVal = re.sub("[^0-9]", "", value)   if newVal == "":     return 0   elif newVal is None:     return 0   else:     return newVal calculate( !Size! ) Happy GISing! Lindsy Hales Bentley