Posts

Showing posts from 2015

Italy Map Journal

New and Improved Italian Story Map Original Map Journal

Optimize Your MXDs

MXD Perfstat is a great utility to analyze your GIS MXD files. The output contains information such as the number of layers, vertex count per layer per different scales, drawing times, etc. This information is valuable for those who wish to publish data via ArcGIS Online or ArcGIS Server. I used the option to write to a database. Within a database environment I can setup queries, procedures, and eventually charts or reports. Link to download MXD Perfstat

Creating Polygons from Raster Extents

There are many like it, but this one is mine. Catch that reference? OK, so here is a script that will allow the user to select a folder directory. The script will scan the directory for any raster files. It will grab the extents of the raster and build a polygon feature class. When building a mosaic I like to also know the compression type, number of bands, no data value, pixel type, etc. Those options will also be added to the polygon per raster tile. Quick note, I wrote this with the idea that a person could add this script to their toolbox to have a nice GUI interface. The only parameter required is the input file path. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 # Name: Raster Extents to Polygons # Purpose: This script will create a polygon f

Jupiter & Venus Conjuction 2015

Image
Look what Leo is chasing; Jupiter and Venus. Look up and towards the West to find two of the brightest objects in our night skies crossing paths.

Add Field to a SQL Geodatabase using T-SQL

Image
Sometimes a new field will need to be added quickly. The usual process of testing changes and pushing said changes to production is not very time sensitive. Here is a method I use when a new field is needed ASAP. In this case the feature classes have been registered in the geodatabase and archiving has been enabled. This means there is an SDE base table and several SDE delta tables. The information needed to proceed is listed below. This will require DBO level access and SQL Server Management Studio or other suitable RDBMS interface like Toad. Database Name = DemoData New Field Name = NewField New Field Type (Length) = string(50) / nvarchar(50) SDE Field Type Code =   Unknown New Field Name = NewField Feature Class Name = Marker Base Table Name = Marker Base Table ID = Unknown Delta Table (Adds) = Unknown Delta Table (Archive) = Unknown First thing to do is find the unknown values. The SDE Field Type Code via Esri tells us that the SDE Field Type Code for String i

Using MS Date Styles for Python

I began scripting with Python to automate nightly routines. After time many of my scripts would include similar variables such as date/time formatting.  For log files I usually apply this format: Sample output: RoutineLog_20150622.log Date Format: yyyymmdd For an email body I usually apply this format: Sample: "The routine succeeded June 22, 2015 02:10PM." Date Format: Mon dd yyyy hh:mm AM/PM Although I tend to apply similar formatting, I noticed different naming conventions as more and more scripts were written. Python Script A would call it datetime while script B called it ShortDate. dateTime1 = time.strftime("%Y%m%d") #yyyymmdd dateTime2 = time.strftime ("%b %d %Y %I:%M%p") I like standards and remembered that Microsoft (MS) has datetime style codes. This is what I now reference when setting date time formatting variables. https://msdn.microsoft.com/en-us/library/ms187928.aspx Although, MS does not account for each and every styl