Final Project: Read from a csv file and write to a database table

Slides:



Advertisements
Similar presentations
Restaurant Database Food across California Rebecca Flores GEOG 375.
Advertisements

SQL*PLUS, PLSQL and SQLLDR Ali Obaidi. SQL Advantages High level – Builds on relational algebra and calculus – Powerful operations – Enables automatic.
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
BIRT Guide Transposing data from rows to columns
 Workflow that manages concurrent multiuser editors on a single ArcSDE data source  Versions represent states or views of the geodatabase  Edits.
Geodatabase basic. The geodatabase The geodatabase is a collection of geographic datasets of various types used in ArcGIS and managed in either a file.
Revision of course For examination purposes. Outline of Examination Question 1 is compulsory and is worth 40%. There are five other questions, of which.
Python & ModelBuilder. Overview Python/ModelBuilder Concepts – The Geoprocessor – Checking some environment variables – Providing feedback from your model/script.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
WinCupl Module M2.2 Section 4.2. Experiment 2 CUPL Header.
A Guide to SQL, Seventh Edition. Objectives Embed SQL commands in PL/SQL programs Retrieve single rows using embedded SQL Update a table using embedded.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
GDB The GeoDatabase. esf Laboratory for Applied GIS 2 But first…
Database Design IST 7-10 Presented by Miss Egan and Miss Richards.
LESSON 17 PREPARED BY MANJU. database A database is a collection of related information Access is the Microsoft Office database program that enables you.
Advance Model Builder Features. Advance Features Using Lists (also Batching) Iteration Feedback Model Only Tools Inline Variable Substitution Preconditions.
Python & ModelBuilder. Continuing Education Python and ModelBuilder Overview Python/ModelBuilder Concepts –The Geoprocessor –Checking some environment.
Working with cursors in Python GISDE Python Workshop Qiao Li.
1/29 Former leader of the “free” world … “I know what I believe. I will continue to articulate what I believe and what I believe.
Agenda Journalling More Embedded SQL. Journalling.
CPSC 203 Introduction to Computers T59 & T64 By Jie (Jeff) Gao.
Overview Cursors arcpy.da module Geometrys Arrays SpatialReferences
Introduction to ArcPy. Topics What is ArcPy? Accessing geoprocessing tools using ArcPy Writing scripts using ArcPy.
Threats Database V4 Model Geodatabase Relation Class Creation and Data Population June 25, 2007 Marlene McKinnon, GIS Specialist.
Word Processing Notes: Mail Merge Understand business documents.2 Mail Merge Example Letter shows Merge Fields (placeholders) Letter is Personalized.
If statements while loop for loop
Stored procedures1 Stored procedures and functions Procedures and functions stored in the database.
Chapter 14 - Designing Data Access Classes1 Chapter 14 Designing Data Access Classes.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 7 Files.
What have we learned?. What is a database? An organized collection of related data.
Commercial RDBMSs Access and Oracle. Access DBMS Architchecture  Can be used as a standalone system on a single PC: -JET Engine -Microsoft Data Engine.
Files Tutor: You will need ….
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 25 I’m Suffering from Information Overload.
Juanita Cano City of Sacramento Spring 2014 Geography 375.
GEO375 Final Project: From Txt to Geocoded Data. Goal My Final project is to automate the process of separating, geocoding and processing 911 data for.
© 2007 by Prentice Hall2-1 Introduction to Oracle 10g Chapter 2 Overview of SQL and SQL*Plus James Perry and Gerald Post.
More Oracle SQL Scripts. Highlight (but don’t open) authors table, got o External data Excel, and make an external spreadsheet with the data.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
Aggregator  Performs aggregate calculations  Components of the Aggregator Transformation Aggregate expression Group by port Sorted Input option Aggregate.
Database Overview What is a database? What types of databases are there? How are databases more powerful than spreadsheets?
William Perry U.S. Geological Survey Western Ecological Research Center Geography 375 Final Project May 22, 2013.
Lecture 10: Geoprocessing with Python (II) Dr. Taysir Hassan Abdel Hamid Associate Professor, Information Systems Dept., Faculty of Computers and Information.
Notes: **A Row is considered one Record. **A Column is a Field. A Database is…  an organized set of stored information usually on one topic  a collection.
Differential Leveling Conversion and Analysis Toolset Lisa Berry University of Redlands, MS GIS Program.
CS422 Principles of Database Systems Stored Procedures and Triggers Chengyu Sun California State University, Los Angeles.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Outline of Script Import Modules Setup Workspace Environment and Assign Data Path Variables Summary of Script Title and Author Info.
Introduction to GIS Programming Final Project Submitted by Todd Lenkin Geography 375 Spring of 2011 American River College.
Advanced Editing Processes
ASP.NET Programming with C# and SQL Server First Edition
A Guide to SQL, Seventh Edition
Making a JSON file.
Improving Georeferencing Workflow with Python
Chapter 4 MS ACCESS DATABASE.
CFS Community Day Core Flight System Command and Data Dictionary Utility December 4, 2017 NASA JSC/Kevin McCluney December 4, 2017.
Azure Machine Learning & ML Studio
1) What is a Database? A database is an organized collection of information about a subject. Examples: Address Book, Telephone Book.
Geography 375 Introduction to Python May 15, 2015
Chapter 7 Files and Exceptions
Validation of Ebola LOD
1) What is a Database? A database is an organized collection of information about a subject. Examples: Address Book, Telephone Book.
ASP.NET Relationships between tables
COP 2700 – Data Structures (SQL)
Updating Databases With Open SQL
Virginia Lenvik Geography 375 Spring 2013
Midwest-bound A Site Suitability Analysis of South Bend, Indiana for Relocation by Joi Misenti Geog 375--Spring 2016.
Improving workflow at CNDDB
Clip & Convert to ASCII Program Kelly Knapp Spring 2010
Final Project Geog 375 Daniel Hewitt.
Updating Databases With Open SQL
Presentation transcript:

Final Project: Read from a csv file and write to a database table Bibek Joshi 5/16/2014

Python Script Import csv and collections module Set Workspace Import csv and collections module Delete the geodatabase if it already exists Create file geodatabase and feature dataset

Python Script Create feature classes Use dictionary to store feature class name and type Create feature classes Use collections.OrderedDict() method to create field in the same order as it is read from the csv file header Use the dictionary to store field name and type

Python Script Read a csv file Create an insert cursor Read a csv file “Consume” the header line from the csv file using header variable Iterate through the reader object Add new rows

Python Script Delete insert cursor to prevent file lock Insert rows to the table Delete insert cursor to prevent file lock Except block for error handling/printing error messages

Input: csv file

Output: File Geodatbase and Feature Dataset

Output: Feature Classes

Output: Database Table