Monday, August 26, 2012 - Directories - Salisbury University

foremanyellowSoftware and s/w Development

Nov 7, 2013 (3 years and 7 months ago)

65 views

GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

GEOG 435/535

GIS Programming

GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

Introduction


Reasons for taking this course


Your expectations


_______________


_______________


My expectations


Course description


Exams


Attendance


Major goals for the semester


Relevance to emerging markets


Topics to be covered


GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

Syllabus


General introduction to programming


Familiarity with a GIS GUI


Introduction to SQL


Expansion of SQL to Spatial SQL (what I call
a
language for geographers
)


An introduction to python


Arcpy in context (spatial and non
-
spatial)


Individual projects or group projects


GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

Importance of Programming


Pushing buttons only gets you so far


Eliminating the glass ceiling


Google phenomenon has opened up a
massive hole in the geography dam that will
need to be filled


A way to explore new ways of doing things

GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

Some examples of what I mean…


Trade area analysis


Dashboards for DLLR


Dashboards for BayStat


Mass cartography


Agricultural evaluation


Parcel evaluation and critical areas


Data entry tasks


Discussion of parcel selection


SELECT parcels.* FROM
parcels, wetlands

where
touches(parcels.id,wetlands
.id)


SELECT sum(cur_lnd_a)+
sum(cur_tot_a) FROM parcels,
wetlands

where
touches(parcels.id,wetlands.id)

GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

Scripting vs. Programming


Is there a difference?


the line between a scripting language and a programming language

is
blurred, but a purist might say:


A scripting language is a type of programming language used to provide
control in another host environment. It is interpreted rather than compiled.
This means that a program built with a scripting language must be run in the
environment that contains the scripting language's interpreter and cannot be
run as a stand
-
alone application.


Benefits of scripting


Easy to learn
-

compared to traditional programming languages.


It takes much less code to do something with scripting than
when using a traditional programming language.


Benefits of programming


More tools available, faster, and includes interesting ways to
deploy the code


GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

What is .NET


The core aspects of the .NET
framework lie within the
Common Language
Infrastructure, or CLI.


The purpose of the CLI is to
provide a language
-
neutral
platform for


application

development


execution
, including functions for
exception handling, garbage
collection, security, and
interoperability

GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

What is .NET


Interoperability




Because interaction between new and older applications is commonly required, the .NET


Common Runtime Engine




Programming languages on the .NET Framework compile into an intermediate language known as
the Common Intermediate Language (CIL). In Microsoft's implementation this intermediate language
is not interpreted but rather compiled in a manner known as just
-
in
-
time compilation (JIT) into native
code.)


Language Independence




The .NET Framework introduces a Common Type System, or CTS. The CTS specification defines all
possible datatypes and programming constructs supported by the CLR and how they may or may
not interact with each other. Because of this feature, the .NET Framework supports the exchange of
instances of types between programs written in any of the .NET languages.


Base Class Library




The Base Class Library (BCL), part of the Framework Class Library (FCL), is a library of functionality
available to all languages using the .NET Framework. The BCL provides classes which
encapsulate
a number of common functions
, including file reading and writing, graphic rendering, database
interaction and XML document manipulation.


Simplified Deployment




Installation of computer software must be carefully managed to ensure that it does not interfere with
previously installed software, and that it conforms to increasingly stringent security requirements.
The .NET framework includes design features and tools that help address these requirements.


Security




The design is meant to address some of the vulnerabilities, such as buffer overflows, that have been
exploited by malicious software. Additionally, .NET provides a common security model for all
applications.


Portability




The design of the .NET Framework allows it to theoretically be platform agnostic, and thus
cross
-
platform

compatible. That is, a program written to use the framework should run without change on
any type of system for which the framework is implemented.


GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

Lots of languages to choose


Microsoft Languages



Visual Basic (VB or VB .NET)

-

A full
-
fledged development language that is normally used within Microsoft's
Visual Studio development environment. Visual Basic is a compiled language. Many professional applications that
are not coded in Visual C++ are coded in Visual Basic. Visual Basic includes superb editing, forms creation and
other accessories that facilitate use of this language.



Javascript (JScript or JScript .NET)

-

JScript is Microsoft's implementation of the widely used Javascript
language, a scripting version of the Java language. Javascript is a favorite of "cross platform" writers creating
Internet applications who wish to write scripts that work with many different browsers on Windows and non
-
Windows operating systems. JScript is an interpreted language that executes within an ActiveX scripting engine.



Visual Basic Scripting Edition (VBScript)

-

A subset of Visual Basic that is a very widely used scripting
language, in part because it comes free with every copy of Microsoft's Internet Explorer browser and may be freely
redistributed with applications created using Visual Studio. VBScript is the scripting language of choice (with JScript
being a second choice) for Microsoft web applications. It is the main language used with ActiveX scripting.
Microsoft's push into Internet has made VBScript immensely popular and well supported by third parties with
numerous books and objects. An interpreted language, VBScript has become so popular that third parties (such as
manifold.net
) are now extending it with forms creation and other tools. VBScript is virtually identical to VB so
expertise in either VB or VBScript is automatically useful in the other language as well. VBScript has also emerged
as the main language used to configure and customize Microsoft's Enterprise class servers.



OTHER LANGUAGES



Python
-

Python is a widely used general
-
purpose, high
-
level programming language. Its design philosophy
emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than
would be possible in languages such as C.The language provides constructs intended to enable clear programs on
both a small and large scale.



Java


GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

Examples of Languages


Which is better? You be the judge
(
distances.map
)


VBScript


Javascript


C#


python


Why are we using python?


Ease of use


Ease of implementation


We are geographers, not computer scientists


The ESRI world

GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

What’s so cool about VBScript


Using VBScript also means that no additional
software is required to program scripts of great
sophistication


There is no need to purchase Visual Basic or other
Visual Studio components, no need to buy any third
party accessories, no SDK, and no embedded
license fee for VB


VBScript is a fine "first language" to learn for
someone who has never programmed before


VBScript scripts can call any standard ActiveX
object if desired.


For example, one can add a third party ActiveX control to a form
that draws a custom picture of some sensing instrument's
readout


GEOG 435/535


GIS Programming

Salisbury University

Department of Geography

© Arthur J. Lembo, Jr.

My first script


The Text Editor


Hello, world


A note about .py extension


Height in centimeters



How do I do that?


Class data directory