GTECH 731 Lab Session 8 10/26/10 Lab 7 Geotools. Previous Labs Labs designed to gradually introduce C# and Visual Studio Started with simple, straight.

Slides:



Advertisements
Similar presentations
Inheritance. Many objects have a hierarchical relationship –Examples: zoo, car/vehicle, card game, airline reservation system Inheritance allows software.
Advertisements

1 Chapter 6: Extending classes and Inheritance. 2 Basics of Inheritance One of the basic objectives of Inheritance is code reuse If you want to extend.
1 l Inheritance Basics l Programming with Inheritance l Dynamic Binding and Polymorphism Inheritance.
OBJECT-ORIENTED PROGRAMMING. What is an “object”? Abstract entity that contains data and actions Attributes (characteristics) and methods (functions)
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
GTECH 731 Lab Session 5 Lab 4 Review, Lab 5 Intro 10/5/10 Lab 4 Review Lab 5 Overview.
GTECH 731 Lab Session 3 Lab 2 Review, Lab 3 Intro 9/20/10 Lab 2 Review Lab 3 Overview.
1 Chapter 7 l Inheritance Basics l Programming with Inheritance l Dynamic Binding and Polymorphism Inheritance.
Advanced Object-Oriented Programming Features
GTECH 731 Lab Session 6 10/12/10 Quiz Review Lab 5 Review Lab 6 Intro.
C# Programming: From Problem Analysis to Program Design1 10 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
GTECH 731 Lab Session 9 11/2/10 Lab 7 – Geotools Review Lab 8 – Simple Agent Model Semester Project.
C++ fundamentals.
A First Program Using C#
Programming Languages and Paradigms Object-Oriented Programming.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
JTS Topology Suite JTS Topology Suite An API for Processing Linear Geometry Martin Davis, Senior Technical Architect
“is a”  Define a new class DerivedClass which extends BaseClass class BaseClass { // class contents } class DerivedClass : BaseClass { // class.
An Object-Oriented Approach to Programming Logic and Design
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
BIM313 – Advanced Programming Techniques Object-Oriented Programming 1.
6. Simple Features Specification Background information UML overview Simple features geometry.
Features of Object Oriented Programming Lec.4. ABSTRACTION AND ENCAPSULATION Computer programs can be very complex, perhaps the most complicated artifact.
Inheritance in the Java programming language J. W. Rider.
Session 08 Module 14: Generics and Iterator Module 15: Anonymous & partial class & Nullable type.
Programming using C# for Teachers Introduction to Objects Reference Types Functions of Classes Attributes and Types to a class LECTURE 2.
Inheritance - Polymorphism ITI 1121 Nour El Kadri.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Programming in Java CSCI-2220 Object Oriented Programming.
1 Interfaces and Abstract Classes Chapter Objectives You will be able to: Write Interface definitions and class definitions that implement them.
C# Programming: From Problem Analysis to Program Design1 10 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
CIS162AD Inheritance Part 3 09_inheritance.ppt. CIS162AD2 Overview of Topics  Inheritance  Virtual Methods used for Overriding  Abstract Classes and.
Pengantar OOP Class-Java. 2 Software Development Tools Using Sun Java SDK alone Source File(s) (.java) Programmer Compiler (javac) Class File(s) (.class)
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6: Transition to Java Programming with Alice and Java First Edition.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Types and Interfaces COMP.
Lecture 19: Introduction to Classes Professor: Dr. Miguel Alonso Jr. Fall 2008 CGS2423/COP1220.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
CPS120: Introduction to Computer Science Lecture 16 Data Structures, OOP & Advanced Strings.
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Assignment 3 is due Sunday, the 8 th at 7pm. Problems with assn 3? Discuss at your team meeting tonight.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
COMPUTER SCIENCE & TECHNOLOGY DEGREE PROGRAMME FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UVA WELLASSA ‏ Properties of Object Oriented Programming.
C# Programming: From Problem Analysis to Program Design1 Creating Your Own Classes C# Programming: From Problem Analysis to Program Design 4th Edition.
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
Inheritance Chapter 7 Inheritance Basics Programming with Inheritance
Creating Your Own Classes
Classes and Inheritance
Advanced Object-Oriented Programming Features
Inheritance and Polymorphism
Types of Programming Languages
Programming Language Concepts (CIS 635)
Geographic Information Systems
ATS Application Programming: Java Programming
Inheritance Basics Programming with Inheritance
Java Programming Language
Lecture 22 Inheritance Richard Gesick.
Inheritance Dr. Bhargavi Goswami Department of Computer Science
Classes & Objects: Examples
JTS Topology Suite An API for Processing Linear Geometry
Spatial and temporal data management
Computer Programming with JAVA
Spatial Databases SpatiaLite & PostGIS.
Tonga Institute of Higher Education
Object-Oriented Programming
CIS 199 Final Review.
Chapter 11 Class Inheritance
Topics OOP Review Inheritance Review Abstract Classes
Presentation transcript:

GTECH 731 Lab Session 8 10/26/10 Lab 7 Geotools

Previous Labs Labs designed to gradually introduce C# and Visual Studio Started with simple, straight forward procedural programs with “literal” values that executed statements from start to finish i.e., “Hello world” and calculation converting “feet” to “meters” Added variable to code making calculation more flexible i.e., converting feet to meters Took user input and assigned it to variable Take in name and say hello Used boolean operations to direct control of program User choice determined unit to convert from feet All procedural programming Flow of logic beginning to end Variables separate from procedures that operated on them

Lab 6 – Object Oriented Programming Data and functionality are combined into self-contained entity – Object Objects “know” what they “are” and what they “can do” Type of object defined with set of hierarchical classes State of object defined by member variables Inherited from higher level, parent class Local, unique more specific to child class Aggregation of other objects Functionality of object defined methods Could inherit methods from higher level, parent class Override methods from higher level with locally defined version Unique methods at lower levels not available in parent class Object is instance of Class making methods and variables available Class is definition of an object: “Honda Civic” defines particular vehicle Object is instance of class: “My Car” is an instance of Honda Civic

Lab 6 – Simple Geometry Class Library You created simple, stand-alone Geometry Class Library Geometry sName Virtual Draw() Virtual Length() Point : Geometry X,Y variables Override Draw() Line : Geometry Aggregation of 2 Point objects Start and End Override Draw() Override Length() LineString : Geometry Aggregated list of Point objects Override Draw() Override Length()

Lab 7 – Geotools Geometry Class Library Geotools is Urban Science Applications, Inc.’s answer to your Geometry class library More extensive and works differently than your library Many attributes beyond simple X,Y coordinates Spatial reference, Precision Model, Envelope, GeometryFactory Extensive set of predefined Geometry classes Coordinate, Coordinates, Point, LineString, Polygon etc. Predefined Operation classes Buffer, Distance, Overlay etc. Predefined Algorithm classes ConvexHull, LineIntersector, PointLocator, SimplePointInring etc.

Lab 7 – Geotools “State” definition of Geometry, Coordinate and Point classes public abstract class Geometry : IGeometry, IComparable { protected static CGAlgorithms _cgAlgorithms = new RobustCGAlgorithms(); protected PrecisionModel _precisionModel; protected int _SRID;//spatial reference id protected Envelope _envelope; protected GeometryFactory _geometryFactory; protected string[] _sortedClasses = new string[]{"Point", "MultiPoint", "LineString“, "LinearRing", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection" }; InternalGeometryComponentFilter _geometryChangedFilter = new InternalGeometryComponentFilter(); public class Point : Geometry, IPoint { protected Coordinate _coordinate; #region Properties public double X { get { return _coordinate.X; } public double Y { get { return _coordinate.Y; } #endregion public class Coordinate : IComparable, ICloneable { private double _x=0.0; private double _y=0.0; private double _z=Double.NaN;

Lab 7 – Geotools Predefined code available for use in any project Compiled in a Dynamic Link Library (.DLL file) Non-executable on its own Provides state of Geometric objects and many useful functions Use Geotools to hold state of objects in custom Geometry library Provides some familiar methods such as “GetLength” Need provide other methods such as “Draw” Geotools uses concept of “Factory” “GeometryFactory” object to create Geometry objects Used to Instantiate objects instead of “new” keyword Initializes them to a desired state including spatial reference, precision etc. Provides foundation for Simple Feature Spec Part of Open Geospatial Consortium standards (

Lab 7 – Geotools Implementation (Partial?) of Simple Feature Spec ?? ?? ?

Lab 7 – Geotools Class Definition Headers Point MultiPoint LineSegment LineString LinearRing MultiLineString Polygon MultiPolygon GeometryCollection public class LineString : Geometry, ILineString { protected Coordinates _points; public class Point : Geometry, IPoint { protected Coordinate _coordinate; public class MultiPoint : GeometryCollection, IMultiPoint public class LinearRing : LineString, ILinearRing public class MultiLineString : GeometryCollection, IMultiLineString public class Polygon : Geometry, IPolygon { protected LinearRing _shell = null; protected LinearRing[] _holes; public class MultiPolygon : GeometryCollection, IMultiPolygon public class GeometryCollection :Geometry, IGeometryCollection, IEnumerable internal class LineSegment : IComparable { protected Coordinate _p0; protected Coordinate _p1;

Lab 7 – Geotools Spatial Reference? Curve, MultiCurve, Surface, MultiSurface? Must be custom defined by developer? Provided somewhere else in Geotools? public abstract class Geometry : IGeometry, IComparable { protected static CGAlgorithms _cgAlgorithms = new RobustCGAlgorithms(); protected PrecisionModel _precisionModel; protected int _SRID;//spatial reference id protected Envelope _envelope; protected GeometryFactory _geometryFactory; protected string[] _sortedClasses = new string[]{"Point", "MultiPoint", "LineString“, "LinearRing", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection" }; InternalGeometryComponentFilter _geometryChangedFilter = new InternalGeometryComponentFilter();

Lab 7 – Geotools Summary Extensive class library Geometry objects Holds state of Geometric objects and many functions Predefined Geometries, Operations and Algorithms “GeometryFactory” to Instantiate objects Spatial reference and precision Provides foundation for Simple Feature Spec Code available in a Dynamic Link Library (.DLL file)

Lab 7 – Geotools Lab Overview