Thursday, October 11, 2012

Extract Raster Values from Points

5 Comments
The R blog article encourages me to write this solution to extract Raster values from points in R.

In geospatial analysis, extracting the raster value of a point is a common task. If you have few raster files or few points; you can extract the raster value by overlaying a point on the top of the raster using ArcGIS. What will you do, if you have hundreds of raster files and thousands of points? The easy solution is use loop in Python and ArcGIS. Is loop efficient to use? No. Can loop be avoided? Yes.

Then how? 

Follow the steps:
Step 1: Create a Raster stack or Raster brick of your raster files using “raster” package in R.
For example:
rasStack = stack(raster1, raster2,raster3 …rasterN)

Step 2:  Read point data, and convert them into spatial points data frame.
Sample: pointfile.csv
Point_ID
LONGITUDE
LATITUDE
1
48.765863           
-94.745194
2
48.820552           
-122.485318
3
48.233939           
-107.857685
4
48.705964           
-99.817363
For example:
pointCoordinates=read.csv(“pointfile.csv”)
coordinates(pointCoordinates)= ~ LONGITUDE+ LATITUDE

Step 3: Extract raster value by points
For example:
rasValue=extract(rasStack, pointCoordinates)

Step 4:  Combine raster values with point and save as a CSV file.
For example:
combinePointValue=cbind(pointCoordinates,rasValue)
write.table(combinePointValue,file=“combinedPointValue.csv”, append=FALSE, sep= ",", row.names = FALSE, col.names=TRUE)

Step 5: You should get the results as following table.
Result: combinedPointValue.csv
Point_ID
LONGITUDE
LATITUDE
raster1
raster2
raster3
1
48.765863           
-94.745194
200
500
-100
2
48.820552           
-122.485318
178.94
18.90
10.94
3
48.233939           
-107.857685
-30.74
-30.74
-0. 4
4
48.705964           
-99.817363
0
110
-0.7

Friday, September 28, 2012

Rich Web Experiance 2012

Be The First To Comment


Take Your Web Skills to the Next Level
Join us in Fort Lauderdale, FL     November 27 - 30, 2012
Early Bird Registration Ends October 22nd
The Rich Web Experience is the event that brings together web architects, developers, and designers who are changing the face of the web. You will gain a deeper understanding of emerging technologies, fresh ideas, and best practices.
RWX 2012 will offer a 120 sessions/workshops on: HTML5, CSS3, JavaScript, Ajax Libraries, jQuery, Semantic Web, iPhone, Android, Netty, Dojo, CoffeeScript, Solr, Node.js, Security, Semantic Web, NoSQL (Neo4J & MongoDB), and more.
Featured Speakers
·         Nancy Lyons - Co-author Interactive Project Management
·         Venkat Subramaniam - Founder of Agile Developer, Inc.
·         Connie Finkelman - Front-end Experience Architect
·         Brian Sletten - Forward Leaning Software Engineer
·         Meghan Wilker - Co-author Interactive Project Management
·         Brian Sam-Bodden - Java author, Ruby geek and Open Source Advocate
·         Craig Walls - Author of Spring in Action
·         Kenneth Kousen - Author of "Making Java Groovy"
·         Nathaniel Schutta - Author, speaker, software engineer focused on user interface design.
·         Raju Gandhi - Java/Ruby Developer/Language Geek
·         James Harmon - Android Expert
·         Ken Sipe - Architect, Web Security Expert
·         Dan Allen - Principal Software Engineer at Red Hat, Author and Open Source Advocate
·         Christopher Judd - Developer, Consultant, Author & Mobility Expert
·         Matthew McCullough - VP of Training, GitHub
·         Pratik Patel - CTO TripLingo & Code Hacker
·         David Chandler - Member of Google Web Toolkit Team
·         Tim Berglund - GitHubber
·         Peter Bell - Senior VP Engineering, General Assembly
·         Matt Stine - Enterprise Java/Cloud Consultant
·         Tom Valletta - Open Web Evangelist
·         Gabriel Dayley - Senior Software Developer
·         Denise Jacobs - Author of "The CSS Detective Guide"
·         Adrian Cole - Founder of jClouds
·         Luke Daley - Principal Engineer @ Gradleware
·         Erik Hatcher - co-author of "Lucene in Action"
·         James Ward - Principal Developer Evangelist, Heroku
·         Seth Ladd - Chrome Developer Advocate
·         Les Hazlewood - Apache Shiro PMC Chair
·         Michal Budzynski - HTML5 game developer working on Boot2Gecko at Mozilla
·         Aaron Frost - Front End Junkie, Wannabe Author, Aspiring Designer
·         Pete Campbell - Developer, Consultant, Principal @ Sumiro Labs LLC
·         Jason Porter - Senior Software Engineer Red Hat
·         Simone Bordet - Senior Engineer @ Intalio/Webtide
Workshops + Receive an iPad or Android Tablet Rebate
RWX 2012 will include 8 optional full-day workshops, including: iOS, Android, AppCelerator, HTML5, jQuery, JavaScript, Web Security, and Grails. In addition, RWX will offer over 20 half-day workshop sessions. Those who register for the iOS or Android workshops may select a registration option that includes a $500 credit towards the purchase of an iPad or an Android tablet. See the website for workshop details.
Alumni Discount
NFJS and Rich Web Experience are eligible to receive an additional $150 disount! To take advantage of this offer use the discount code: rwx150cdealum
Two Great Events
RWX / CDX will be held in conjunction with The Continuous Delivery experience. CDX is a renaming of the Project Automation Experience event. CDX will focus on automation techniques used to create better software for the Java Platform. CDX is your opportunity to learn from automation experts; covering Continuous Delivery, Cloud, Jenkins, Sonar, Chef, Puppet and Gradle projects. Your pass to RWX / CDX includes access to The Continuous Delivery Experience. 
Westin Fort Lauderdale Beach Resort
Where miles of spectacular soft sand beaches meet the far-reaching blue waters of the Atlantic Ocean stands The Westin Beach Resort, Fort Lauderdale. An oceanfront retreat with an inspirational setting on Fort Lauderdale Beach. 
All Inclusive Travel Packages
Save time and money. We are offering all inclusive travel packages that include: conference registration, 3 or 4 nights lodging (depending on package), and airfare (within the continental US). These rates are great, check out the details at: www.therichwebexperience.com.
Two Great Events


The Rich Web Experience will be co-located with the Continuous Delivery Experience
 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me