GIS Stack Exchange is a website where you can post questions about GIS to fellow GIS professionals, and get answers. It was a great way to help each other out, and pass on the little nuggets of wisdom that you have gained throughout your career. They can be questions about any topic or any software. You can tag your questions with their related topics, and be notified if anyone answers, or asks clarifying questions. Your thread can turn into a discussion with lots of ideas.
So, if you are looking for a way to pass on everything you have learned along the way, this a great place to do so, while also helping people out.
Happy GIS-ing!
Lindsy Hales Bentley
Thursday, June 7, 2018
Thursday, May 31, 2018
How to Calculate RGB Percent Using Python
I was working on a project recently, where marketing needed varying shades of the same color for an online map. So, my boss and I wrote a python script that will give the RGB numbers for your input.
Using PyScriptor, this was my code:
def main():
pass
if __name__ == '__main__':
main()
import numpy as np
import arcpy
#This script will calculate a percentage of a RGB color.
red = arcpy.GetParameterAsText(0)
green = arcpy.GetParameterAsText(1)
blue = arcpy.GetParameterAsText(2)
percent = arcpy.GetParameterAsText(3)
rgb = [int(red),int(green),int(blue)]
pct = float(percent)
def lighter(color, percent):
'''assumes color is rgb between (0, 0, 0) and (255, 255, 255)'''
color = np.array(color)
white = np.array([255, 255, 255])
vector = white-color
return color + vector * percent
arcpy.AddMessage(lighter(rgb, pct))
Using PyScriptor, this was my code:
def main():
pass
if __name__ == '__main__':
main()
import numpy as np
import arcpy
#This script will calculate a percentage of a RGB color.
red = arcpy.GetParameterAsText(0)
green = arcpy.GetParameterAsText(1)
blue = arcpy.GetParameterAsText(2)
percent = arcpy.GetParameterAsText(3)
rgb = [int(red),int(green),int(blue)]
pct = float(percent)
def lighter(color, percent):
'''assumes color is rgb between (0, 0, 0) and (255, 255, 255)'''
color = np.array(color)
white = np.array([255, 255, 255])
vector = white-color
return color + vector * percent
arcpy.AddMessage(lighter(rgb, pct))
Load this script into your ArcToolbox in ArcMap, and then it can be used in any mxd. When running, it will ask for your RGB and the percent that you want.
Here is a post about how to calculate sequential numbers in ArcMap using Field Calculator.
Here is a post about how to calculate sequential numbers in ArcMap using Field Calculator.
Happy GISing!
Lindsy Hales Bentley
Wednesday, May 23, 2018
Converting Microstation DTM into a GIS Surface
Here is how to convert a Microstation DTM into a GIS surface.
- Open a new blank .dgn. Make sure to use the default 3d seed file from ESRI. Set the coordinate system (If a dialog box pops up asking if you want to change units, do so).
- In the dgn, select the window tab and show the InRoads Explorer window.
- In the Inroads Explorer window Select File, Open, select the .dtm, and select open. The open window will stay open, you need to hit close after the dtm has been loaded.
- Highlight the imported .dtm and select the Surface tab. Inside the surface tab, select view surface tab, and then select surface elevations.
- In the surface elevation window, deselect elevation, and double click points. Make sure points come across with a text font.
- Save settings and then save the dgn.
- Run the “CAD to Geodatabase” tool in ArcMap or Pro. Select the dgn that you saved. Assign the coordinate system in the tool. Run.
- The feature class created is an annotation feature class. Use the “Feature to Point” tool to convert to a point feature.
- Double check to make sure elevation came across in attribute table.
- Run the “Natural Neighbor” tool found in the spatial analyst toolbox, sub toolbox Interpolation. Use the point feature class, using the elevation field to calculate.
Here is another post I wrote about Model Builder.
Happy GISing!
Lindsy Hales Bentley
Lindsy Hales Bentley
Thursday, April 26, 2018
My first UGIC Conference
In preparation for the upcoming UGIC Conference, I've been thinking about how awesome of a conference this is. It is a conference for GIS professionals in the state of Utah. UGIC stands for Utah Geographic Information Council. Horrocks Engineers has a large GIS staff and rotates who attends each conference each year.
The first UGIC Conference I attended was held in Cedar City. I was a year and a half into my career. I was instantly welcomed by the members of the UGIC Council at the time, and ran around with them for the week, attending classes and social events.
I remember a bunch of us went out in the desert to Lions Head, to look at hieroglyphics. They were amazing. We studied them, wondering what the people that put them there wanted us to know. One of my colleagues did the entire hike on crutches with a broken leg. Now that's a trooper. I remember watching the sun set into the red and green hills. On another day, my coworker and I ditched the late afternoon classes to go to Grafton, a ghost town where we had discovered we had a common ancestor buried in the cemetery there (good ol' polygamy).
GIS conferences (like UGIC) are great for many reasons. The first being, meeting people in the same field as you and building relationships to work together through the upcoming years. A very close second, is the non-existent lines to the women's bathrooms. I still love walking past a very long men's line, and jet right in and out of the women's side with no delays. The third greatest thing about GIS Conferences, is learning from my peers. I love to see how everyone utilizes GIS in their agency, and why it is important to them. I have always believed that GIS is limited by our own imaginations, and I love seeing other people's imagination in their work.
Happy GIS-ing!
Lindsy Hales Bentley
The first UGIC Conference I attended was held in Cedar City. I was a year and a half into my career. I was instantly welcomed by the members of the UGIC Council at the time, and ran around with them for the week, attending classes and social events.
I remember a bunch of us went out in the desert to Lions Head, to look at hieroglyphics. They were amazing. We studied them, wondering what the people that put them there wanted us to know. One of my colleagues did the entire hike on crutches with a broken leg. Now that's a trooper. I remember watching the sun set into the red and green hills. On another day, my coworker and I ditched the late afternoon classes to go to Grafton, a ghost town where we had discovered we had a common ancestor buried in the cemetery there (good ol' polygamy).
GIS conferences (like UGIC) are great for many reasons. The first being, meeting people in the same field as you and building relationships to work together through the upcoming years. A very close second, is the non-existent lines to the women's bathrooms. I still love walking past a very long men's line, and jet right in and out of the women's side with no delays. The third greatest thing about GIS Conferences, is learning from my peers. I love to see how everyone utilizes GIS in their agency, and why it is important to them. I have always believed that GIS is limited by our own imaginations, and I love seeing other people's imagination in their work.
Happy GIS-ing!
Lindsy Hales Bentley
Subscribe to:
Posts (Atom)