The complete blood count (CBC) with 5-part differential counts red blood cells (RBCs), white blood cells (WBCs) and platelets; measures hemoglobin; estimates the red cells’ volume and sorts the WBCs into subtypes. A CBC is a routine blood test used to evaluate your overall health and detect a wide range of disorders, including anemia, infection, and leukemia.
These data will be used to estimate deficiencies and toxicities of specific nutrients in the population and subgroups, to provide population reference data, and to estimate the contribution of diet, supplements, and other factors to whole blood levels of nutrients. Data will be used for research to further define nutrient requirements as well as optimal levels for disease prevention and health promotion.
Examined participants aged 1 year and over were eligible.
Refer to the Laboratory Method Files section for a detailed description of the laboratory methods used.
There were no changes to the lab method, lab equipment, or lab site for this component in the NHANES 2015-2016 cycle.
Complete Blood Count with 5-Part Differential in Whole Blood (September 2017)
Whole blood samples are analyzed on the NHANES MEC.
Detailed instructions on specimen collection and processing are discussed in the NHANES Laboratory Procedures Manual (LPM).
The NHANES quality assurance and quality control (QA/QC) protocols meet the 1988 Clinical Laboratory Improvement Act mandates. Detailed QA/QC instructions are discussed in the NHANES LPM.
Mobile Examination Centers (MECs)
Laboratory team performance is monitored using several techniques. NCHS and contract consultants use a structured competency assessment evaluation during visits to evaluate both the quality of the laboratory work and the quality-control procedures. Each laboratory staff member is observed for equipment operation, specimen collection and preparation; testing procedures and constructive feedback are given to each staff member. Formal retraining sessions are conducted annually to ensure that required skill levels were maintained.
Analytical Laboratories
NHANES uses several methods to monitor the quality of the analyses performed by the NHANES laboratories. In the MEC, the CBC results are measured in duplicate and averaged. The averaged results are reported to participant and released in this dataset.
NCHS developed and distributed a quality control protocol for all CDC and contract laboratories, which outlined the use of Westgard rules (Westgard, et al. 1981) when running NHANES specimens. Progress reports containing any problems encountered during the analysis of the specimens, summary statistics for each control pool, QC graphs, instrument calibration, reagents, and any special considerations are submitted to NCHS quarterly. The reports are reviewed for trends or shifts in the data.
All QC procedures recommended by the manufacturers were followed. Reported results for all assays meet NHANES quality control and quality assurance performance criteria for accuracy and precision, similar to the Westgard rules.
The data were reviewed. Incomplete data or improbable values were sent to the performing laboratory for confirmation.
Five derived variables were created in this data file. The variables were created using the following formulas:
LBDLYMNO = LBXWBCSI * LBXLYPCT/100 (round to 1 decimal)
LBDMONO = LBXWBCSI * LBXMOPCT/100 (round to 1 decimal)
LBDNENO = LBXWBCSI * LBXNEPCT /100 (round to 1 decimal)
LBDEONO = LBXWBCSI * LBXEOPCT/100 (round to 1 decimal)
LBDBANO = LBXWBCSI * LBXBAPCT/100 (round to 1 decimal)
Refer to the 2015-2016 Laboratory Data Overview for general information on NHANES laboratory data.
Demographic and Other Related Variables
The analysis of NHANES 2015-2016 laboratory data must be conducted using the appropriate survey design and demographic variables. The NHANES 2015-2016 Demographics File contains demographic data, health indicators, and other related information collected during household interviews as well as the sample design variables. The recommended procedure for variance estimation requires use of stratum and PSU variables (SDMVSTRA and SDMVPSU, respectively) in the demographic file.
The Fasting Questionnaire File includes auxiliary information, such as fasting status, the length of fast and the time of venipuncture.
The detection limits were constant for all of the analytes in the data set. None of the results were below the limits of detection.This laboratory data file can be linked to the other NHANES data files using the unique survey participant identifier (i.e., SEQN).
Detection Limits
|
Variable Name |
SAS Label |
LLOD |
ULOD |
Range |
|
LBXWBCSI |
White blood cell count |
0.050 |
400.000 |
x 103 cells/uL |
|
LBXLYPCT |
Lymphocyte percent |
0.00 |
100.00 |
% |
|
LBXMOPCT |
Monocyte percent |
0.00 |
100.00 |
% |
|
LBXNEPCT |
Segmented neutrophils percent |
0.00 |
100.00 |
% |
|
LBXEOPCT |
Eosinophils percent |
0.00 |
100.00 |
% |
|
LBXBAPCT |
Basophils percent |
0.00 |
100.00 |
% |
|
LBXRBCSI |
Red blood cell count |
0.005 |
8.5 |
x 106 cells/uL |
|
LBXHGB |
Hemoglobin |
0.10 |
25.50 |
g/dL |
|
LBXMCVSI |
Mean cell volume |
50.00 |
150.00 |
fL |
|
LBXRDW |
Red cell distribution width |
10.00 |
40.00 |
% |
|
LBXPLTSI |
Platelet count |
3.0 |
3000.0 |
x 103 cells/uL |
|
LBXMPSI |
Mean platelet volume |
5.00 |
25.00 |
fL |
Please refer to the NHANES Analytic Guidelines and the on-line NHANES Tutorial for further details on the use of sample weights and other analytic issues.
.
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 1.4 to 117.2 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 3.7 to 94.5 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 1.4 to 29.3 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 3.6 to 93.2 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0 to 32.2 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0.1 to 4 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0.2 to 110.8 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0.1 to 2.6 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0.3 to 19.4 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0 to 4.5 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0 to 0.3 | Range of Values | 8116 | 8116 | |
| . | Missing | 1049 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 2.52 to 7.9 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 6.2 to 19.2 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 21.8 to 59.1 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 50.8 to 115.6 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 13.8 to 38.5 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| . | Missing | 9165 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 11.5 to 26.4 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 14 to 777 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 5.6 to 15.1 | Range of Values | 8117 | 8117 | |
| . | Missing | 1048 | 9165 |


Jacqui's Flower Shop
Load
Tab 1
Tab 2
Tab 3
Ajax Content
This is the content for tab 1
This is the content for tab 2
This is the content for tab 3


Hi, I'm Andrea Dal Ponte
...and I'm a full stack web developer specialized in Ruby on Rails and EmberJS
I’m a full stack web developer based in Vicenza (Italy) with a deep love for open source software development. Passionate about finding simple and elegant solutions to important problems with Ruby on Rails and EmberJS.
I believe in simplicity and I strive for tested clean code, through Test Drive Development, following the best practice and patterns like the Sandi Metz’ Rules For Developers.
In my spare time I love learning new technologies and collaborating with open source communities to build awesome software. Sometimes… when I don’t code, I like listening good music, going trekking, travelling around the world and playing my bass guitar.
_Specialties and methodologies
I’m in love with: Ruby on Rails, Sinatra, Git, JavaScript, CoffeeScript, HTML5, EmberJS, ReactJS, Redis, PostgreSQL, MySQL, Test Driven Development with libraries such as Cucumber and RSpec, Lean/Agile Software Development and Multitenant applications.
But I also worked with PHP using many frameworks such as CakePHP and CodeIgniter, MongoDB, AngularJS, Objective-C, ASP, SpreeCommerce and more.
_Technical skills
Server side development
Ruby on Rails, Sinatra, CakePHP, Code Igniter
Client side development
EmberJS, ReactJS, AngularJS, Handlebar, Emblem, jQuery
Database
PostgreSQL, Redis, MySQL, MongoDB
Frontend
HTML5, CSS3, JavaScript, CoffeeScript, Sass, Haml, Less, Bootstrap, Foundation
Test driver development
Rspec, Capybara, Gherkin/Cucumber, Jasmine, Gitlab CI, Travis CI
Server and DevOps
GNU/Linux Servers (usually Debian based), Chef, NGINX, Apache, Unicorn, Puma, Passenger, Capistrano
_Work experience
Digital Craftsman & Consultant
Freelance – May 2015 to Present
Ruby on Rails and EmberJS developer, teacher and consultant.
I develop and maintain custom applications for small and large enterprise companies with Agile methodologies.
Full stack web developer
PitchTarget - H-Farm – January 2015 to May 2015
Ember.js and Ruby on Rails developer
Señor software developer
Develon S.r.l. – April 2012 to December 2014
Full stack web developer handle all aspects the web applications creation process. Ruby On Rails, HTML5, CSS3, jQuery, Responsive and Mobile web applications develop.
Software Consultant
Tactical People S.r.l. – October 2010 to April 2012 (1 year 7 months)
Ruby on Rails and PHP consultant.
Web Developer and SEO
Terralink S.r.l. – October 2007 to November 2010 (3 years 2 months)
- Web applications and Content Management Systems (CMS) development with Ruby on Rails and CakePHP.
- Maintainance of Microsoft ASP applications.
- GNU/Linux server administration.
- Development of AdWords tools to manage advertising campaigns of Terralink.
- Maintenance and development of the internal CRM system.
- Search Engine Optimization (SEO).
_Contacts
Email<EMAIL_ADDRESS>Skype: andrea.dalponte
Telephone: +39<PHONE_NUMBER>


The fight for profits from bitumen, said to come from the “bottom of the barrel” because of its weight, has been driven by fundamental changes in the market. Supply has dropped as aging refineries in Europe and the U.S. are closed or converted, while road construction in Asia and Africa has pushed up consumption. That’s created demand for massive oceangoing tankers that keep the material heated.
The supply disruptions that helped lift crude above $50 in recent months are fading. Oil-sands producers in Canada have restored most of the output halted when wildfires menaced facilities in May and curbed more than 1 million barrels a day, or about 40 percent of supplies. OPEC member Nigeria revived some output in June after militant attacks cut production to a three-decade low, the IEA said
It’s not only the production of crude oil that has analysts concerned. There is an “epic overhang” of gasoline after refiners built up stockpiles of the fuel at the beginning of the year when crude was cheap, said Amrita Sen, chief oil analyst at London-based consultants Energy Aspects Ltd. Still, she said a drop to as low as $40 a barrel is unlikely unless there’s significant selling by speculative investors.


Algebra! is an interactive learning portal for students and math enthusiasts studying algebra. The site keeps track of user statistics and allows users to input and manipulate algebraic equations.
Sugar Rush is a dessert delivery app written with the ExpressJS framework. Hungry Angelenos can order dessert items from popular restaurants and have them delivered in minutes.
Created with Fran Budiman, Thomas Choi, Gamaur Landrum, Edward Yu
Politate is a Ruby on Rails application with the goal of improving political transparity. Users can post transcripts of political event and annotate statemtents with comments and citations.
Carmen Sandiego is a clone of the popular edutainment game "Where in the World is Carmen Sandiego", written entirely in Javascript and CSS/HTML. Novice detectives can travel the world searching for clues off the identity of international criminals.
Give is a donation and pulic interest awareness website and was the winning submission in General Assembly's 2016 Martin Luther King Day Hackathon.
Created with Crystal Chen, Caroline Grudel, John Kwak, Roberto Plascencia
Tic Tac Toe is my version of the popular children's game, written entirely in HTML, CSS, and Javascript (withouth jQuery). You can play against a friend, or try to take on one of the three computer opponents coded into the program.


A Marriage Day Tribute
Home
About Me
Happy 22nd Marriage Day
form Harsha and Sai !!
A small test for you
A small Video from us


News Paper Article Search
Home
(current)
NewYorkTimes
Github
New York Times Search
Search Parameters
Search Term:
Number of Records to Retrieve:
1
5
10
25
Start Year (Optional):
End Year (Optional):
Search
Clear Results
Top Articles
Created by Lloyd


Newbie here. There is a lot to take in. Going round in circles with information overload, so forgive me.
I ordered an emonPi, although now I am thinking I should have gone for the emonTX, as I see there is a sketch to preform the same function as the Mk2 PV Router (minus the output stage).
1. Can the emonPi also run the Mk2 PV Router code?
2. It looks like you can use the emonTH to control the output stage (I saw it in one of Robin's videos), but there doesn't seem to be any info on that. The Mk2 PV Router, appears to have a CT on the control output. Is that necessary for normal operation, or is it just for calibration?
Here is my idea. I have two heating elements in my tank. One at the top, and one near the bottom. I want to use three temperatures sensors on the tank (which the emonTH can do), and then use either a double-throw relay or second triak to alternate between the heating elements. The idea is, you start heating the top of the tank first, and then switch to the lower one, once you get to a set temperature. I also want a GUI to show the temperature of the tank at the three points, and the option to set target temperatures for a time of day, even if it optionally means pulling power from the grid.
Re: emonPi / Tx, Mk2 PV Router, with dual immersion elements
1. I suspect it would be possible to run one of the Mk2 router sketches on the emonPi, and it looks as if you might be able to get an output via the RJ45 connector if you need it. However, I'm not aware that anyone has ever tried to do either of these things.
2. The CT on the controlled output is to measure the diverted power for indication purposes. (If you have a thermostat on the immersion heater, the triac state only indicates the power available for diversion, not the actual energy diverted since the 'stat will open when the max. temperature is reached. If you're using temperature sensors to override diversion at max. temperature, then that is no longer a problem.)
You will need a triac or a beefy transistor to drive your relay/contactor anyway, so why not use two output stages, one for each immersion element, which should be a lot more reliable?
But one thing is puzzling me, why do you want to use an emonTH to drive the output stage and run the control software on the emonPi? Are you planning to put the emonPi close to your consumer unit and use the radio to control the output switch via the emonTH, which is local to the immersion heaters?
Re: emonPi / Tx, Mk2 PV Router, with dual immersion elements
Ideally the output driver needs to be next to the immersion heaters. Three reasons for this. Firstly the power caballing feeding it is 2.5mm, and can't support two heaters simultaneously, without a major rewire. So the switching needs to be done there. Secondly, there is limited space around the consumer unit for more switchgear. Thirdly, the meters (including the generation meter) are on the other side of a wall, where I need to clip on my CT sensors, and so it's more practical to put the logic there, and transmit it.
Thanks for the info, that helps clear things up.


--- layout: example-full.html title: Canvas becoming a Pro EP2 shortdesc: Drawing On the Canvas. docs: > Drawing On the Canvas. Ref [HTML5 Canvas Tutorials for Beginners | Become a Canvas Pro](https://www.youtube.com/playlist?list=PLpPnRKq7eNW3We9VdCfx9fprhqXHwTPXL). tags: "canvas" resources: - resources/js/stats.js ---


| Event Name | Time | Info |
|---|---|---|
| Fireworks | 10:00 PM - 11:30PM | Learn More |
| Amazing Amphibians | 9:00 AM | Learn More |
| Stories in the Park | 11:00 AM | Learn More |
| Summer in the Park | 11:00 AM | Learn More |
| Playdate @ Pullen | 6:00 PM | Learn More |
| Class Name | Time | Cost | Info |
|---|---|---|---|
| Swimming I | 8:00 AM | $100 | Learn More |
| Aerobics | 9:00 AM | $80 | Learn More |
| Art I | 10:00 AM | $90 | Learn More |
| Art II | 10:00 AM | $90 | Learn More |
| Zumba | 12:00 PM | $30 | Learn More |


The Mynx Web Browser
Usage
mynx filepath|url
Description
View the web as it once was with the Mynx web browser. A fusion of something between more(1) and lynx(1).
It allows you to surf the web in complete safety and tranquility. The ideal web browser
for small children and their sensitive minds. It contains
a window popup blocker, it filters banner ads, and is easy to configure!
You can view local HTML files or give an http:// URL. Simply press
the ENTER key to page down through long documents. To navigate, just type the number
found in square brackets to the left of any link, followed by the ENTER key. To
quit, simply visit link zero (0), or type CTRL+C.
Features
- A lean simple interface verses
Mozilla Firefox,
Opera, or Internet Explorer.
- Can navigate frames and image links.
- Integrated popup window blocker.
- No forms to fill out.
- No banner ads.
- No cookie crumbs.
- No past to worry about.
Technical Overview
- Parses well formed XHTML documents as given by the
W3C XHTML 1.0 Specification.
- Recognises the terminal window dimensions and performs line wrapping.
- Supports the ISO 8859-1 character entities, which can be easily redefined.
- The compact HTML scanner supports trivial wildcard matching.
- With minor changes, can be built as a Windows native console application.
Known Issues
The following issues are related to space constraints:
- HTTP redirection responses (301, 302, 303, and 307) are not handled, assuming
that a short HTML message with a clickable link will be provided as recommended by
RFC 2616. However, not all sites properly adhere to this useful recommendation.
Symptoms of this are a couple of blank lines and a return to the prompt after
selecting a link.
- HTML 4.01 or older documents should
still display, though the formatting may be a little different as these documents
often omit closing tags for many elements such as: </p>, </li>
- MIME types other than text/html are not handled.
Top
- IOCCC
- USENIX
- SAGE
- CNet News
- Slashdot
|


Angular 2 Seed Advanced is a starter project that implements best practices in
coding, building and testing Angular 2 apps. Additionally it adds various enhancements
and integrations for large global projects.
Features
- Ready to go, statically typed build system using Gulp for working with TypeScript.
- Production and development builds.
- Sample unit tests with Jasmine and Karma including code coverage via Istanbul.
- End-to-end tests with Protractor.
- Development server with live reload.
- TypeScript definition management using Typings.
- Basic Service Worker, which implements "Cache then network strategy".
- Integration with lodash.
- RxJS powered state management (Redux) via ngrx/store.
- i18n with ng2-translate.
- Native cross platform app development with NativeScript.


| Class and Description |
|---|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|
| Class and Description |
|---|
| Attributes
Attributes interface.
|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|
| Item
Item interface.
|
| Class and Description |
|---|
| Address
Address interface.
|
| Address.Builder
Address.Builder inner interface.
|
| AddressImpl
Basic implementation of the Attributes interface.
|
| AddressImpl.Builder
Implementation of Address.Builder interface.
|
| Attributes
Attributes interface.
|
| Attributes.Builder
Attributes.Builder inner interface.
|
| AttributesImpl
Minimal implementation of the Attributes interface.
|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|
| Category
Category interface.
|
| Category.Builder
Category.Builder inner interface.
|
| CategoryImpl
Minimal implementation of the Category interface.
|
| CategoryImpl.Builder
Implementation of Category.Builder interface.
|
| Item
Item interface.
|
| Item.Builder
Item.Builder inner interface.
|
| ItemImpl
Implementation of the Item interface.
|
| ItemImpl.Builder
Implementation of the Item.Builder interface.
|
| Class and Description |
|---|
| Attributes
Attributes interface.
|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|
| Category
Category interface.
|
| Class and Description |
|---|
| Attributes
Attributes interface.
|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|
| Category
Category interface.
|
| Class and Description |
|---|
| Attributes
Attributes interface.
|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|
| Category
Category interface.
|
| Class and Description |
|---|
| Attributes
Attributes interface.
|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|
| Category
Category interface.
|
| Class and Description |
|---|
| Attributes
Attributes interface.
|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|
| Item
Item interface.
|
| Class and Description |
|---|
| Address
Address interface.
|
| Attributes
Attributes interface.
|
| Base
Base interface.
|
| Base.Builder
Base.Builder inner interface.
|
| BaseImpl
Implementation of Base interface.
|
| BaseImpl.Builder
Implementation of Base.Builder interface.
|


Cloudiness
This plot illustrates the latitude versus the cloudiness percentage and we can observe no pattern here! The regression analysis on both the hemispheres leads to better understanding!
-
Cloudiness(%) doesn't correlate with the distance from the equator.
- Observe that p-value of the linear regression estimator > significance level (typically 0.05). This means that WE CANNOT say that slope is NOT zero.
- In both hemispheres, a weak correlation between latitude and cloudiness.
-
Cloudiness is centred around different values in both hemispheres.
- The northern hemisphere has average cloudiness around 54%.
- The southern hemisphere has average cloudiness around 46%.


The End?
The Appendix sprang from a simple idea: a lot of what makes the past fascinating, human, and relevant ends up on history’s cutting room floor. It has been said, after all, that only around one-tenth of historians’ research makes it into their published work. A tenth of newspapers read, books carried, archives explored, receipts tallied, journals skimmed, letters digested. A tenth of people’s lives sifted to make history manageable and ready for publication. The Appendix provides a home for the other nine-tenths.
Download e-books from Archive.org
- Executive Editor: Christopher Heaney
- Managing Editor: Felipe Fernandes Cruz
- Creative Editor: Benjamin Breen
- Publisher: Brian Jones
- Local History Editor: Hannah Carney
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.


Craig Johnson
Lieutenant Colonel Craig Johnson, born and raised in Sydney, NSW, joined the Australian Regular Army as a musician in 1977. He subsequently served in Army bands in Sydney, Perth and Canberra before being selected to attend Army Band Officer training at the Defence Force School of Music in Melbourne. Upon graduation he was awarded the Commanding Officer’s Prize for the Best Conductor of the Course.
Since then, has served as Music Director of Army Bands Wagga, and Perth, and of the Royal Military College Band in Canberra. He is currently the Commanding Officer and Chief Instructor of the Defence Force School of Music in Melbourne.
During his Army service, Craig has taken bands to Bougainville, East Timor, the Solomon Islands, Gallipoli and the UK. His deployment to East Timor in 1999 was a highlight, and included assisting in the arrangements for the “Tour of Duty” Concert in Dili – featuring John Farnham, Kylie Minogue, Doc Nieson and James Blundell – coordinating the impending Royal Military College Band tour, and forming and recording a 100 voice multi-national INTERFET choir from soldiers of the participating nations to accompany Jon Stevens at the 1999 Myer Music Bowl “Carols by Candlelight.”
In addition to his extensive service in the Army band branch, Craig has been very successful as a conductor and musical director of musical theatre. He has conducted many successful musical theatre productions including “Westside Story,” “Thoroughly Modern Millie,” “Grease,” and “Hello, Dolly!” amongst many other shows. Craig is a past conductor of the Brindabella Orchestra in Canberra, and has undertaken advanced orchestral conducting studies in Venice, Italy, and Varna, Bulgaria – where he conducted a public performance of Brahms’ “Ein deutsches Requiem.”
Craig continues to be active as a conductor and music director both within the Army band service, and in orchestral and theatre circles. In 2017, Craig moves to Canberra to begin his appointment as the Commanding Officer of the Australian Army Bands.


The whole web/WSGIKit/Rails thing has me thinking about the steps to get an application up and running, and I want to make that work really easily. I feel like WSGIKit does that fairly decently right now (no documentation, but that will come soon!) -- but I think SQLObject is also a key component in the equation (for any framework that uses SQLObject). So I've been thinking about how to make it easier to manage.
The first thing I've done is ConnectionHub, which will become the "default" connection. It's just a way to register a connection after class creation, so you can (probably based on configuration) connect all your tables to the same database, after the modules have been loaded. It will look something like:
import sqlobject sqlobject.hub.processConnection = connectionForURI( 'mysql://localhost/testdb')
But frameworks can probably put in that glue on their own, so you can just define your classes with no boilerplate configuration or glue. This is something people are already doing in some projects (like sqlo for Zope 3 -- a project which seems entirely invisible to Google), but this turns it into a supported pattern. And it's just plain easier. You can register connections globally (processConnection) or per-thread (threadConnection).
The other thing I've started work on is a sqlobject-admin command-line client. The program can find your SQLObject classes and create and drop tables, as well as show you the SQL CREATE statements and check your data definitions against the actual tables in the database (an imperfect comparison, but at least it can show obvious differences).
Still to be written for sqlobject-admin is something that records the SQL CREATE statements and gives them a "version" (which doesn't necessarily match with your software's version), and also stores that version number in the database (in some special table). Later when you do development elsewhere and have to bring a database in sync with the latest version of your code, the tool will be able to query the database for its version and run upgrade scripts (that you hand-code). The operations are actually pretty crude, but it's mostly just to codify a process that allows for more agile and automated database evolution.
Hey Ian,
actually today I was doing my considerations about switching to Ruby on Rails and there is really one thing keeping me from switching to the dark side of the Rails framework: lack of production ready PostgreSQL drivers. Ok, it's just a suspect. The http://download.rubyonrails.com/ site shows on their left column some links to recommended libraries and, guess what, their development is hanged since 2003 (http://www.postgresql.jp/interfaces/ruby/) and supports PostgreSQL up to 7.2. So I searched a bit more and found http://wiki.rubyonrails.org/rails/show/PostgreSQL which doesn't mention how Pg 8 is supported. So I google a bit and find a host claiming:
postgres-pr (0.3.6) A pure Ruby interface to the PostgreSQL (>= 7.4) database
So, wassup in the Ruby world with the Pg 8 support? You, for sure, know this stuff better than me. Maybe the PostgreSQL engine hasn't changed that much from version 7 to 8(having added only a few things beside Win support) so this maybe is a non-issue. But still I wouldn't like to get burnt loosing data in some of my tables for some unsupported driver I've used because there's no alternative to use MySQL.
But, probably, I'll decide to take my chances and switch anyway.
Mike
# Mike
Beats me, really. But I do know that the Postgres driver situation has always been a little odd on Python, and I guess that there may be some real technical reason for that, between psycopg, Popy, PygreSQL, and maybe one other driver. Now things are pretty stable, but it took a while for that to get figured out.
# Tim Middleton
:-)


Could you design the ultimate skyscraper that rises above all and everything else? In this game, your objective is to release the raised blocks in order to create the highest tower.
HexGL is a futuristic, fast-paced racing game built by Thibaut Despoulain using HTML5, Javascript and WebGL and a tribute to the original Wipeout and F-Zero series.
3D Hartwig chess set is one of the most interesting examples of open source HTML5 and JavaScript games. As it has one of the most appealing user interfaces and provides an amazing user experience.
Click Here or Visit These Links!
Free-Ebook.net For More Click Here!
HD Video Output : 1080px
Storage : 50 GB of free space
HD Video Output : 1920px


M.S.U
Messages
Lost IDs
My map
About
Logout
If THE BOT FAILS TO RESPOND YOU MAY SEND A DIRECT MESSAGE TO ADMIN AND HE WILL RESPOND
SEND Message
ALL REPLIES DONE WILL BE IN INBOX
Chat with MSU
online


Backpacker
Transportation
Hotel
Things to Do
Things to do in newyork
button
Here's our small slogan.
Left Aligned Caption
Here's our small slogan.
Right Aligned Caption
Here's our small slogan.
This is our big Tagline!
Here's our small slogan.
Sight seeing/Activities
Food Varities
Things to Do
Golden Cave
+
Golden cave california
California golden cave
X
third wonder of world
visit Golden cave
Golden Cave
+
Golden cave california
California golden cave
X
third wonder of world
visit Golden cave
Golden Cave
+
Golden cave california
California golden cave
X
third wonder of world
visit Golden cave
Golden Cave
+
Golden cave california
California golden cave
X
third wonder of world
visit Golden cave
Golden Cave
+
Golden cave california
California golden cave
X
third wonder of world
visit Golden cave
Golden Cave
+
Golden cave california
California golden cave
X
third wonder of world
visit Golden cave


class: center, middle, inverse, title-slide # Geography 176A ## Lecture 11: Projections ### Mike Johnson ---  # Picking up again ... Yesterday, we discussed the *simple feature* standard -- 1. Geometries (type, dimension, and structure) -- - Empty, Valid, Simple -- 2. Encoding (WKT & WKB) -- 3. A set of operations -- And the implementation of the **simple features** standard in R -- - _sfg_: a _single_ feature geometry -- - _sfc_: a _set_ of geometries (`sfg`) stored as a list -- - _sf_: a `sfc` list joined with a `data.frame` (attributes) -- **** This R implementation is ideal/special because it achieves the simple feature abstract goal of: > "_A simple feature is defined by the OpenGIS Abstract specification to have both **spatial** and **non-spatial** attributes..._" - [standard](http://www.opengeospatial.org/standards/sfa). -- The shapefile/GIS traditional GIS view does not do this and seperates geometry (shp), from projection (prj), from data (dbf) and relates them through an shx file --- # Integration with `tidyverse` - We saw how the `dplyr` verbs still work on an `sf` object since `sf` extends the data.frame class -- - How `geom_sf` support mapping ("spatial plotting") in `ggplot` -- - How to read spatial data into R via GDAL drivers: - spatial files (`read_sf`) - flat files via `st_as_sf` -- - Integration with a few `GEOS` geometry operations like: - st_combine() - st_union() --- # Yesterday ... .pull-left[ ```r conus = USAboundaries::us_states() %>% filter(!state_name %in% c("Puerto Rico", "Alaska", "Hawaii")) length(st_geometry(conus)) ``` ``` [1] 49 ``` ] .pull-right[  ] --- # 1 feature: resoloved and combined: .pull-left[ - st_cast / st_union work on `sfg`, `sfc`, and `sf` objects: ```r us_c_ml = st_combine(conus) %>% st_cast("MULTILINESTRING") us_u_ml = st_union(conus) %>% st_cast("MULTILINESTRING") ``` ] .pull-right[  ] --- # So what? Lets imagine we want to know the distance from Denver to the nearest state border: -- To do this, we need to: -- 1: define Denver as a geometry in a CRS -- 2: determine the correct geometry types / representation -- 3: calculate the distance between (1) and (2) -- ### 1. Make "Denver" in the CRS of our states ```r denver = data.frame(y = 39.7392, x = -104.9903, name = "Denver") (denver_sf = st_as_sf(denver, coords = c("x", "y"), crs = 4326)) ``` ``` Simple feature collection with 1 feature and 1 field geometry type: POINT dimension: XY bbox: xmin: -104.9903 ymin: 39.7392 xmax: -104.9903 ymax: 39.7392 geographic CRS: WGS 84 name geometry 1 Denver POINT (-104.9903 39.7392) ``` --- count: false ### 2. Determine the 3 closest states: .left-panel-q14-auto[ ```r *conus ``` ] .right-panel-q14-auto[ ``` Simple feature collection with 49 features and 12 fields geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -124.7258 ymin: 24.49813 xmax: -66.9499 ymax: 49.38436 geographic CRS: WGS 84 First 10 features: statefp statens affgeoid geoid stusps name lsad 1 23 01779787 0400000US23 23 ME Maine 00 2 04 01779777 0400000US04 04 AZ Arizona 00 3 05 00068085 0400000US05 05 AR Arkansas 00 4 10 01779781 0400000US10 10 DE Delaware 00 5 13 01705317 0400000US13 13 GA Georgia 00 6 27 00662849 0400000US27 27 MN Minnesota 00 7 06 01779778 0400000US06 06 CA California 00 8 11 01702382 0400000US11 11 DC District of Columbia 00 9 12 00294478 0400000US12 12 FL Florida 00 10 16 01779783 0400000US16 16 ID Idaho 00 aland awater state_name state_abbr jurisdiction_type 1<PHONE_NUMBER>5<PHONE_NUMBER>5 Maine ME state 2<PHONE_NUMBER>25<PHONE_NUMBER> Arizona AZ state 3<PHONE_NUMBER>96<PHONE_NUMBER> Arkansas AR state 4<PHONE_NUMBER><PHONE_NUMBER> Delaware DE state 5<PHONE_NUMBER>56<PHONE_NUMBER> Georgia GA state 6<PHONE_NUMBER>55<PHONE_NUMBER>1 Minnesota MN state 7<PHONE_NUMBER>70<PHONE_NUMBER>3 California CA state 8 158364992 18633403 District of Columbia DC district 9<PHONE_NUMBER>12<PHONE_NUMBER>5 Florida FL state 10<PHONE_NUMBER>12<PHONE_NUMBER> Idaho ID state geometry 1 MULTIPOLYGON (((-68.92401 4... 2 MULTIPOLYGON (((-114.7997 3... 3 MULTIPOLYGON (((-94.61792 3... 4 MULTIPOLYGON (((-75.77379 3... 5 MULTIPOLYGON (((-85.60516 3... 6 MULTIPOLYGON (((-97.22904 4... 7 MULTIPOLYGON (((-118.594 33... 8 MULTIPOLYGON (((-77.11976 3... 9 MULTIPOLYGON (((-81.81169 2... 10 MULTIPOLYGON (((-117.243 44... ``` ] --- count: false ### 2. Determine the 3 closest states: .left-panel-q14-auto[ ```r conus %>% * select(state_name) ``` ] .right-panel-q14-auto[ ``` Simple feature collection with 49 features and 1 field geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -124.7258 ymin: 24.49813 xmax: -66.9499 ymax: 49.38436 geographic CRS: WGS 84 First 10 features: state_name geometry 1 Maine MULTIPOLYGON (((-68.92401 4... 2 Arizona MULTIPOLYGON (((-114.7997 3... 3 Arkansas MULTIPOLYGON (((-94.61792 3... 4 Delaware MULTIPOLYGON (((-75.77379 3... 5 Georgia MULTIPOLYGON (((-85.60516 3... 6 Minnesota MULTIPOLYGON (((-97.22904 4... 7 California MULTIPOLYGON (((-118.594 33... 8 District of Columbia MULTIPOLYGON (((-77.11976 3... 9 Florida MULTIPOLYGON (((-81.81169 2... 10 Idaho MULTIPOLYGON (((-117.243 44... ``` ] --- count: false ### 2. Determine the 3 closest states: .left-panel-q14-auto[ ```r conus %>% select(state_name) %>% * mutate(dist = st_distance(., denver_sf)) ``` ] .right-panel-q14-auto[ ``` Simple feature collection with 49 features and 2 fields geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -124.7258 ymin: 24.49813 xmax: -66.9499 ymax: 49.38436 geographic CRS: WGS 84 First 10 features: state_name geometry dist 1 Maine MULTIPOLYGON (((-68.92401 4... 2831628.4 [m] 2 Arizona MULTIPOLYGON (((-114.7997 3... 466902.0 [m] 3 Arkansas MULTIPOLYGON (((-94.61792 3... 977301.5 [m] 4 Delaware MULTIPOLYGON (((-75.77379 3... 2492187.8 [m] 5 Georgia MULTIPOLYGON (((-85.60516 3... 1792330.1 [m] 6 Minnesota MULTIPOLYGON (((-97.22904 4... 824442.3 [m] 7 California MULTIPOLYGON (((-118.594 33... 1002132.0 [m] 8 District of Columbia MULTIPOLYGON (((-77.11976 3... 2394802.2 [m] 9 Florida MULTIPOLYGON (((-81.81169 2... 1849302.8 [m] 10 Idaho MULTIPOLYGON (((-117.243 44... 568832.7 [m] ``` ] --- count: false ### 2. Determine the 3 closest states: .left-panel-q14-auto[ ```r conus %>% select(state_name) %>% mutate(dist = st_distance(., denver_sf)) %>% * slice_min(dist, n = 3) ``` ] .right-panel-q14-auto[ ``` Simple feature collection with 3 features and 2 fields geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -111.0569 ymin: 36.99243 xmax: -95.30829 ymax: 45.0059 geographic CRS: WGS 84 state_name dist geometry 1 Colorado 0.0 [m] MULTIPOLYGON (((-109.06 38.... 2 Wyoming 139795.3 [m] MULTIPOLYGON (((-111.0569 4... 3 Nebraska 161173.7 [m] MULTIPOLYGON (((-104.0531 4... ``` ] --- count: false ### 2. Determine the 3 closest states: .left-panel-q14-auto[ ```r conus %>% select(state_name) %>% mutate(dist = st_distance(., denver_sf)) %>% slice_min(dist, n = 3) -> * near3 ``` ] .right-panel-q14-auto[ ]  --- ``` Simple feature collection with 3 features and 2 fields geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -111.0569 ymin: 36.99243 xmax: -95.30829 ymax: 45.0059 geographic CRS: WGS 84 state_name dist geometry 1 Colorado 0.0 [m] MULTIPOLYGON (((-109.06 38.... 2 Wyoming 139795.3 [m] MULTIPOLYGON (((-111.0569 4... 3 Nebraska 161173.7 [m] MULTIPOLYGON (((-104.0531 4... ``` - That's close, but the distance to Colorado is 0, that's not a state border. --- # Geometry Selection - `Polygon` (therefore MULTIPOLGYGONS) describe areas! -- - The distance to a `point` **in** a `polygon` to that polygon is 0. --- count: false To determine distance to border we need a linear represnetation: .left-panel-q15-auto[ ```r *conus ``` ] .right-panel-q15-auto[ ``` Simple feature collection with 49 features and 12 fields geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -124.7258 ymin: 24.49813 xmax: -66.9499 ymax: 49.38436 geographic CRS: WGS 84 First 10 features: statefp statens affgeoid geoid stusps name lsad 1 23 01779787 0400000US23 23 ME Maine 00 2 04 01779777 0400000US04 04 AZ Arizona 00 3 05 00068085 0400000US05 05 AR Arkansas 00 4 10 01779781 0400000US10 10 DE Delaware 00 5 13 01705317 0400000US13 13 GA Georgia 00 6 27 00662849 0400000US27 27 MN Minnesota 00 7 06 01779778 0400000US06 06 CA California 00 8 11 01702382 0400000US11 11 DC District of Columbia 00 9 12 00294478 0400000US12 12 FL Florida 00 10 16 01779783 0400000US16 16 ID Idaho 00 aland awater state_name state_abbr jurisdiction_type 1<PHONE_NUMBER>5<PHONE_NUMBER>5 Maine ME state 2<PHONE_NUMBER>25<PHONE_NUMBER> Arizona AZ state 3<PHONE_NUMBER>96<PHONE_NUMBER> Arkansas AR state 4<PHONE_NUMBER><PHONE_NUMBER> Delaware DE state 5<PHONE_NUMBER>56<PHONE_NUMBER> Georgia GA state 6<PHONE_NUMBER>55<PHONE_NUMBER>1 Minnesota MN state 7<PHONE_NUMBER>70<PHONE_NUMBER>3 California CA state 8 158364992 18633403 District of Columbia DC district 9<PHONE_NUMBER>12<PHONE_NUMBER>5 Florida FL state 10<PHONE_NUMBER>12<PHONE_NUMBER> Idaho ID state geometry 1 MULTIPOLYGON (((-68.92401 4... 2 MULTIPOLYGON (((-114.7997 3... 3 MULTIPOLYGON (((-94.61792 3... 4 MULTIPOLYGON (((-75.77379 3... 5 MULTIPOLYGON (((-85.60516 3... 6 MULTIPOLYGON (((-97.22904 4... 7 MULTIPOLYGON (((-118.594 33... 8 MULTIPOLYGON (((-77.11976 3... 9 MULTIPOLYGON (((-81.81169 2... 10 MULTIPOLYGON (((-117.243 44... ``` ] --- count: false To determine distance to border we need a linear represnetation: .left-panel-q15-auto[ ```r conus %>% * select(state_name) ``` ] .right-panel-q15-auto[ ``` Simple feature collection with 49 features and 1 field geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -124.7258 ymin: 24.49813 xmax: -66.9499 ymax: 49.38436 geographic CRS: WGS 84 First 10 features: state_name geometry 1 Maine MULTIPOLYGON (((-68.92401 4... 2 Arizona MULTIPOLYGON (((-114.7997 3... 3 Arkansas MULTIPOLYGON (((-94.61792 3... 4 Delaware MULTIPOLYGON (((-75.77379 3... 5 Georgia MULTIPOLYGON (((-85.60516 3... 6 Minnesota MULTIPOLYGON (((-97.22904 4... 7 California MULTIPOLYGON (((-118.594 33... 8 District of Columbia MULTIPOLYGON (((-77.11976 3... 9 Florida MULTIPOLYGON (((-81.81169 2... 10 Idaho MULTIPOLYGON (((-117.243 44... ``` ] --- count: false To determine distance to border we need a linear represnetation: .left-panel-q15-auto[ ```r conus %>% select(state_name) %>% * st_cast("MULTILINESTRING") ``` ] .right-panel-q15-auto[ ``` Simple feature collection with 49 features and 1 field geometry type: MULTILINESTRING dimension: XY bbox: xmin: -124.7258 ymin: 24.49813 xmax: -66.9499 ymax: 49.38436 geographic CRS: WGS 84 First 10 features: state_name geometry 1 Maine MULTILINESTRING ((-68.92401... 2 Arizona MULTILINESTRING ((-114.7997... 3 Arkansas MULTILINESTRING ((-94.61792... 4 Delaware MULTILINESTRING ((-75.77379... 5 Georgia MULTILINESTRING ((-85.60516... 6 Minnesota MULTILINESTRING ((-97.22904... 7 California MULTILINESTRING ((-118.594 ... 8 District of Columbia MULTILINESTRING ((-77.11976... 9 Florida MULTILINESTRING ((-81.81169... 10 Idaho MULTILINESTRING ((-117.243 ... ``` ] --- count: false To determine distance to border we need a linear represnetation: .left-panel-q15-auto[ ```r conus %>% select(state_name) %>% st_cast("MULTILINESTRING") %>% * mutate(dist = st_distance(., denver_sf)) ``` ] .right-panel-q15-auto[ ``` Simple feature collection with 49 features and 2 fields geometry type: MULTILINESTRING dimension: XY bbox: xmin: -124.7258 ymin: 24.49813 xmax: -66.9499 ymax: 49.38436 geographic CRS: WGS 84 First 10 features: state_name geometry dist 1 Maine MULTILINESTRING ((-68.92401... 2831628.4 [m] 2 Arizona MULTILINESTRING ((-114.7997... 466902.0 [m] 3 Arkansas MULTILINESTRING ((-94.61792... 977301.5 [m] 4 Delaware MULTILINESTRING ((-75.77379... 2492187.8 [m] 5 Georgia MULTILINESTRING ((-85.60516... 1792330.1 [m] 6 Minnesota MULTILINESTRING ((-97.22904... 824442.3 [m] 7 California MULTILINESTRING ((-118.594 ... 1002132.0 [m] 8 District of Columbia MULTILINESTRING ((-77.11976... 2394802.2 [m] 9 Florida MULTILINESTRING ((-81.81169... 1849302.8 [m] 10 Idaho MULTILINESTRING ((-117.243 ... 568832.7 [m] ``` ] --- count: false To determine distance to border we need a linear represnetation: .left-panel-q15-auto[ ```r conus %>% select(state_name) %>% st_cast("MULTILINESTRING") %>% mutate(dist = st_distance(., denver_sf)) %>% * slice_min(dist, n = 3) ``` ] .right-panel-q15-auto[ ``` Simple feature collection with 3 features and 2 fields geometry type: MULTILINESTRING dimension: XY bbox: xmin: -111.0569 ymin: 36.99243 xmax: -95.30829 ymax: 45.0059 geographic CRS: WGS 84 state_name dist geometry 1 Colorado 139795.3 [m] MULTILINESTRING ((-109.06 3... 2 Wyoming 139795.3 [m] MULTILINESTRING ((-111.0569... 3 Nebraska 161173.7 [m] MULTILINESTRING ((-104.0531... ``` ] --- count: false To determine distance to border we need a linear represnetation: .left-panel-q15-auto[ ```r conus %>% select(state_name) %>% st_cast("MULTILINESTRING") %>% mutate(dist = st_distance(., denver_sf)) %>% slice_min(dist, n = 3) -> * near3 ``` ] .right-panel-q15-auto[ ]  --- ``` Simple feature collection with 3 features and 2 fields geometry type: MULTILINESTRING dimension: XY bbox: xmin: -111.0569 ymin: 36.99243 xmax: -95.30829 ymax: 45.0059 geographic CRS: WGS 84 state_name dist geometry 1 Colorado 139795.3 [m] MULTILINESTRING ((-109.06 3... 2 Wyoming 139795.3 [m] MULTILINESTRING ((-111.0569... 3 Nebraska 161173.7 [m] MULTILINESTRING ((-104.0531... ``` - Good. However, we were only interested in the distance to the closest border not to ALL boarders. Therefore we calculated 48 (49 - 1) more distances then needed! -- - While this is not to complex for 1 <-> 49 features imagine we had 28,000+ (like) your lab! -- - That would result in 1,344,000 more calculations then needed ... --- # Revisting the idea of the feature level: A "feature" can "be part of the whole" or the whole -- - A island (POLYGON), or a set of islands acting as 1 unit (MULTIPOLYGON) -- - A city (POINT), or a set of cities meeting a condition (MULTIPOINT) -- - A road (LINESTRING), or a route (MULTILINESTRING) -- **** - Since we want the distance to the nearest border, _regardless_ of the state. Our **feature** is the _set of borders with preserved boundaries_. -- - In other words, a 1 feature `MULTILINESTRING` -- ```r st_distance(denver_sf, st_cast(st_combine(conus), "MULTILINESTRING")) ``` ``` Units: [m] [,1] [1,] 139795.3 ``` -- **** The same principle would apply if the question was "_distance to national border_" --- # The stickness of sfc column - A simple features object (sf) is the connection of a `sfc` list-column and `data.frame` of attributes  (https://mhweber.github.io/AWRA_2020_R_Spatial/vector-data-with-sf.html) -- - This binding is unique compared to other column bindings built with things like - `dplyr::bind_cols()` - `cbind()` - `do.call(cbind, list())` --- # The stickness of `sfc` column - Geometry columns are "sticky" meaning they persist through data manipulation: ```r USAboundaries::us_states() %>% select(name) %>% slice(1:2) ``` ``` Simple feature collection with 2 features and 1 field geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -160.2496 ymin: 18.91747 xmax: -66.9499 ymax: 47.45716 geographic CRS: WGS 84 name geometry 1 Maine MULTIPOLYGON (((-68.92401 4... 2 Hawaii MULTIPOLYGON (((-156.0497 1... ``` --- Dropping the geometry column requires dropping the geometry via `sf`: ```r USAboundaries::us_states() %>% * st_drop_geometry() %>% select(name) %>% slice(1:2) ``` ``` name 1 Maine 2 Hawaii ``` -- Or cohersing the `sf` object to a `data.frame`: ```r USAboundaries::us_states() %>% * as.data.frame() %>% select(name) %>% slice(1:2) ``` ``` name 1 Maine 2 Hawaii ``` --- # Coordinate Systems - What makes a feature geometry _spatial_ is the reference system...  --- # Coordinate Systems - Coordinate Reference Systems (CRS) defines how spatial features relate to the surface of the Earth. -- - CRSs are either geographic or projected... -- - CRSs are measurement units for coordinates: --- # `sf` tools In `sf` we have _three_ tools for exploring, define, and changing CRS systems: -- - *st_crs* : Retrieve coordinate reference system from sf or sfc object -- - *st_set_crs* : Set or replace coordinate reference system from object -- - *st_transform* : Transform or convert coordinates of simple feature -- **** - Again, "st" (like PistGIS) denotes it is an operation that can work on a " _s_ patial _t_ ype " --- # Geographic Coordinate Systms (GCS) A GCS identifies locations on the _curved_ surface of the earth. -- Locations are measured in **angular** units from the center of the earth relative to the plane defined by the equator and the plane defined by the prime meridian. -- The vertical angle describes the _latitude_ and the horizontal angle the _longitude_ -- In most coordinate systems, the North-South and East-West directions are encoded as +/-. North and East are positive (`+`) and South and West are negative (`-`) sign. -- A GCS is defined by 3 components: - an **ellipsoid** - a **geoid** - a **datum** --- ## Sphere and Ellipsoid - Assuming that the earth is a perfect sphere simplifies calculations and works for small-scale maps (maps that show a *large* area of the earth). -- - But ... the earth is not a sphere do to its rotation inducing a centripetal force along the equator. -- - This results in an equatorial axis that is roughly 21 km longer than the polar axis. -- - To account for this, the earth is modeled as an ellipsoid (slighty squished sphere) defined by two radii: - the **semi-major** axis (along the equatorial radius) - the **semi-minor** axis (along the polar radius) --  --- - Thanks to satellite and computational capabilities our estimates of these radii are be quite precise -- - The semi-major axis is 6,378,137 m -- - The semi-minor axis is 6,356,752 m -- - Differences in distance along the surfaces of an ellipsoid vs. a perfect sphere are small but measurable (the difference can be as high as 20 km) ![](lec-img/11-sphere.svg)![](lec-img/11-ellipsoid.svg) --- ### Geoid - The _ellipsoid_ gives us the earths form as a perfectly smooth object -- - But ... the earth is not perfectly smooth -- - Deviations from the perfect sphere are measurable and can influence measurements. -- - A *geoid* is a mathematical model fore representing these deviations -- - We are _not_ talking about mountains and ocean trenches but the earth's gravitational potential which is tied to the flow of the earth's hot and fluid core. -- - Therefore the geoid is constantly changing, albeit at a large temporal scale. -- - The measurement and representation of the earth's shape is at the heart of `geodesy`  --- ## Datum - So how are we to reconcile our need to work with a (simple) mathematical model of the earth's shape with the undulating nature of the geoid? -- - We align the geoid with the ellipsoid to map the the earths departures from the smooth assumption -- - The alignment can be **local** where the ellipsoid surface is closely fit to the geoid at a particular location on the earth's surface or - **geocentric** where the ellipsoid is aligned with the center of the earth. -- - The alignment of the smooth ellipsoid to the geoid model defines a **datum**. --- ## Local Datums - There are many local datums to choose from -- - The choice of datum is largely driven by the location -- - When working in the USA, a the North American Datum of 1927 (or NAD27 for short) is standard - NAD27 is not well suited for other parts of the world. -- Examples of common local datums are shown in the following table: **** Local datum | Acronym | Best for| Comment -------------------|---------|--------|------------------------------- North American Datum of 1927 | NAD27 | Continental US | This is an old datum but still prevalent because of the wide use of older maps. European Datum of 1950 | ED50 | Western Europe | Developed after World War II and still quite popular today. Not used in the UK. World Geodetic System 1972 | WGS72 | Global | Developed by the Department of Defense. **** --- # Geocentric Datum - Many modern datums use a geocentric alignment -- - World Geodetic Survey for 1984 (WGS84) -- - North American Datums of 1983 (NAD83) -- - Most popular geocentric datums use the WGS84 _ellipsoid_ or the GRS80 _ellipsoid_ which share nearly identical semi-major and semi-minor axes -- *** Geocentric datum | Acronym | Best for| Comment -------------------|---------|--------|------------------------------- North American Datum of 1983 | NAD83 | Continental US | This is one of the most popular modern datums for the contiguous US. European Terrestrial Reference System 1989 | ETRS89 | Western Europe | This is the most popular modern datum for much of Europe. World Geodetic System 1984 | WGS84 | Global | Developed by the Department of Defense. *** **Note**: NAD 27 is based on Clarke Ellipsoid of 1866 which is calculated by manual surveying. NAD83 is based on the Geodetic Reference System (GRS) of 1980. --- ### Building a GCS - So, a GCS is defined by the ellipsoid model and its alignment to the geoid defining the datum. -- - Smooth Sphere - Mathmatical Geoid (in angular units) --- ## Projected Coordinate Systems - The surface of the earth is curved but maps (and to data GIS) is flat. -- - A projected coordinate system (PCS) is a reference system for identifying locations and measuring features on a flat (2D) surfaces. I -- - Projected coordinate systems have an origin, an *x* axis, a *y* axis, and a linear unit of measure. -- - Going from a GCS to a PCS requires mathematical transformations. -- There are three main groups of projection types: - conic - cylindrical - planar --- # Projection Types:  - In all cases, distortion is _minimized_ at the line/point of **tangency** (denoted by black line/point) - Distortions are _minimized_ along the tangency lines and increase with the distance from those lines. --- # Plannar - A planar projection projects data onto a flat surface touching the globe at a _point_ or along 1 line of _tangency._ - Typically used to map polar regions.  --- # Cylindircal - A cylindrical projection maps the surface onto a cylinder. - This projection could also be created by touching the Earth’s surface along 1 or 2 lines of _tangency_ - Most often when mapping the entire world.  --- # Conic In a conic projection, the Earth’s surface is projected onto a cone along 1 or 2 lines of _tangency_ Therefore, it is the best suited for maps of mid-latitude areas.  --- ## Spatial Properties - All projections _distort_ real-world geographic features. -- - Think about trying to unpeel an orange while preserving the skin -- The four spatial properties that are subject to distortion are: **shape**, **area**, **distance** and **direction** -- - A map that preserves shape is called `conformal`; -- - one that preserves area is called `equal-area`; -- - one that preserves distance is called `equidistant` -- - one that preserves direction is called `azimuthal` -- *** - Each map projection can preserve only one or two of the four spatial properties. -- - Often, projections are named after the spatial properties they preserve. -- - When working with small-scale (large area) maps and when multiple spatial properties are needed, it is best to break the analyses across projections to minimize errors associated with spatial distortion. --- # Setting CRSs/PCSs - We saw that `sfc` objects have two attributes to store a CRS: `epsg` and `proj4string` -- ```r st_geometry(conus) ``` ``` Geometry set for 49 features geometry type: MULTIPOLYGON dimension: XY bbox: xmin: -124.7258 ymin: 24.49813 xmax: -66.9499 ymax: 49.38436 geographic CRS: WGS 84 First 5 geometries: ``` ``` MULTIPOLYGON (((-68.92401 43.88541, -68.87478 4... ``` ``` MULTIPOLYGON (((-114.7997 32.59362, -114.8094 3... ``` ``` MULTIPOLYGON (((-94.61792 36.49941, -94.3612 36... ``` ``` MULTIPOLYGON (((-75.77379 39.7222, -75.75323 39... ``` ``` MULTIPOLYGON (((-85.60516 34.98468, -85.47434 3... ``` -- - This implies that all geometries in a geometry list-column (sfc) must have the same CRS. --- - `proj4string` is a generic, string-based description of a CRS, understood by [PROJ](https://proj4.org/) -- - It defines projection types and parameter values for particular projections, -- - As a result it can cover an infinite amount of different projections. -- - `epsg` is the _integer ID_ for a known CRS that can be resolved into a `proj4string`. - This is somewhat equivalent to the idea that a 6-digit FIP code can be resolved to a state/county pair -- - Some `proj4string` values can resolved back into their corresponding `epsg` ID, but this does not always work. -- - The importance of having `epsg` values stored with data besides `proj4string` values is that the `epsg` refers to particular, well-known CRS, whose parameters may change (improve) over time -- - fixing only the `proj4string` may remove the possibility to benefit from such improvements, and limit some of the provenance of datasets (but may help reproducibility) --- # `PROJ4` coordinate syntax The `PROJ4` syntax contains a list of parameters, each prefixed with the `+` character. A list of some `PROJ4` parameters follows and the full list can be found [here](https://proj.org/usage/projections.html): | Parameter | Description | |--------- |--------------------------------------------------------------------- | | +a | Semi-major radius of the ellipsoid axis | | +b | Semi-minor radius of the ellipsoid axis | | +datum | Datum name | | +ellps | Ellipsoid name | | +lat_0 | Latitude of origin | | +lat_1 | Latitude of first standard parallel | | +lat_2 | Latitude of second standard parallel | | +lat_ts | Latitude of true scale | | +lon_0 | Central meridian | | +over | Allow longitude output outside -180 to 180 range, disables wrapping | | +proj | Projection name | | +south | Denotes southern hemisphere UTM zone | | +units | meters, US survey feet, etc. | | +x_0 | False easting | | +y_0 | False northing | | +zone | UTM zone | --- **WGS84** _EPSG_: 4326 _PROJ4_: `+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs` - projection name: longlat - Latitude of origin: WGS84 - Longitude of origin: WGS84 *** **WGS84** _EPSG_: 5070 `"+proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs"` - projection name: `aea` (Albers Equal Area) - Latitude of origin: 23 - Longitude of origin: -96 - Latitude of first standard parallel: 29.5 - Latitude of second standard parallel: 45.5 - False Easting: 0 - False Northing: 0 - Datum: NAD83 - Units: m --- ## Transform and retrive .pull-left[ ```r st_crs(conus)$epsg ``` ``` [1] 4326 ``` ```r st_crs(conus)$proj4string ``` ``` [1] "+proj=longlat +datum=WGS84 +no_defs" ``` ```r st_crs(conus)$datum ``` ``` [1] "WGS84" ``` ] .pull-right[ ```r conus5070 = st_transform(conus, 5070) st_crs(conus5070)$epsg ``` ``` [1] 5070 ``` ```r st_crs(conus5070)$proj4string ``` ``` [1] "+proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs" ``` ```r st_crs(conus5070)$datum ``` ``` [1] "NAD83" ``` ] ---  --- # Revisit Denver ```bash echo -104.9903 39.7392 | proj +init=epsg:5070 ``` ``` -762409.05 1893843.60 ``` ```bash echo -104.9903 39.7392 | proj +proj=eqdc +lat_0=40 +lon_0=-96 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs ``` ``` -723281.88 6827.29 ``` - red = false origin : blue = Denver .pull-left[  ] .pull-right[  ] --- ## Geodesic geometries - PCSs introduce errors in their geometric measurements because the distance between two points on an ellipsoid is difficult to replicate on a projected coordinate system unless these points are close to one another. -- - In most cases, such errors other sources of error in the feature representation outweigh measurement errors made in a PCS making them tolorable. -- However, if the domain of analysis is large (i.e. the North American continent), then the measurement errors associated with a projected coordinate system may no longer be acceptable. -- A way to circumvent projected coordinate system limitations is to adopt a _geodesic_ solution. --- ## Geodesic Measurments - A **geodesic distance** is the shortest distance between two points on an ellipsoid -- - A **geodesic area** measurement is one that is measured on an ellipsoid. -- - Such measurements are _independent_ of the underlying projected coordinate system. -- - Why does this matter? -- - compare the distances measured between Santa Barbara and Amsterdam. The blue line represents the shortest distance between the two points on a *planar* coordinate system. The red line as measured on a *ellipsoid*.  --- - the geodesic distance looks weird given its curved appearance on the projected map. - this curvature is a byproduct of the current reference system’s increasing distance distortion as one moves towards the pole! - We can display the geodesic and planar distance on a 3D globe (or a projection that mimics the view of the 3D earth).  --- - So if a geodesic measurement is more precise than a planar measurement, why not perform all spatial operations using geodesic geometry? -- - The downside is in its computational requirements. -- - It's far more efficient to compute area/distance on a plane than it is on a spheroid. -- - This is because geodesic calculations have no simple algebraic solutions and involve approximations that may require iteration! (think optimization or nonlinear solutions) -- - So this may be a computationally taxing approach if processing 1,000(s) or 1,000,000(s) of line segments. --- # Gedesic Area and Length Measurements - Not all algorthimns are equal (in terms of speed or accuracy) -- - Some more efficient algorithms that minimize computation time may reduce precision in the process. -- - Some of ArcMap’s functions offer the option to compute geodesic distances and areas however ArcMap does not clearly indicate _how_ its geodesic calculations are implemented ([cite](https://mgimond.github.io/Spatial/coordinate-systems.html#geodesic-geometries) -- - R is well documented, and is efficient! --- # Distances `?st_distance`  --- - native `sf` binds to the libwgeom libray() .pull-left[  ] .pull-right[  ] --- count: false ###Distance Example .left-panel-dist1-auto[ ```r *(pts = data.frame(y = c(40.7128, 34.4208), x = c(-74.0060, -119.6982 ), name = c("NYC","SB"))) ``` ] .right-panel-dist1-auto[ ``` y x name 1 40.7128 -74.0060 NYC 2 34.4208 -119.6982 SB ``` ] --- count: false ###Distance Example .left-panel-dist1-auto[ ```r (pts = data.frame(y = c(40.7128, 34.4208), x = c(-74.0060, -119.6982 ), name = c("NYC","SB"))) *(pts = st_as_sf(pts, coords = c("x", "y"), crs = 4326)) ``` ] .right-panel-dist1-auto[ ``` y x name 1 40.7128 -74.0060 NYC 2 34.4208 -119.6982 SB ``` ``` Simple feature collection with 2 features and 1 field geometry type: POINT dimension: XY bbox: xmin: -119.6982 ymin: 34.4208 xmax: -74.006 ymax: 40.7128 geographic CRS: WGS 84 name geometry 1 NYC POINT (-74.006 40.7128) 2 SB POINT (-119.6982 34.4208) ``` ] --- count: false ###Distance Example .left-panel-dist1-auto[ ```r (pts = data.frame(y = c(40.7128, 34.4208), x = c(-74.0060, -119.6982 ), name = c("NYC","SB"))) (pts = st_as_sf(pts, coords = c("x", "y"), crs = 4326)) *eqds = '+proj=eqdc +lat_0=40 +lon_0=-96 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs' ``` ] .right-panel-dist1-auto[ ``` y x name 1 40.7128 -74.0060 NYC 2 34.4208 -119.6982 SB ``` ``` Simple feature collection with 2 features and 1 field geometry type: POINT dimension: XY bbox: xmin: -119.6982 ymin: 34.4208 xmax: -74.006 ymax: 40.7128 geographic CRS: WGS 84 name geometry 1 NYC POINT (-74.006 40.7128) 2 SB POINT (-119.6982 34.4208) ``` ] --- count: false ###Distance Example .left-panel-dist1-auto[ ```r (pts = data.frame(y = c(40.7128, 34.4208), x = c(-74.0060, -119.6982 ), name = c("NYC","SB"))) (pts = st_as_sf(pts, coords = c("x", "y"), crs = 4326)) eqds = '+proj=eqdc +lat_0=40 +lon_0=-96 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs' # Greeat Circle Distance *st_distance(pts) ``` ] .right-panel-dist1-auto[ ``` y x name 1 40.7128 -74.0060 NYC 2 34.4208 -119.6982 SB ``` ``` Simple feature collection with 2 features and 1 field geometry type: POINT dimension: XY bbox: xmin: -119.6982 ymin: 34.4208 xmax: -74.006 ymax: 40.7128 geographic CRS: WGS 84 name geometry 1 NYC POINT (-74.006 40.7128) 2 SB POINT (-119.6982 34.4208) ``` ``` Units: [m] [,1] [,2] [1,] 0 4050406 [2,] 4050406 0 ``` ] --- count: false ###Distance Example .left-panel-dist1-auto[ ```r (pts = data.frame(y = c(40.7128, 34.4208), x = c(-74.0060, -119.6982 ), name = c("NYC","SB"))) (pts = st_as_sf(pts, coords = c("x", "y"), crs = 4326)) eqds = '+proj=eqdc +lat_0=40 +lon_0=-96 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs' # Greeat Circle Distance st_distance(pts) # Euclidean Distance *st_distance(pts, which = "Euclidean") ``` ] .right-panel-dist1-auto[ ``` y x name 1 40.7128 -74.0060 NYC 2 34.4208 -119.6982 SB ``` ``` Simple feature collection with 2 features and 1 field geometry type: POINT dimension: XY bbox: xmin: -119.6982 ymin: 34.4208 xmax: -74.006 ymax: 40.7128 geographic CRS: WGS 84 name geometry 1 NYC POINT (-74.006 40.7128) 2 SB POINT (-119.6982 34.4208) ``` ``` Units: [m] [,1] [,2] [1,] 0 4050406 [2,] 4050406 0 ``` ``` Units: [°] [,1] [,2] [1,] 0.00000 46.12338 [2,] 46.12338 0.00000 ``` ] --- count: false ###Distance Example .left-panel-dist1-auto[ ```r (pts = data.frame(y = c(40.7128, 34.4208), x = c(-74.0060, -119.6982 ), name = c("NYC","SB"))) (pts = st_as_sf(pts, coords = c("x", "y"), crs = 4326)) eqds = '+proj=eqdc +lat_0=40 +lon_0=-96 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs' # Greeat Circle Distance st_distance(pts) # Euclidean Distance st_distance(pts, which = "Euclidean") # Equal Area PCS *st_distance(st_transform(pts, 5070)) ``` ] .right-panel-dist1-auto[ ``` y x name 1 40.7128 -74.0060 NYC 2 34.4208 -119.6982 SB ``` ``` Simple feature collection with 2 features and 1 field geometry type: POINT dimension: XY bbox: xmin: -119.6982 ymin: 34.4208 xmax: -74.006 ymax: 40.7128 geographic CRS: WGS 84 name geometry 1 NYC POINT (-74.006 40.7128) 2 SB POINT (-119.6982 34.4208) ``` ``` Units: [m] [,1] [,2] [1,] 0 4050406 [2,] 4050406 0 ``` ``` Units: [°] [,1] [,2] [1,] 0.00000 46.12338 [2,] 46.12338 0.00000 ``` ``` Units: [m] [,1] [,2] [1,] 0 4017987 [2,] 4017987 0 ``` ] --- count: false ###Distance Example .left-panel-dist1-auto[ ```r (pts = data.frame(y = c(40.7128, 34.4208), x = c(-74.0060, -119.6982 ), name = c("NYC","SB"))) (pts = st_as_sf(pts, coords = c("x", "y"), crs = 4326)) eqds = '+proj=eqdc +lat_0=40 +lon_0=-96 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs' # Greeat Circle Distance st_distance(pts) # Euclidean Distance st_distance(pts, which = "Euclidean") # Equal Area PCS st_distance(st_transform(pts, 5070)) # Equal Distance *st_distance(st_transform(pts, eqds)) ``` ] .right-panel-dist1-auto[ ``` y x name 1 40.7128 -74.0060 NYC 2 34.4208 -119.6982 SB ``` ``` Simple feature collection with 2 features and 1 field geometry type: POINT dimension: XY bbox: xmin: -119.6982 ymin: 34.4208 xmax: -74.006 ymax: 40.7128 geographic CRS: WGS 84 name geometry 1 NYC POINT (-74.006 40.7128) 2 SB POINT (-119.6982 34.4208) ``` ``` Units: [m] [,1] [,2] [1,] 0 4050406 [2,] 4050406 0 ``` ``` Units: [°] [,1] [,2] [1,] 0.00000 46.12338 [2,] 46.12338 0.00000 ``` ``` Units: [m] [,1] [,2] [1,] 0 4017987 [2,] 4017987 0 ``` ``` Units: [m] [,1] [,2] [1,] 0 3823549 [2,] 3823549 0 ``` ] --- count: false ###Distance Example .left-panel-dist1-auto[ ```r (pts = data.frame(y = c(40.7128, 34.4208), x = c(-74.0060, -119.6982 ), name = c("NYC","SB"))) (pts = st_as_sf(pts, coords = c("x", "y"), crs = 4326)) eqds = '+proj=eqdc +lat_0=40 +lon_0=-96 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs' # Greeat Circle Distance st_distance(pts) # Euclidean Distance st_distance(pts, which = "Euclidean") # Equal Area PCS st_distance(st_transform(pts, 5070)) # Equal Distance st_distance(st_transform(pts, eqds)) ``` ] .right-panel-dist1-auto[ ``` y x name 1 40.7128 -74.0060 NYC 2 34.4208 -119.6982 SB ``` ``` Simple feature collection with 2 features and 1 field geometry type: POINT dimension: XY bbox: xmin: -119.6982 ymin: 34.4208 xmax: -74.006 ymax: 40.7128 geographic CRS: WGS 84 name geometry 1 NYC POINT (-74.006 40.7128) 2 SB POINT (-119.6982 34.4208) ``` ``` Units: [m] [,1] [,2] [1,] 0 4050406 [2,] 4050406 0 ``` ``` Units: [°] [,1] [,2] [1,] 0.00000 46.12338 [2,] 46.12338 0.00000 ``` ``` Units: [m] [,1] [,2] [1,] 0 4017987 [2,] 4017987 0 ``` ``` Units: [m] [,1] [,2] [1,] 0 3823549 [2,] 3823549 0 ``` ]  --- # Area Example: CONUS ```r us_u_mp = st_cast(us_u_ml, "MULTIPOLYGON") df = data.frame(name = c("WGS84", "AEA", "EPDS"), area = c(sum(st_area(conus)), sum(st_area(st_transform(conus, 5070))), sum(st_area(st_transform(conus, eqds))))) ```  --- # Units in `sf` - The CRS in `sf` encodes the units of measurement relating to spatial features -- - Where possible geometric operations such as `st_distance()`, `st_length()` and `st_area()` report results with a units attribute appropriate for the CRS: -- - This can be both handy and very confusing for those new to it. Consider the following: ```r (l = sum(st_length(conus))) ``` ``` 94982205 [m] ``` ```r (a = sum(st_area(conus))) ``` ``` 7.837597e+12 [m^2] ``` --- We can set units if we do manipulations as well using the units package ```r units::set_units(l, "km") ``` ``` 94982.21 [km] ``` ```r units::set_units(l, "mile") ``` ``` 59019.21 [mile] ``` ```r units::set_units(a, "ha") ``` ``` 783759699 [ha] ``` ```r units::set_units(a, "km2") ``` ``` 7837597 [km^2] ``` ```r units::set_units(a, "in2") ``` ``` 1.21483e+16 [in^2] ``` --- # Units are a class - units are an S3 data object with attribute information and "rules of engagement" ```r class(st_length(conus)) ``` ``` [1] "units" ``` ```r attributes(st_length(conus)) %>% unlist() ``` ``` units.numerator class "m" "units" ``` ```r st_length(conus) + 100 ``` ``` Error in Ops.units(st_length(conus), 100): both operands of the expression should be "units" objects ``` ```r conus %>% mutate(area = st_area(.)) %>% ggplot(aes(x = name, y = area)) + geom_col() ``` ``` Don't know how to automatically pick scale for object of type units. Defaulting to continuous. ``` ``` Error in Ops.units(x, range[1]): both operands of the expression should be "units" objects ```  --- ### Unit values can be stripped of their attributes if need be: ```r # Via drop_units (units::drop_units(sum(st_length(conus)))) ``` ``` [1] 94982205 ``` ```r # Via casting (as.numeric(sum(st_length(conus)))) ``` ``` [1] 94982205 ``` --- class: center, middle, inverse #Lightning Re-cap --- ## Geographic Coordinate Systems - Geographic coordinate systems identify a location on the Earth’s surface using longitude and latitude. -- - Longitude is the angular distance East or West of the Prime Meridian plane. -- - Latitude is angular distance North or South of the equatorial plane. -- - Distances in GRSs are therefore **not** measured in meters -- - The surface of the Earth in GCS is represented by ellipsoidal surface. -- - Spherical models assume the Earth is a perfect sphere of a given radius. -- - Spherical models are rarely used because the Earth is **not** a sphere! -- - Ellipsoidal models are defined by two parameters: the semi major and semi minor axis -- - These are suitable because the Earth is compressed: the equatorial radius is around 11.5 km longer than the polar radius --- - Ellipsoids are part of a wider component of CRSs: **the datum** -- - Datums describe the irrigeularities in a earths surface (geoid) compared to a smooth ellipsoid -- In a local datums such as NAD27 the ellipsoidal surface is shifted to align with the surface at a particular location. In a geocentric datum such as `WGS84` the center is the Earth’s center of gravity --- # Projected coordinate reference systems - PCSs are based on Cartesian (XY) coordinates on an implicitly flat surface. -- - They have an origin, axes, and a unit of measurement (e.g. meters). -- - **All** PCSs are based on a GCSs and rely on projections to convert the 3D surface in XY values related to a false origin -- This transition cannot be done without adding **distortion** -- A projected coordinate system can preserve only one or two spatial properties. Projections are often named based on a property they preserve: - equal-area preserves *area* - azimuthal preserve *direction* - equidistant preserve *distance* - conformal preserve *local shape* --- # Gedesic Area and Length Measurements are often superior - Calcuated distance and area on the ellipsoid -- - Not all algorthimns are equal (in terms of speed or accuracy) -- - Some reduce precision to speed up calculations -- - Some of ArcMap’s functions offer the option to compute geodesic distances and areas however ArcMap does not clearly indicate _how_ its geodesic calculations are implemented ([cite](https://mgimond.github.io/Spatial/coordinate-systems.html#geodesic-geometries) -- - R is well documented, and is efficient! (still less so then PCS ... for now) -- - base `sf` implements "Greater Circle" distances is st_distance - `sf` binds to the libwgeom libray for geoid calcuations (geoid vs ellipoid) --- ## Assignment 1. Read in the `uscites.csv` data (lab 1 material) or from lab 03 and make it spatial (CRS = 4326) 2. Filter to include only Santa Barbara and your home town. (Should only have 2 points!) - If your home town is Santa Barbara, pick another one :) 3. Transform your filter object locations to: - An equal area projection (EPSG: 5070) and, - And eqidistance projection: '+proj=eqdc +lat_0=40 +lon_0=-96 +lat_1=20 +lat_2=60 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs' 4. Calculate the distance between the cites in all three projections using st_distance() 5. For one of the results, set the units to kilometers (km), and drop the units using the `units` package. --- class: middle, center # Submission: Submit your R script to Gauchospace and push to GitHub --- class: middle, center, inverse # END


Accordign to Wikipedia a flashcard is a card bearing information on both sides, which is intended to be used as an aid in memorization.
card bearing information on both sides, which is intended to be used as an aid in memorization.
A tutorial is created that details how one could create their own flashcard app.


Here you can use the Gene search box to search whether a gene comprises part of a cell type expression profile. You may search its gene ID via its gene symbol or name (e.g. APOA2). A dropdown box will appear showing related gene symbols and species-specific results to choose from.
You can also specify which species (e.g. Mus musculus) you are interested in. Use the Species drop down to specify your organism of interest. Once your selection is made, searching for a gene ID will restrict suggestions to the specified species.
Once you have selected the gene symbol of interest click Search and this will load a new page of all experiments where your selected gene is expressed.
Search results can be filtered using the selection criteria along the left hand side of the search results page. Selecting a filter criteria will remove all non-applicable experiments from the search results. For example: selecting Species: Homo sapiens will show only human experiments, similar to searching only on the human specific gene symbol in the Home page Search bar. You can also select experiments where your gene of interest is expressed only in a particular Organism part or Inferred cell type by selecting these from the relevant drop-down menus.
Additionally, by clicking on the "Marker gene" filter you can return search results based on whether your gene of interest comprises part of the specific expression profile for a cluster.
This is a list of the latest five experiments added to the Single Cell Expression Atlas, their title and upload date. You can click on the Results link or the experiment title to jump directly to the results page for that dataset. The number of assays is related to the number of sequencing runs. This is not equivalent to the number of cells as some cells do not pass sequencing file quality checks or you can have multiple sequencing runs or libraries generated from the same cell (technical replicates).
In order to view the full list of experiments in the Single Cell Expression Atlas click on the Browse Experiments tab along the top of the page.
This page shows you an updated list of all the experiments currently available in the Single Cell Expression Atlas. You can use the highlighted boxes to refine the list by Kingdom; for a keyword in the title; by species or an experiment variable as shown.
Each experiment in Single Cell Expression Atlas has its own experiment page, just click on the title of any experiment to view it. At the top of the results page you will see the title of the experiment, the type of experiment and species information.
Below the experiment information you will find a list of any associated publication(s).
The Experiment page is comprised of four sections:
Here you can view the results of the data analysis. This comprises of two visualisation methods: t-SNE plots and the marker gene heatmap. The t-SNE plots display subpopulations within the data and on the left and gene expression variation at single-cell resolution on the right. Each plot can be saved by clicking on the drop down menu symbol at the top right-hand side of the plot.
These are found in the t-SNE plots tab under Results. t-SNE plots are a useful way of visualising highly complex data in a 2D space. Although the size and distance between clusters is not very informative, manipulating the t-SNE perplexity value allows you to re-display the data in different ways.
The number of clusters (k value) shows the output of the Single-cell Consensus Clustering analysis (SC3 algorithm). The SC3 algorithm groups cell clusters based on similar expression profiles. This also colours the data to allow easier visualisation of different sub-populations within a dataset.
It is also possible to colour the clusters by metadata! The colour legend for each group of cells is displayed along the bottom of the t-SNE plot. The metadata used to colour the clusters is derived from different experimental groups described by the authors. This is displayed in the Experiment Design tab along the top of the results page.
You can hover over a single data point (cell) and a tool-tip will pop up. This displays the single cell identifier (a unique reference for that cell) and the cluster ID (which other cells share similar gene expression profiles). Additional information can include cell type: submitted cell type prior to sequencing analysis and/or the inferred cell type: cell type inferred by sequencing analysis based on gene expression profile.
The default values for perplexity and number of clusters are automatically generated by the analysis pipelines. They aim to provide a general idea of the data as well as the expected number of clusters.
The range of perplexity and k values are produced by the pipeline. However, there is a different logic for the selected default values. Perplexity value is chosen somewhat randomly, to be in the middle of the range. For the k value, we have a multi-step process: it will preferably be the expected clusters value determined by a member of the curation team. If not, it will be the “optimal” value as chosen by the SC3 algorithm output. If that is also not available, then it will just be the first value in the list.
Use the Gene search box to search whether a gene comprises part of a cells' expression profile.
Expression levels are displayed as TPM (transcripts per million) and broken down in five different, logarithmic colour ranges:
Genes which comprise part of the specific expression profile for a cell population (cluster) are defined as marker genes. These are displayed - 5 per cluster in the Marker Genes tab under Results. Along the top of the page, you can specify the number of clusters or to view only a subset of clusters. As with the t-SNE plots, the heatmap can also be saved as an image.
This tab displays the Experiment design file – a simplified table of the the sample metadata and experimental variables. Sample characteristics are generally intrinsic metadata required to understand each sample. Experimental variables are usually one or several sample characteristics that describe the experiment groups defined by the study aim. You can browse by row (each row is a single cell). You can also sort each column by clicking on the header row of your attribute of interest. Traverse the data by indicating the number of rows to view at the bottom and by clicking on the Previous and Next buttons.
You can download the file either via the Download button or along with the other data and results files by selecting the Downloads tab (see below).
Here you can see the Analysis Methods applied to the raw data to obtain the clustering and gene expression results.
The Downloads tab contains all the files that you can download:


14 March 2021
Dice Roll
Challenge Source: NahamCon CTF 2021
Challenge Category: cryptography
Challenge Text
Author: @JohnHammond#6971
When you have just one source of randomness, it's "a die", but when you can have muliple -- it's 'dice!'
NOTE: You are welcome to "brute force" this challenge if you feel you need to. ;)
Download the file below and press the Start button on the top-right to begin this challenge.
Solution
Downloading the code, we can see that the program allows us to randomly generate a 32 bit integer that represents a dice roll, reset the random seed (“shake the dice”), or try to guess the outcome of the next dice roll.
#!/usr/bin/env python3
import random
import os
banner = """
_______
______ | . . | \\
/ / \\ | . |. \\
/ ' / \\ | . . |.'|
/_____/. . \\ |_______|.'|
\\ . . \\ / \\ ' . \\ '|
\\ . . \\ / \\ ____'__ \\ |
\\ _____ \\ /
D I C E R O L L
"""
menu = """
0. Info
1. Shake the dice
2. Roll the dice (practice)
3. Guess the dice (test)
"""
dice_bits = 32
flag = open ( 'flag.txt' ). read ()
print ( banner )
while 1 :
print ( menu )
try :
entered = int ( input ( '> ' ))
except ValueError :
print ( "ERROR: Please select a menu option" )
continue
if entered not in [ 0 , 1 , 2 , 3 ]:
print ( "ERROR: Please select a menu option" )
continue
if entered == 0 :
print ( "Our dice are loaded with a whopping 32 bits of randomness!" )
continue
if entered == 1 :
print ( "Shaking all the dice..." )
random . seed ( os . urandom ( dice_bits ))
continue
if entered == 2 :
print ( "Rolling the dice... the sum was:" )
print ( random . getrandbits ( dice_bits ))
continue
if entered == 3 :
print ( "Guess the dice roll to win a flag! What will the sum total be?" )
try :
guess = int ( input ( '> ' ))
except ValueError :
print ( "ERROR: Please enter a valid number!" )
continue
total = random . getrandbits ( dice_bits )
if guess == total :
print ( "HOLY COW! YOU GUESSED IT RIGHT! Congratulations! Here is your flag:" )
print ( flag )
else :
print ( "No, sorry, that was not correct... the sum total was:" )
print ( total )
continue
Since seeding is optional and getrandbits (which is a deterministic, pseudo-random generator) is used, we should be able to predict values. Luckily, there is a tool called randcrack available that can use 32-bit getrandbits integer inputs to predict newly generated numbers with high accuracy. It takes 624 integers for randcrack to be ready to predict new numbers.
To that end, we can build a script to interact with the challenge connection, roll the dice via option #2 and feed the results into randcrack. After this we just use randcrack to guess the next roll with option #3 and get the flag.
import os
import sys
import struct
import socket
from randcrack import RandCrack
rc = RandCrack ()
address = 'challenge.nahamcon.com'
port = 31699
buffer = 4096
tcpsocket = socket . socket ( socket . AF_INET , socket . SOCK_STREAM )
tcpsocket . connect (( address , port ))
# Get the initial headers
received_data = tcpsocket . recv ( buffer ). decode ( 'utf-8' )
print ( 'Received:' , received_data )
# Check information
tcpsocket . send ( b'0 \n ' )
received_data = tcpsocket . recv ( buffer ). decode ( 'utf-8' )
print ( 'Received:' , received_data )
# Shake the dice
tcpsocket . send ( b'1 \n ' )
received_data = tcpsocket . recv ( buffer ). decode ( 'utf-8' )
print ( 'Received:' , received_data )
# Roll the dice enough for RandCrack to be able to work its magic
for i in range ( 624 ):
tcpsocket . send ( b'2 \n ' )
received_data = tcpsocket . recv ( buffer ). decode ( 'utf-8' )
received_data_lines = received_data . splitlines ()
received_roll = int ( received_data_lines [ 1 ])
rc . submit ( received_roll )
#print ('Received Roll Number',i,':', received_roll)
# Get a prediction of the next roll from RandCrack
try :
roll_prediction = rc . predict_randrange ( 0 ,<PHONE_NUMBER> )
print ( "Roll Prediction: " , roll_prediction )
except :
print ( 'Not enough rolls to predict - change range to 625.' )
exit ()
# Try to guess the next roll and output the response
tcpsocket . send ( b'3 \n ' )
received_data = tcpsocket . recv ( buffer ). decode ( 'utf-8' )
print ( 'Received:' , received_data )
roll_prediction_encoded = ( str ( roll_prediction ) + ' \n ' ). encode ( 'utf-8' )
tcpsocket . send ( roll_prediction_encoded )
received_data = tcpsocket . recv ( buffer ). decode ( 'utf-8' )
print ( 'Received:' , received_data )
tcpsocket . close ()
─( shinris3n㉿kodachi) -[~/sec/CTFs/Nahamcon_2021/dice_roll]
└─$ python3 roll_a_lot.py
Received:
_______
______ | . . |\
/ /\ | . |.\
/ ' / \ | . . |.' |
/_____/. . \ |_______|.'|
\ . . \ / \ ' . \' |
\ . . \ / \_ ___'__\|
\_____\/
D I C E R O L L
0. Info
1. Shake the dice
2. Roll the dice (practice)
3. Guess the dice (test)
>
Received: Our dice are loaded with a whopping 32 bits of randomness!
0. Info
1. Shake the dice
2. Roll the dice (practice)
3. Guess the dice (test)
>
Received: Shaking all the dice...
0. Info
1. Shake the dice
2. Roll the dice (practice)
3. Guess the dice (test)
>
Roll Prediction: 131726453
Received: Guess the dice roll to win a flag! What will the sum total be?
>
Received: HOLY COW! YOU GUESSED IT RIGHT! Congratulations! Here is your flag:
flag{e915b62b2195d76bfddaac0160ed3194}
0. Info
1. Shake the dice
2. Roll the dice (practice)
3. Guess the dice (test)
Tags: NahamConCTF2021


Built with Kanary and AngularJS
by Emmanuel Olucurious, for learning purposes only.
{{ message}}
Must be a valid email.
Password is required.