Sunday, September 25, 2016

Special Topics: Lab 5

Lab 5 covers Vehicle Routing Problem and how adjusting setting and routes, it impacts how many stops and routes will be produced.  To start the analysis, I added the customer information for the orders.  I adjusted the parameters for pick up times and other parameters.  Next I added the distribution center for the depot.  I set the parameters for when the depot can be stopped at.

Next I added the routes I loaded the truck information.  For the route properties, I adjusted when the route can start, the cost per mile and cost per minute, assignment rules, and the maximum capacity.  I added route zones and adjusted the parameter to True so routes stay to the correct zone.  U-turns were also not allowed for the routes.

Finally, I ran the Solver and 6 orders were not reached.  To fix this, I adjusted the properties for Truck 15 and 16 to "include" the assignment rule.  Previously, they were set to exclude which meant forced the routes to only pick up orders assigned to that truck.

After adding the new routes, below is a screenshot of the new routes which services all orders.  Only one exceeds the time limit.  Customer service will increase since every order is taken care of and only one time violation.
Improved Routes

Sunday, September 18, 2016

Special Topics: Lab 4

This week's lab looked at create new network datasets and adjusting the analysis settings.  I created a network dataset that used streets as the participating feature class.  I selected to model turns, but did not use restricted turns.  I used elevation fields, but did not select to use traffic modeling.  Once all the settings were adjusted, I built the network dataset.

In ArcMap, I added the recently created network dataset.  I enabled the network analysis and created a new route.  To create the route, I had to load the facilities for the stops.  The impedance was set to minutes and the stops were able to be reordered to find the fastest route.  However, the first and last stop had to remain the same.  The only restriction was one ways.

Next, I added the restricted turns to the Turn settings and rebuilt the network dataset.  In ArcMap, I added the streets and restricted turns layers.  I used the same network analysis setting as previously, and resolved the route.  By adding restricted turns, the route has to adjust slightly to find a new route.

Restricted Turns

The final route analysis required to build a new network analysis.  This time, I used traffic modeling.  I made sure to adjust all of the traffic settings.  The traffic data looked at speeds, and level of traffic.  It contains the free-flow speeds. The network analysis settings were the same was the other two routes.  With adding traffic information the route is adjusted to traffic speeds.  Previously, that information was not included in the travel time.
Traffic Data

Sunday, September 11, 2016

Special Topics: Lab 3

This week's lab focused on analyzing the completeness of road networks.  I compared how complete the street centerlines and TIGER roads are for Jackson County.  Below is how I performed this analysis.

I needed to calculate the distance of the roads for both shapefiles.  I did this by adding a field and used Calculate Geometry.  This calculated the distance of each road segment in kilometers.  Next, I needed to find the roads that fall within the Grid shapefile.  To do this, I used the intersect tool to create a new shapefile that had all the road segments that intersect with the grids.  I used the tool on both the street centerlines and TIGER roads.

Once I had the new shapefiles of roads only within the grids, I had to recalculate the distance of the roads.  I used the calculate geometry tool again.  I then exported each attribute table of the new distance.  I found the difference between the length of road and also found the percentage.  Below is a table.



The map below shows the absolute difference between the roads completeness.  
Road Completeness Analysis

Sunday, September 4, 2016

Special Topics: Lab 2

Lab 2 covered the National Standard for Spatial Data Accuracy.  The lab looked at junction points for two data sets.  To perform this lab, I needed to create two new Data set Networks for the street shapefiles.  I selected over 85 points of the junction shapefile for the city and over 85 for the USA street shapefile.

After selecting the points, I exported the points into new shapefiles.  I then added orthophotos to see where the true intersections are located.  Zooming into each pair a test points, I found the true location and added a reference point.  I did that for all points.  A unique identifier was applied to all three data sets.  I used the Add X Y Coordinates to the attribute tables.

I exported the attribute tables for the three shape files and inserted the data into the Horizontal Accuracy spreadsheet.  This spreadsheet found the difference between the X and Y coordinates.  The differences were squared and summed.  The Root Square Mean Error was also calculated and multiplied by 1.7308 for the standard error.  This was done for the city data points and the street data points.

City:
Positional Accuracy: Using the National Standard for Spatial Data Accuracy, tested 30.64 feet horizontal accuracy at 95% confidence level.
USA Street:
Positional Accuracy: Using the National Standard for Spatial Data Accuracy, test 62.67 feet horizontal accuracy at 95% confidence level.
Test Points

Sunday, August 28, 2016

Special Topics Lab 1

This week's lab covers the precision and accuracy.  The first part looked at the precision and accuracy of a GPS unit.  A point was observed and mapped 50 times using the GPS devise.  To determine how accurate or precise the observations were, the average X and Y coordinates were found and a point added.  I performed a buffer around the average point for 1, 2, and 5 meters.

I did a spatial join with the average point and the 50 observation points to find the distance of each point to the average point.  I then found the distance for 50%, 68%, and 95% of the points.  I also then determined the average elevation and found the absolute difference of the average point to the observed points.  Below are the results, along with a map showing the average point and the observed points.

The reference point of the actual location was added to the map.  To see how accurate the average point was, I measured the distance from the reference point to the average point.  I did the same for elevation as well.  This was done to determine how accurate the average point is.  The average point was within 3 meters of the reference point and the elevation was within 6 meters.

The reference point and the average point differ by quite a bit.  The longitude and latitude is off by 3.8 meters from the reference point to the average.  The horizontal precision was 4.4 so it was greater than the true difference.  The elevation is off by 6 meters while the precision showed 3 meters.  Even though 4 meters is not a lot, depending on the need of knowing this location, it can be huge.  GPS units can only be so accurate and the unit puts the point fairly close to the true position.

The horizontal accuracy was 3.8 meters.  This is better than the horizontal precision.  The vertical accuracy is 6 meters which is worse than the vertical precision of 3 meters.  There was no evidence of bias in the results.

The second part of the lab covered calculating the Root Mean Square Error, mean, median, the percentiles, min and max values.  I then used the XY errors to plot a CDF chart.  I compared the chart to the metrics I calculated.  From looking at the chart, it is clear to see certain metrics like the percentiles or the min and maximum number.

Monday, August 1, 2016

Programming: Module 11

This weeks lab covered how to share tools.  First I looked into the script that was provided for the lab.  I then looked at the properties of the script tool.  I adjusted the script itself to use sys.argv[] to use for the file path.  This allowed for me to use the parameter number in the properties setting.

Before sharing the tool, I updated the item description for the tool.  I filled in dialog for all the parameters.  I then right clicked on the script tool and imported the script.  I then right clicked and selected Password. This allows for the tool to be shared.

Parameters

Map Results

Dialog Box


This class definitely took me out of my comfort zone.  Python was very new to me and I was very eager to learn.  I am a very literal person and figuring out how to adjust SearchCursor and for loops was very challenging for me.  However, figuring out each assignment gave me more satisfaction when I was able to figure out the assignment.

Module 7 required the use of Search Cursor, Update Cursor, and Insert Cursor.  This lab seemed to be the most difficult.  Learning how to use each cursor and adjust it for the lab assignment was a difficult task.  However, after figuring it out, I was better able to see how powerful script writing can be.  It made me more determined to really work to understand what each code is doing.

Being able to use code to access attribute tables and create dictionaries is something I can apply to my job.  I work with a lot of data and being able to grab certain data quickly or update it using scripts would be great.


Tuesday, July 26, 2016

Programming: Module 10

This week's lab required me to create a toolbox and script to share for another user.  Standalone scripts are great tools, but creating a script tool has even more benefits.  Script tools are easy to share, a user doesn't need to know how to use Python, and it includes a dialog box.

The screenshot below shows the results of the script tool window that is created through this lab.  To do this, I added a toolbox to my Module 10 folder.  I then added a script to the tool box and made sure "Store relative path names" was checked.  I selected an already created script foe the Script File.  Next, I added four parameters to the script tool.  I adjusted the data type and properties and set the input and output file location.  When I open the tool, the window below opens.

Tool Options
The next step in the lab was to adjust the parameters in the standalone script.  I replaced the filenames and file paths with arcpy.GetParameter().  The parameters correspond to the order I added int he script properties.  In order to run the script without an error, I had to add str() to the output folder.  Then I ran the tool with the clip boundary of Durango.shp and selected the four input features.  To print statements in the dialog box, I had to adjust the standalone script again.  I changed the print command to arcpy.AddMessage().  Results are below.

Dialog Box
To share the script, I compressed the toolbox and the standalone script.
Flowchart