Kill your children LMAOOOO
---------- Post added at 01:42 PM ---------- Previous post was at 01:42 PM ----------
Kill your children LMAOOOO
Sounds like you forgot to bring your kneepads to your "job" today. Maybe that's why your so pissy. //content.invisioncic.com/y282845/emoticons/wink.gif.608e3ea05f1a9f98611af0861652f8fb.gif
Here's my sample code I promised you.
# Author: Guy with no job who hangs out on caraudio.com. Dedicated to TJwubs
# Description: Identify any Earthquake with a 4.5 or greater magnitude and export it to a feature layer.
# Version 1.0: Requires 4.5_day.csv file in workspace, editing workspace, and editing projection in make event layer
# Future Plans: Allow user defined magnitude selection, workspace, and projection.
# Integrate ability to create .csv file
# Add Tsunami Speed layer as base map layer for quick low tech calculations
# Import modules and definitions
# Sets up overall error check. "Something is wrong" is sent to console if main program fails to run
try:
import urllib2
import arcpy
from arcpy import env
# Defines environment settings
env.workspace = r"C:\Users\Souldrop\Desktop\Tsunami_project\Earthquake_Query"
env.overwriteOutput = True
# Opens up placeholder .csv file, clears content, and saves it
temp = open("4.5_day.csv", "w")
temp.truncate()
temp.close()
# Define url of livestream USGS data for 4.5 mag earthquake for past 24 hours
url = 'http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_day.csv'
# Opens and writes data to placeholder .csv file. Closes file after complete.
u = urllib2.urlopen(url)
instance_write = open('4.5_day.csv', 'w')
instance_write.write(u.read())
instance_write.close()
# Creates feature layer that shows location of the recorded earthquakes
arcpy.MakeXYEventLayer_management("4.5_day.csv", "longitude", "latitude", "4.5_day_Layer",
r"C:\Souldrop\Desktop\Tsunami_project\Earthquake_Query\WGS_1984.prj", "#")
# Saves the created layer to your workspace
arcpy.SaveToLayerFile_management("4.5_day_layer", "eq_Event.lyr")
# Sends the number of matching incidents to console
print arcpy.GetCount_management("4.5_day_layer")
# Error notifications; prints any arcpy error messages.
except:
print "Something is Wrong, because tjwubs is my hero"
print arcpy.GetMessages()